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

Mike Jackson mike.jackson at bluequartz.net
Tue Feb 2 08:19:49 EST 2010


It seems that you are passing in a smart pointer when the argument
wants an actual pointer. You may also need to dynamic_cast<> to get it
to work with Visual Studio. Also, what version of Visual Studio is
this?
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net

On Mon, Feb 1, 2010 at 10:41 PM,  <Neil.Burdett at csiro.au> wrote:
> 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
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list