[Insight-users] Please ignore: Re: MeanSquaresImageToImageMetric Error: SetFixedImage is not a member

Emma Ryan eryanvtk at yahoo.com
Tue Aug 7 14:31:56 EDT 2007



Please ignore my email with the following message. It was a stupid one. The error was in  using 's' instead of 'S' in SetFixedImage

Sorry to bother everyone,
Emma 

Hi,

  I am trying to compute the Mean Square error between two images and have the following segment of code for it.

But I get an error, 

"C:\Projects\CPP\Test\PreProcessor\Preproc.cpp(700): error C2039: 'setFixedImage' : is not a member of 'itk::MeanSquaresImageToImageMetric<TFixedImage,TMovingImage>'
        with
        [
            TFixedImage=FixedImageType,
            TMovingImage=MovingImageType
        ]


Is setFixedImage() not a member of the MeanSquaresImageToImageMetric ?  

Emma

The following
 is my piece of code.


       typedef itk::MeanSquaresImageToImageMetric <FixedImageType, MovingImageType> MetricType;
       typedef itk:: LinearInterpolateImageFunction <MovingImageType,double > InterpolatorType;
    
       MetricType::Pointer         metric        = MetricType::New();
       InterpolatorType::Pointer   interpolator  = InterpolatorType::New();

        OptimizerType::ParametersType finalParameters = registration->GetLastTransformParameters();    

        metric->SetInterpolator(interpolator);
        metric->SetTransform(transform);
   
     metric->setFixedImage(fixedImageOrig);
        metric->setMovingImage(caster->GetOutput());
        metric->SetTransformParameters(finalParameters);    
        MetricType::TransformParametersType finalParam = registration->GetLastTransformParameters();

        std::cout<<" MetricOnOriginalImage = "<<metric->GetValue(finalParam)<<std::endl;





      Got a little couch potato? 

Check out fun summer activities for kids.





       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070807/d64fabc2/attachment.html


More information about the Insight-users mailing list