<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi,<br><br> I am trying to compute the Mean Square error between two images and have the following segment of code for it.<br><br>But I get an error, <br><br>"C:\Projects\CPP\Test\PreProcessor\Preproc.cpp(700): error C2039: 'setFixedImage' : is not a member of 'itk::MeanSquaresImageToImageMetric<TFixedImage,TMovingImage>'<br> with<br> [<br> TFixedImage=FixedImageType,<br> TMovingImage=MovingImageType<br> ]<br><br><br>Is setFixedImage() not a member of the MeanSquaresImageToImageMetric ? <br><br>Emma<br><br>The following
is my piece of code.<br><br><br> typedef itk::MeanSquaresImageToImageMetric <FixedImageType, MovingImageType> MetricType;<br> typedef itk:: LinearInterpolateImageFunction <MovingImageType,double > InterpolatorType;<br> <br> MetricType::Pointer metric = MetricType::New();<br> InterpolatorType::Pointer interpolator = InterpolatorType::New();<br><br> OptimizerType::ParametersType finalParameters = registration->GetLastTransformParameters(); <br><br> metric->SetInterpolator(interpolator);<br> metric->SetTransform(transform);<br>
metric->setFixedImage(fixedImageOrig);<br> metric->setMovingImage(caster->GetOutput());<br> metric->SetTransformParameters(finalParameters); <br> MetricType::TransformParametersType finalParam = registration->GetLastTransformParameters();<br><br> std::cout<<" MetricOnOriginalImage = "<<metric->GetValue(finalParam)<<std::endl;<br><br></div></div><br>
<hr size=1>Got a little couch potato? <br>
Check out fun <a href="http://us.rd.yahoo.com/evt=48248/*http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz">summer activities for kids.</a></body></html>