[Insight-users] Outputting the metric surface for a registration

Luis Ibanez luis . ibanez at kitware . com
Thu, 25 Sep 2003 02:46:32 -0400


Hi Carolyn


Please look at the file

    Insight/Testing/Code/Algorithms/
            itkMeanSquaresImageMetricTest.cxx


and in line 189 replace the for() loop with
two nested for loops, or three nested for loops
(depending on whether your registration has 2
or 3 parameters.)

You will have to decide what range of the
parameters you want to evaluate.

Note that you also have to create and allocate
an image  of type

      itk::Image< float , Dim > ImageType

where "Dim" is 2 or 3 depending on the number
of parameters of the registration.  This image
will hold the various values of the metric.


Then in line 189 you store every result from
->GetValue() into the corresponding pixel of
the image containing the metrics values.

---

A more elegant way is to use an ImageRegionIteratiorWithIndex,
visit the "metric" image with a single while loop,
and at every pixel convert it.GetPixel() to a point, using
metricImage->TransformIndexToPhysicalPoint().  Then passing
the point components as parameters of the transform and
evaluate the metric at that point.



Regards,



   Luis



--------------------------
Carolyn Johnston wrote:
> Is there a way that I can get ITK to output an image of the metric 
> surface for a 2- or 3-parameter registration?
> 
> thanks, Carolyn
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>