[Insight-users] metric MeanSquaresImageToImageMetric1

elhadj meljane elhadj.meljane at gmail.com
Sat Jul 24 13:21:52 EDT 2010


Dear all, Hi,

I'm trying to get the metric as output of the example

MeanSquaresImageToImageMetric1.cxx


 Unfortunately there isn't  a method like GetOutput() so I can get the
metric by

 metric->GetOutput();

and then  write the metric in a file as an image.

However at the end of this example, they use the displacement to get the
values of the metric at points defined by the displacement, see below the
method that implement this.
Do I have to give the displacement vector as input to get the value of the
metric by GetValu() ? How to know the range  ? They use translations as
transformation.

Thank you
Haj


 MetricType::TransformParametersType displacement( Dimension );
  const int rangex = 50;
  const int rangey = 50;
  for( int dx = -rangex; dx <= rangex; dx++ )
    {
    for( int dy = -rangey; dy <= rangey; dy++ )
      {
      displacement[0] = dx;
      displacement[1] = dy;
      const double value = metric->GetValue( displacement );
      std::cout << dx << "   "  << dy << "   " << value << std::endl;
      }
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100724/b3b6a17b/attachment.htm>


More information about the Insight-users mailing list