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

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 18 13:26:37 EDT 2010


Hi Neil,

You have a mismatch between the declarations of Fixed and Moving
images in two sections of your code.


The error message indicates that in some section you are using:

2>            TFixedImage=itk::Image<unsigned char,2>,
2>            TMovingImage=itk::Image<unsigned char,2>,
2>

while, in another section you are using:

2>            TFixedImage=itk::Image<float,2>,
2>            TMovingImage=itk::Image<float,2>,


Please use consistent types.



      Regards,


               Luis


-------------------------------------------------

On Mon, Mar 8, 2010 at 2:38 AM,  <Neil.Burdett at csiro.au> wrote:
> Hi Luis,
>        After implementing the change you suggested below I don't get the smartPointer error but I now the following error...
>
> 2>Compiling...
> 3>------ Build started: Project: itkRegistrationBasedInterpolationFilterTest, Configuration: Debug Win32 ------
> 3>Compiling...
> 2>milxImageInterpolation.cxx
> 3>itkRegistrationBasedInterpolationFilterTest.cxx
> 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::PDEDeformableRegistrationFilter<TFixedImage,TMovingImage,TDeformationField> *' to 'itk::PDEDeformableRegistrationFilter<TFixedImage,TMovingImage,TDeformationField> *'
> 2>        with
> 2>        [
> 2>            TFixedImage=itk::Image<unsigned char,2>,
> 2>            TMovingImage=itk::Image<unsigned char,2>,
> 2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
> 2>            TRealType=float
> 2>        ]
> 2>        and
> 2>        [
> 2>            TFixedImage=itk::Image<unsigned char,2>,
> 2>            TMovingImage=itk::Image<unsigned char,2>,
> 2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType
> 2>        ]
> 2>        and
> 2>        [
> 2>            TFixedImage=itk::Image<float,2>,
> 2>            TMovingImage=itk::Image<float,2>,
> 2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType
> 2>        ]
> 2>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
> 2>        c:\milx-view\lib\include\itk-ext\modules\basicfilters\itkRegistrationBasedInterpolatorFilter.txx(86) : while compiling class template member function 'void itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>::GenerateData(void)'


More information about the Insight-users mailing list