Hi ITK users,<br> <br> I am trying to implement, following the example given in the ITK guide, an affine registration<br>routine. Somewhere at the top of the code, I set<br><br> typedef itk::AffineTransform<unsigned char, 2> TransformType;<br>
typedef itk::RegularStepGradientDescentOptimizer OptimizerType;<br> typedef itk::LinearInterpolateImageFunction< BFrameType, double > InterpolatorType;<br> typedef itk::MeanSquaresImageToImageMetric< BFrameType, BFrameType > MetricType;<br>
typedef itk::ImageRegistrationMethod<BFrameType, BFrameType> RegistrationType;<br><br>// then I create the necessary smart pointers to objects<br><br> TransformType::Pointer transform = TransformType::New();<br>
OptimizerType::Pointer optimizer = OptimizerType::New();<br> InterpolatorType::Pointer interpolator = InterpolatorType::New();<br> RegistrationType::Pointer registration = RegistrationType::New();<br> MetricType::Pointer metric = MetricType::New();<br>
<br>// and then I associate them to the registration filter:<br> registration->SetOptimizer( optimizer );<br> registration->SetTransform( transform ); // <b>error on this line</b><br> registration->SetInterpolator (interpolator ); <br>
registration->SetMetric( metric ); <br><br>// including the reference and floating images<br><br> registration->SetFixedImage( ref ) ; <br> registration->SetMovingImage( flt );<br><br>during the build (on MS Visual studio 2010) I get the following error:<br>
<br>Error 12 error C2664: 'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::SetTransform' : cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::Transform<TScalarType,NInputDimensions,NOutputDimensions> *' <br>
<br>Can anyone help with useful insights? <br><br>Thanks,<br>Sid.<br>