Proposals:Decoupling ImageMetric from BSplineDeformableTransform
From KitwarePublic
Jump to navigationJump to search
The Problem
- The ImageToImageMetric knows too much
- It is aware of the
- BSplineDeformableTransform
- BSplineIntepolateImageFunction
- It performs dynamic_casting to discover the type of the Transform and Interpolator
- It caches several arrays for the BSplineDeformableTransform
- The caching has the following problems
- It is not optional (can't be turned off)
- It is memory consuming (about 3 Gigabytes)
- It break class encapsulation
- The caching has the following problems
- It is aware of the
The Proposed Solution
- Add a TransformCacher class
- A default cacher will not do anything
- A cacher for the BSplineDeformableTransform will take over the code that is currently in the ImageToImageMetric
- More sophisticated cachers could be added
- The Transform class will use the default cacher
- The Metric will
- request the Transform for its cacher (at run time)
- use the cacher for passing a list of points to be mapped, and then map one by one using an index