Skip to content

Add MetaIO support for anatomical orientation and image direction

tbirdso requested to merge tbirdso/vtk:metaimage-orientation-io into master

Summary

  • Adds vtkAnatomicalOrientation to manage transformation between common anatomical spaces. VTK data is implicitly assumed to be in Left-Posterior-Superior space.
  • Adds support for direction and anatomical orientation to vtkMetaImageReader and vtkMetaImageWriter. Anatomical orientation describes signed axis orientation wrt a hypothetical patient while image direction describes rotation with respect to an anatomical space.

Background

This is the result of an effort to clean up previous work drafted by @alexis-girault in !5656. Original work was done in support of the much larger effort to add support for image orientations to VTK as detailed in #17480. This PR includes a few fixups from original draft code along and adds unit testing and test data to verify functionality.

Changes herein provide a path to allow oriented medical images to be imported into a VTK pipeline via the MetaImage (.mha) format. Some (though not all) VTK filters and rendering paths support oriented images. Prior to these changes there is not a clear I/O path for attaching orientations to image data without explicitly setting it inline.

Notes

NIFTI support originally proposed in !5656 is not included here in an effort to limit PR scope. There are many more potential VTK updates described in #17480 that are outside of the scope of these changes.

Merge request reports