View Revisions: Issue #4499

Summary 0004499: Apply linear transform with shear as non-linear transform
Revision 2018-01-22 13:38 by lassoan
Description

When shearing transform is applied to a volume then hardening the transform results in non-orthogonal IJK to RAS matrix, which may cause problems when the image is saved to file (for example, for nii images, the matrix is orthogonalized in the writer).

We could detect when non-orthogonal transformation matrix is hardened on a volume, and resample the volume (the same way as it would be done for non-linear transforms). For example, here:

https://github.com/Slicer/Slicer/blob/4e0a67e33b9334d57f42f65da58a7a40615bcba1/Libs/MRML/Core/vtkMRMLVolumeNode.cxx#L989-L1001

See this discussion for some more background: https://discourse.slicer.org/t/nrrd-vs-nii-regarding-affine-data-and-transforms/1896/4

Note that ApplyNonLinearTransform would need some improvements, as currently it resamples the image on the grid of the original volume, so the output may be heavily cropped - see 0004433.

Revision 2018-01-22 13:37 by lassoan
Description

When shearing transform is applied to a volume then hardening the transform results in non-orthogonal IJK to RAS matrix, which may cause problems when the image is saved to file (for example, for nii images, the matrix is orthogonalized in the writer).

We could detect when non-orthogonal transformation matrix is hardened on a volume, and resample the volume (the same way as it would be done for non-linear transforms). For example, here:

https://github.com/Slicer/Slicer/blob/4e0a67e33b9334d57f42f65da58a7a40615bcba1/Libs/MRML/Core/vtkMRMLVolumeNode.cxx#L989-L1001

See this discussion for some more background: https://discourse.slicer.org/t/nrrd-vs-nii-regarding-affine-data-and-transforms/1896/4