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

Left-Right Flip Discrepancy Between MPRAGE and ASL After dcm2niix Conversion #923

Open
YihanWu2001 opened this issue Mar 6, 2025 · 1 comment

Comments

@YihanWu2001
Copy link

We acquired MPRAGE and ASL images both in axial view and an MPRAGE image in sagittal view. We export them as Enhanced Dicom and Classic Dicom in the Philips scanner and convert them to NIfTI format using dcm2niix. After dcm2niix conversion, the MPRAGE and ASL images appear flipped left-to-right relative to each other when displayed slice-by-slice in MATLAB. This flipping is also reflected in the first row of the NIfTI affine transformation matrix with sign change. For MPRAGE, the first element of the affine matrix is positive. For ASL, the first element is negative. This left-right inconsistency occurs when using dcm2niix on both Classic DICOM and Enhanced DICOM. As a comparison check, we also converted the Classic DICOM to Analyze format (img/hdr) using SPM. In this case, the orientation was correct across both MPRAGE and ASL and the affine transformation matrix is the same, meaning no left-right flip was observed. We are wondering how the dcm2niix deals with MPRAGE and ASL images that cause the orientation flip and if we could make the orientation consistent for different images.

Image

@neurolabusc
Copy link
Collaborator

neurolabusc commented Mar 6, 2025

This is the expected behavior as you are ignoring the NIfTI spatial transforms. If you view the image as stored on disk, it is unlikely to be oriented correctly (there are 48 combinations). The solution is to view your image with a tool that is aware of spatial transforms. For example mricrogl, FSLeyes, NiiVue, or for a Matlab solution use nii_viewer. The easiest way to test my hypothesis is to drag and drop you NIfTI images onto NiiVue live demo.

Note that the DICOM coordinate system differs from NIfTI. DICOM has the first line at the top of the screen, with subsequent lines below (the way we write lines of text in English), while in NIfTI the first row is at the bottom of the screen with increasing line number moving up the page (the way we draw the y axes on a Cartesian graph). Another difference between dcm2niix and SPM is that it will attempt to reorient 3D acquisitions to match the NIfTI identity matrix (use -x i to disable this). Therefore, while SPM and dcm2niix reorder voxel data differently, they both encode the correct spatial transform.

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

2 participants