pyushkevich/itksnap

Issue with NIfTI spatial transforms

Opened this issue · 1 comments

dcm2niix issue 718 appears to suggest that the itksnap tools have issues with NIfTI spatial transforms.

To replicate a minimal example, you consider the NIfTI image ax_asc_35sl_6.nii which appears correctly in FSLeyes, MRIcroGL and itksnap. The header specifies a LAS orientation:

fslhd ax_asc_35sl_6.nii
...
sto_xyz:1	-3.250000 0.000000 -0.000000 104.000000 
sto_xyz:2	0.000000 3.230991 -0.388798 -58.684311 
sto_xyz:3	0.000000 0.350998 3.578943 -84.798035 
sto_xyz:4	0.000000 0.000000 0.000000 1.000000 
sform_xorient	Right-to-Left
sform_yorient	Posterior-to-Anterior
sform_zorient	Inferior-to-Superior

However, operations with c3d creates a NIfTI header that suggests an LPS image, and the resulting image appears flipped in the Anterior-Posterior (row) direction in FSLeyes, MRIcroGL and itksnap:

c3d ax_asc_35sl_6.nii -mean -o mean.nii
...
sto_xyz:1	-3.250000 0.000000 0.000000 104.000000 
sto_xyz:2	0.000000 -3.250000 0.000000 -58.684311 
sto_xyz:3	0.000000 0.000000 3.600000 -84.798035 
sto_xyz:4	0.000000 0.000000 0.000000 1.000000 
sform_xorient	Right-to-Left
sform_yorient	Anterior-to-Posterior
sform_zorient	Inferior-to-Superior

I am not sure how to determine the c3d version, but I installed it today from c3d-nightly-MacOS-arm64.dmg.