rordenlab / dcm2niix

dcm2nii DICOM to NIfTI converter: compiled versions available from NITRC
https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage
Other
872 stars 229 forks source link

Wrong gradient directions (flip ?) #477

Closed arnaudbore closed 3 years ago

arnaudbore commented 3 years ago

Describe the bug When I convert these series (DWI) of dicom to nifti and then compute DTI and extract a RGB map from tensor, I can see that the tensors are not in the right direction. It should be red in the corpus collosum (now it's green).

Is there something that shows me that I should flip my gradients right after dcm2niix and before moving forward with any computational stuff ? Or maybe an issue with this specific conversion.

To Reproduce Here are the dicom you can use and convert: dicoms

Then you can easily use mrtrix to compute first eigen vector from dti and see it as a RGB map with mrview.

dwi2mask dwi.nii.gz mask.nii.gz --fslgrad dwi.bvec dwi.bval
dwi2tensor dwi.nii.gz dti.nii.gz -fslgrad dwi.bvec dwi.bval -mask mask.nii.gz
tensor2metric dti.nii.gz  -vector v1.nii.gz

Version:

neurolabusc commented 3 years ago

@mr-jaemin do you have any thoughts on this? dcm2niix is faithfully transcribing the DICOM tags but they do not make much sense. The last two volumes report a b-value of 1100, but they look like b=0 and derived trace/ADC maps.

@arnaudbore I note that this data comes from the NIH. Is it possible that this is a custom sequence that does not store the expected information in the DICOM images? Do you have details on the sequence. Specifically, 45 volumes are stored to disk, but the last two do not look like b-weighted images.

arnaudbore commented 3 years ago

@neurolabusc Somebody shared these data with me because they had some issues to use tractoflow. I have no knowledge about the sequence. I shared the link to this issue with her so she can respond.

llevitis commented 3 years ago

Hi @neurolabusc - I'm the one who shared the data with @arnaudbore. I wasn't part of the lab when the data was acquired, so I have shared your questions with a few members of my lab and will hopefully get a response asap. Thank you so much to you and @arnaudbore for your prompt responses!

llevitis commented 3 years ago

Hi @neurolabusc and @arnaudbore, I just received this response from the person who created the sequence, so I may have to do quite a bit of additional data wrangling to be able to use TractoFlow:

"If I recall correctly, the acquisition would be utilizing the edti sequence and indicate that in the series name. If this is indeed the case, then the source of the problem is that the diffusion direction (gradient) information is NOT correct in the DICOM header. The sequence uses a custom set of diffusion directions and bvalues that are read in from an external file, being a cdiflist file. The benefit of the custom set of diffusion directions/bvalues allows us to acquire an optimized data set and not be restricted by GE’s very limited DTI acquisition interface. The downside is that there is no way to get this information into the DICOM header. Alternatively, the cdiflist file is provided and should be used for importing the data. The TORTOISE software package is the best option for this as I’ve worked with that group very closely over many years and we’ve debugged issues and continually improve their import routine to properly take care of the diffusion direction and bvalue information. If you would like to process your data acquired with the custom edti sequence in a pipeline other than TORTOISE, I would recommend using the ImportDICOM function in TOROTISE, with the -g option to provide the corresponding diffusion gradient file (cdiflist), and then output the diffusion gradient information using the TORTOISEBmatrixToFSLBVecs function. I think TORTOISE may have several options for output file formats, so you could look if a different one is more suited to the TractoFlow pipeline. I am not familiar with TractoFlow, so I’m not sure what to recommend. Let me know if you have any questions or need further clarification.

The good news is that GE has told us that in their next major software release they will allow for the users to create custom sets of diffusion directions and bvalues, which would eliminate the need for the cdiflist files we use now and thus provide correct gradient information in the DICOM header. Until then, know that any DTI acquisition on GE scanners acquired at the NIH with the edti sequence will have this same issue."

neurolabusc commented 3 years ago

dcm2niix assumes the DICOMs are veridical. It is clear that the public and known proprietary DICOM tags are incorrectly used in these images. As you note, this custom sequence does not store the details correctly in the DICOM file. This is a limitation of your images, not dcm2niix. Beyond specifying the gradients, you will need to remove the derived images (e.g. TRACE) from the raw data (as the custom sequence does not label these correctly). You can do this withfslroi <input> <output> <tmin> <tsize>.

llevitis commented 3 years ago

Thanks for the explanation @neurolabusc ! Hopefully I'll be able to resolve this asap.

mr-jaemin commented 3 years ago

As NIH explained above, PSD used a custom tensor file (diffusion gradient table) in DV26 software version. In this case, played-out gradient by PSD is correct as specified. But, GE (recon) read/save the tensor.dat to DICOM. I confirmed that the bvec information match GE tensor.dat 44th directions. As noted, GE save custom tensor to DICOM in MR29.1 release.

To retrieve tensor information, you need to contact NIH to obtain the custom tensor file. If needed, I can help you convert the custom tensor to bval/bvec format.

Jaemin Shin GE MR Scientist