[Insight-users] Image Metrics on Image Regions
Luis Ibanez
luis . ibanez at kitware . com
Mon, 16 Jun 2003 09:42:40 -0400
Hi Stefan,
A) The ImageMetrics in ITK can easily be used for
implementing a block matching algorithm. In fact
this is done internally during the deformable
registration process based on FEM.
ITK Image Metrics expect you to define the
following items:
1- fixed image
2- moving image
3- transform
4- interpolator
5- a region of interest in the fixed image.
The terms fixed, moving image are defined in
the context of image registration.
Item (5), the region of interest will be the
block you are trying to match. You define this
block on the fixed image.
In typical block-matching algorithms you are
probably looking just at translations transforms,
(not rotations nor scale changes). That makes
item (3) to be just the itk::TranslationTransform.
As an interpolator (item 4) you may want to stick
with the Linear interpolator just because it balances
precision with performance.
If you look at the example
Insight/Examples/Registration/ImageRegistration1.cxx
Described in the software guide
http://www . itk . org/ItkSoftwareGuide . pdf
in section 7.2, pdf-page 176,
Just remove all the code related to the optimizer
and the ImageRegistrationMethod. You will be left
with the typical code required for evaluating
a block matching algorithm.
You have the option of just computing the Derivatives
of the metric with respect to the parameters of the
transform (translations), or you could actually
perform full registration per each block ( by putting
back the optimizer and the registration method)
Actually the second option (performing full registration)
is the formal way to go, however it will not be the
fastest one...
You may want to prepare some coffee and evaluate both
approaches...
-------------------
B) You could use the Kernel based transforms as a
helper class for computing the Affine part of
the deformation field.
http://www . itk . org/Insight/Doxygen/html/classitk_1_1KernelTransform . html
The mechanism will be the following:
1) generate a set of source landmarks.
They could simply be a subsampling of points
in the space of the deformation field
2) compute the target landmarks.
Simply read the displacement vector from the
deformation field under each one of the source
landmarks, and add this diplacement vector to
the source landmark position in order to generate
the target landmark.
3) set both source and target landmarks to the
KernelBased transform, and compute its matrices.
Once the computation is done, you will have:
- AMatrix holds the rotation+scaling part of the Affine transform
- BVector holds the translation part of the Affine transform
- DMatrix holds the remaining deformable transform.
Of course, the more sampling points (landmarks) you use
for this transfrom, the more precise will be your estimation
of the Affine transform.
Note that you have many options for the Kernel to be used
with this transform. Each kernel will give you a slightly
different estimation of the affine transform. Try to use
the kernel that is closest to the mechanism you used for
generating your deformation field.
The options are:
- ElasticBodySpline
- ElasticBodyReciprocalSpline
- ThinPlateSpline
- ThinPlateR2LogRSpline
- VolumeSpline
Regards,
Luis
------------------------
Stefan Schmidt wrote:
> Hi everybody,
>
> I'm new to ITK and have sort of a hard time getting started...
>
> I'm trying to implement a block-matching algorithm.
> Could someone please give me a hint on how to use the Image Metrics available
> in ITK to compare regions of two images directly?
>
> I've yet another question:
> Is there some mechanism in ITK to estimate a (rigid/affine) transform from a
> displacement field (for example one given by a deformable registration
> filter)?
>
> Thanks in advance!
>
> Kind regards,
> Stefan Schmidt
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at www . itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>