[Insight-users] determine class name dynamically

Bing Jian bjian at cise . ufl . edu
Sat, 8 Nov 2003 14:08:52 -0500 (EST)


Hi, Ivan and Luis,

   Thanks a lot for your help.

  Currently I am trying to do registration on vector=valued
image using ITK registration framework. Finally I found that
there is no easy way due to the design of ImageRegistrationMethod
and ImageToImageMetric class.

  You know, I need to write my own metric function. At first,
I tried to build a class based on ImageToImageMetric class and
let the FixedImageType and MovingImageType be VectorImageType.
But it cannot work. There are two main barriers:
   1. a RecursiveGaussianGradientFilter is used and it only
takes ScalarImage as input.
   2. the InterpolatorFunction requires MovingImageType
to be ScalarImage.
   Both of them define RealType from MovingImageType::PixelType.
So if I use VectorTypeImage, then I am in trouble.

   Now my solution to subclass ImageToImageMetric is:
 1) add another template argument to represent VectorImageType
 2) add a VectorInterpolator member variable. I don't know
if it will be better if we have a same base class shared
by InterpolatorFunction and VectorInterpolatorFunction ans
use this base class in ImageToImageMetric.

   And one more suggestion to ImageRegistrationMethod is
to place such member variables as m_Optimzer, m_Metric
in the protected area instead of private area. So that
the subclass of it can access them directly without Get/Set
methods.

   Have a nice weekend!


-- 
Best wishes,
Bing Jian
bjian at cise . ufl . edu