rordenlab / dcm2niix

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

B vector from Siemens DICOM to Compressed NII (FSL) #339

Closed looneegee closed 5 years ago

looneegee commented 5 years ago

Dear Experts,

I am converting DMRI DICOM files from Siemens Prisma using the most recent version of dcm2niix. Specifications for orientations in Scanner is as below:

Sagittal (X) Right to Left Coronal (Y) Anterior to Posterior Transversal (Z) Inferior to Superior. Phase-encoding: Posterior to Anterior (-Y)

We have inputted a predefined diffusion vectors for 128 directions using "xyz" coordinate system. Issue 1) As I convert the resultant DMRI files and check the bvec file, I noticed that X and Y values are correct, but the sign of Z value is flipped, showing (X, Y, -Z).

Issue 2) Further, I noticed that the "PhaseEncodingDirection" field in .json file shows "j" instead of "-j", which is supposedly the marker for "pos-ant" encoding.

I wonder if this is a known issue, but hope bringing this up can be helpful. Please let me know if you need further information.

Thank you very much in advance,

neurolabusc commented 5 years ago

Notes for Siemens conversion is here. Note that dcm2niix attempts to convert scanner xyz to FSL ijk space. Also, note that the conventions for spatial directions differ between DICOM and NIfTI. Specifically, the Y coordinate increases as you go anterior in NIfTI but decreases in DICOM, likewise the X (Left, right). I believe this explains the difference you observe in phase encoding polarity and why the gradient vector appears different.

Please process your data with FSL - I provide a link to a dedicated document that describes this. If this works out fine, it suggests that dcm2niix is accurately converting your data to FSL's format. If not, could you please share a sample dataset with me (send link to data via DropBox, Box or Google drive to email listed in my avatar).

mharms commented 5 years ago

Hi, I doubt that there is any sort of bug or issue here, as this has all been fairly extensively validated, especially on modern Siemens scanners.

As regards the flip in the sign of the bvec in the z-axis, that is totally expected. The Siemens 'xyz' coordinate system refers to their magnet coordinate system, which for a head-first-supine patient is an "LAI" (R->L, P->A, S->I) coordinate system. Note that if you look at the diffusion directions as coded in the DICOM you then need to account for the fact that the DICOM standard uses a LPS "patient centric" coordinate system. But then, if you have a 2D "axial" acquisition, dcm2niix will write out the results in a LAS coordinate system. So, relative to the LAI coordinate system of the magnet, and the LAS coordinate system of the final dcm2niix output, there should be a sign flip of the z-value of the DiffusionVectors.dvs file, which is exactly what you are seeing.

As for the PhaseEncodingDirection, j is exactly what you should get for an acquisition with a "posterior-to-anterior" phase encoding direction, since the orientation of the output NIFTI is LAS (i.e., increasing j index is from a posterior to anterior direction).

looneegee commented 5 years ago

@neurolabusc Thank you, I read the documents, double-checked by running FSL analyses (eddy + dtifit) and Tractography (DSI studio), confirmed that the outcomes all have normal values (no negative values or weird tracts).

@mharms Thank you, that's really good to know! Indeed our data was acquired head-first-supine, although the trick was that the geometry of the position was still saying foot-to-head, implying inferior-to-superior. Just for the future reference I checked how dcm2niix handles Philips data when it has ap-fh-rl as a reference frame, and the bvec shows the sign flip accordingly (x direction only).

Sincerely appreciate all your help,