ITK Release 4/Image Class Hierarchy Refactoring: Difference between revisions
Line 41: | Line 41: | ||
* ImageAdaptors should present the correct interface for the image type they adapt. This can be accomplished with partial template specialization of the ImageAdaptor class to avoid modifying any of the existing adaptors. | * ImageAdaptors should present the correct interface for the image type they adapt. This can be accomplished with partial template specialization of the ImageAdaptor class to avoid modifying any of the existing adaptors. | ||
* These filters exploit regular spacing of images to achieve high performance and will need to be modified to handle the new image types or throw an exception when they encounter an unsupported type | * These filters exploit regular spacing of images to achieve high performance and will need to be modified to handle the new image types or throw an exception when they encounter an unsupported type: | ||
** [Fill these in as they are encountered] | |||
== Design == | == Design == | ||
== Implementation Plan == | == Implementation Plan == |
Revision as of 15:16, 23 September 2010
Image Class Hierarchy Refactoring
Motivation
The goal of this proposal is to add support for additional image types in ITK.
ITK currently supports several types of image:
- Image
- VectorImage
- SpecialCoordinatesImage
- BloxImage
- SparseImage
- LabelMap
- ImageAdaptors and subclasses
With the exception of the PhasedArray3DSpecialCoordinatesImage, all the image types assume that the image topology is an n-dimensional lattice and that voxels have regular spacing in each dimension. While it makes sense to preserve the topology assumption in this refactoring, the assumption of regular spacing should be relaxed wherever possible. The regular spacing assumption covers many cases in biomedical imaging, but it hinders ITK's use in certain applications such as microscopy and remote sensing images. For example, certain motorized stages used in confocal microscopes fail to achieve regular spacing in z when acquiring a 3D image (often called a stack of 2D images at different focal depths). Helpfully, these stages report the positions of z-planes acquired during image stack collection. Assuming a regular z-spacing in place of the actual z-plane positions may result in significant errors in image analysis algorithms run on the image.
Goals
In particular, this proposal aims to provide two new kinds of image classes:
- Digital Image - no physical embedding; raw lattice of voxel values
- Rectilinear Image - physically embedded image with origin, irregular spacing in each dimension, and orientation
The existing Image class will be preserved, but will aliased to a new type:
- Regular Image - physically embedded image with origin, regular spacing, and orientation; essentially ITK's current Image class regular spacing
Each of the physically embedded image types will properly calculate transforms from indices to physical coordinates and back.
Secondary Goals
Merge VectorImages into Images. An Image is merely a VectorImage with a single component per voxel.
Requirements
- Make changes fully backwards compatible (all examples and tests should compile and run without modification and all tests should pass)
Challenges and Potential Pitfalls
- ImageAdaptors should present the correct interface for the image type they adapt. This can be accomplished with partial template specialization of the ImageAdaptor class to avoid modifying any of the existing adaptors.
- These filters exploit regular spacing of images to achieve high performance and will need to be modified to handle the new image types or throw an exception when they encounter an unsupported type:
- [Fill these in as they are encountered]