rordenlab / MRIcroGL

v1.2 GLSL volume rendering. Able to view NIfTI, DICOM, MGH, MHD, NRRD, AFNI format images.
https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage
Other
207 stars 33 forks source link

Inconsistent qform and sform offsets with 3d crop in dcm2niix #64

Closed ckovach closed 3 weeks ago

ckovach commented 3 weeks ago

Crossposting from the NITRC site: We encountered a confusing problem with image coregistration which we ultimately traced to a discrepancy of the qform and sform offsets in nifti files generated with the 3D crop option (-x) of dcm2niix. Evidently the srow_z value in the header is updated with cropping, but the qoffset_z is not. Some versions of ITK default to the qform transformation when xform_code > 0 for both, and we ended up with images aligned in voxel space but not in scanner space. I suggest either updating qform to match sform or setting the qform_code value to NIFTI_XFORM_UNKNOWN (0) to indicate that the qform transform no longer matches scanner space.

neurolabusc commented 3 weeks ago

@ckovach MRIcroGL uses dcm2niix as a dependency. You will need to generate an issue with dcm2niix.