Open
Description
Hello
I compared the affine matrix after resampling, with different soft (mrtrix, sitk from torchio)
and I notice a small difference in the translation part of the affine when using nibabel function: nib.affines.rescale_affine()
I could find the same result if I modify nibabel code like that
Instead of
centroid = nib.affines.apply_affine(affine, (shape -1) // 2)
t_out = centroid - rzs_out @ ((new_shape -1) // 2)
I chage to
centroid = nib.affines.apply_affine(affine, (shape -1) / 2)
t_out = centroid - rzs_out @ ((new_shape -1) / 2)
it make sense to me to stay with float value for the centroid coordinate.
Cheers
Romain
Metadata
Metadata
Assignees
Labels
No labels