Closed tashrifbillah closed 4 years ago
Refer to https://github.com/pnlbwh/dMRIharmonization/blob/spm-bspline/lib/resampling.py#L46
nibabel puts an "extra" 1 in row 4, column 4 when saving image:
(base) [tb571@pnl-z840-2 test_data_release]$ fslhd /tmp/resampled_mask.nii.gz | grep _xyz ERROR: Illegal NIfTI file - /tmp/resampled_mask Zero determinant stored in sform and/or qform that is marked as valid qto_xyz:1 -2.000000 -0.000000 -0.000000 110.588867 qto_xyz:2 0.000000 1.785172 -0.901755 -99.087921 qto_xyz:3 -0.000000 0.901755 1.785172 -96.036179 qto_xyz:4 0.000000 0.000000 0.000000 1.000000 sto_xyz:1 0.000000 0.000000 0.000000 0.000000 sto_xyz:2 0.000000 0.000000 0.000000 0.000000 sto_xyz:3 0.000000 0.000000 0.000000 0.000000 sto_xyz:4 0.000000 0.000000 0.000000 1.000000 # notice the 1 in (4,4) position although it was not present in the given sform() # thus sform() becomes singular (base) [tb571@pnl-z840-2 test_data_release]$ fslhd Site1_Y_mask.nii.gz | grep _xyz qto_xyz:1 -2.000000 -0.000000 -0.000000 110.588867 qto_xyz:2 0.000000 1.785172 -0.901755 -99.087921 qto_xyz:3 -0.000000 0.901755 1.785172 -96.036179 qto_xyz:4 0.000000 0.000000 0.000000 1.000000 sto_xyz:1 0.000000 0.000000 0.000000 0.000000 sto_xyz:2 0.000000 0.000000 0.000000 0.000000 sto_xyz:3 0.000000 0.000000 0.000000 0.000000 sto_xyz:4 0.000000 0.000000 0.000000 0.000000 # in the given sform(), the matrix was completely zero, so no question about singularity/non-singularity
@suheyla2 's new test data masks have this "irregular" transform. Although they are irregular, we may be able to cover this base.
source: nibabel impact: minor TODO: devise a way to force the "extra" 1 to be zero, or make sform() and qform() completely non-singular.
PR #51
Refer to https://github.com/pnlbwh/dMRIharmonization/blob/spm-bspline/lib/resampling.py#L46
nibabel puts an "extra" 1 in row 4, column 4 when saving image:
@suheyla2 's new test data masks have this "irregular" transform. Although they are irregular, we may be able to cover this base.
source: nibabel impact: minor TODO: devise a way to force the "extra" 1 to be zero, or make sform() and qform() completely non-singular.