[Insight-users] 'itk::ImageRegistrationMethod<TFixedImage, TMovingImage>::SetTransform' : cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::Transform<TScalarType, NInputDimensions, NOutputDimensions> *'

Siddharth Srivastava siddys at gmail.com
Thu Nov 3 16:58:25 EDT 2011


Hi ITK users,

      I am trying to implement, following the example given in the ITK
guide, an affine registration
routine. Somewhere at the top of the code, I set

    typedef itk::AffineTransform<unsigned char, 2> TransformType;
    typedef itk::RegularStepGradientDescentOptimizer OptimizerType;
    typedef itk::LinearInterpolateImageFunction< BFrameType, double >
InterpolatorType;
    typedef itk::MeanSquaresImageToImageMetric< BFrameType, BFrameType >
MetricType;
    typedef itk::ImageRegistrationMethod<BFrameType, BFrameType>
RegistrationType;

// then I create the necessary smart pointers to objects

    TransformType::Pointer transform = TransformType::New();
    OptimizerType::Pointer optimizer = OptimizerType::New();
    InterpolatorType::Pointer interpolator = InterpolatorType::New();
    RegistrationType::Pointer registration = RegistrationType::New();
    MetricType::Pointer metric = MetricType::New();

// and then I associate them to the registration filter:
     registration->SetOptimizer( optimizer );
    registration->SetTransform( transform ); // *error on this line*
    registration->SetInterpolator (interpolator );
    registration->SetMetric( metric );

// including the reference and floating images

    registration->SetFixedImage(  ref ) ;
    registration->SetMovingImage( flt );

during the build (on MS Visual studio 2010) I get the following error:

Error    12    error C2664:
'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::SetTransform' :
cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to
'itk::Transform<TScalarType,NInputDimensions,NOutputDimensions> *'

Can anyone help with useful insights?

Thanks,
Sid.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111103/6ebae529/attachment.htm>


More information about the Insight-users mailing list