Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsl doesn't work anymore on DTI bruker2nifti stacks with more than 1 repetition #68

Closed
emicotti opened this issue Feb 22, 2021 · 5 comments

Comments

@emicotti
Copy link

Hello,
I have worked for many years using bruker2nifti to convert DTI Bruker raw data and then calculating Diffusion Tensor with fsl dtifit command.

A few weeks ago we have installed a new workstation. Trying do the usual DTI pipeline we noticed that fsl showed only half of the data. Digging into the problem we have discovered that fsl cannot "see" anymore the second repetition (we do two repetitions to correct deformation before averaging images).

The team of fsl told us that it happens because the two repetitions are stored in the nifti header as "5th dimension".
Old fsl release "flatten" any dimension above the 4th but recent realeases simply ignored all the dimensions higher than 4.
Do you think it is possible to make bruker2niffti assign the repetitions to the 4th dimension rather than 5th dimension?

Thank you very much.
Best
Edoardo

@gdevenyi
Copy link
Contributor

Hi, as per #67 this project is no longer being actively developed by its original maintainer. I suggest looking at https://github.com/BrkRaw/bruker

@SebastianoF
Copy link
Owner

Thanks @gdevenyi !

@emicotti Glad you had been using bruker2nifti over the past years!

I'll try to see if I'll ever have time to look into it. In the meantime you can either use https://github.com/BrkRaw/bruker as suggested, or find someone to take over its maintenance.

@emicotti
Copy link
Author

emicotti commented Mar 8, 2021

Thank you all for answer and suggestions.

@SebastianoF
Copy link
Owner

SebastianoF commented Apr 21, 2021

You have other two options:

  1. downgrade fsl to the previous version.

  2. add a small post-processing before feeding the converted images into fsl.

$ pip install nilabels, nibabel
import nibabel as nib

from nilabels.tools.aux_methods.utils_nib import set_new_data


def squeezer(nib_image):
    data = nib_image.get_data()
    new_data = data.squeeze()
    return set_new_data(nib_image, new_data)

    
if __name__ =="__main__":
    img = nib.load(<your path to nifti here - the one returned by bruker2nifti>)
    squeezed_img = squeezer(img)
    nib.save(squeezed_img, <your path to squeezed nifti here - the one to feed fsl>)

@SebastianoF
Copy link
Owner

SebastianoF commented Apr 21, 2021

By "convention" the fourth dimension of a NifTi image is left for the temporal evolution, and the fifth for the weights of the sequence or any other value that has no "temporal" component.

Even if I had time, it would be unwise to change bruker2nifti output because of how fsl, down the line, now works.

You understand other users may ingest the data into other software that use the five dimensional convention. So what solves the problem for you may create problems to them. I would recommend adding a fsl-pre-processing step as part of your pipeline.
Thanks for your contribution, as I am sure this issue will be useful to other users!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants