[Insight-users] Visual studio error ... cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::PDEDeformableRegistrationFilter

Neil.Burdett at csiro.au Neil.Burdett at csiro.au
Mon Feb 1 22:41:48 EST 2010


Hi,
     The following code compiles on Ubuntu but  on Visual Studio the highlighted line fails with;

2>c:\milx-view\lib\include\itk-ext\modules\basicfilters\itkRegistrationBasedInterpolatorFilter.txx(336) : error C2664: 'itk::MultiResolutionPDEDeformableRegistration2<TFixedImage,TMovingImage,TDeformationField,TRealType>::SetRegistrationFilter' : cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::PDEDeformableRegistrationFilter<TFixedImage,TMovingImage,TDeformationField> *'


        typename BaseRegistrationFilterType::Pointer filter_2to1;
    typename ActualRegistrationFilterType::Pointer actualfilter_2to1;

        ....


    // Perform registration of slice N-1 onto slice N

    actualfilter_2to1 = ActualRegistrationFilterType::New();
    actualfilter_2to1->SetMaximumUpdateStepLength( 2.0 );
    actualfilter_2to1->SetUseGradientType( static_cast<GradientType>(0) );
    filter_2to1 = actualfilter_2to1;
    filter_2to1->SmoothDeformationFieldOn();
    filter_2to1->SetStandardDeviations( 3.0 );
    filter_2to1->SmoothUpdateFieldOff();

    multires_2to1 = MultiResRegistrationFilterType::New();
    multires_2to1->SetRegistrationFilter( filter_2to1 );                  // This line fails with the above error...
    multires_2to1->SetNumberOfLevels( numLevels );
    multires_2to1->SetNumberOfIterations( &numIterations[0] );
    // We register Slice N onto slice N, so we can robustly work out correpondances between these 2 slices,
    // whe we start from slice N-1
    multires_2to1->SetFixedImage( filter1->GetOutput() );
    multires_2to1->SetMovingImage( filter2->GetOutput() );


The code looks okay to me and works fine under Ubuntu.

Any help will be much appreciated...


Thanks

Neil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100202/e1b0e767/attachment-0001.htm>


More information about the Insight-users mailing list