[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 Mar 8 01:38:38 EST 2010


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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(175) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<unsigned char>(wxString,wxString)' being compiled
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<char,2>,
2>            TMovingImage=itk::Image<char,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<char,2>,
2>            TMovingImage=itk::Image<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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(178) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<char>(wxString,wxString)' being compiled
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 short,2>,
2>            TMovingImage=itk::Image<unsigned short,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<unsigned short,2>,
2>            TMovingImage=itk::Image<unsigned short,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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(181) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<unsigned short>(wxString,wxString)' being compiled
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<short,2>,
2>            TMovingImage=itk::Image<short,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<short,2>,
2>            TMovingImage=itk::Image<short,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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(184) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<short>(wxString,wxString)' being compiled
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 int,2>,
2>            TMovingImage=itk::Image<unsigned int,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<unsigned int,2>,
2>            TMovingImage=itk::Image<unsigned int,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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(187) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<unsigned int>(wxString,wxString)' being compiled
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<int,2>,
2>            TMovingImage=itk::Image<int,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<int,2>,
2>            TMovingImage=itk::Image<int,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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(190) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<int>(wxString,wxString)' being compiled
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 long,2>,
2>            TMovingImage=itk::Image<unsigned long,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<unsigned long,2>,
2>            TMovingImage=itk::Image<unsigned long,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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(193) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<unsigned long>(wxString,wxString)' being compiled
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<long,2>,
2>            TMovingImage=itk::Image<long,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<long,2>,
2>            TMovingImage=itk::Image<long,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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(196) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<long>(wxString,wxString)' being compiled
3>Linking...
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<double,2>,
2>            TMovingImage=itk::Image<double,2>,
2>            TDeformationField=itk::RegistrationBasedInterpolatorFilter<InputImageType,OutputImageType>::DemonsDeformationFieldType,
2>            TRealType=float
2>        ]
2>        and
2>        [
2>            TFixedImage=itk::Image<double,2>,
2>            TMovingImage=itk::Image<double,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)'
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(318) : see reference to class template instantiation 'itk::RegistrationBasedInterpolatorFilter<TInputImage,TOutputImage>' being compiled
2>        with
2>        [
2>            TInputImage=InputImageType,
2>            TOutputImage=OutputImageType
2>        ]
2>        ..\..\..\..\lib\src\milxImageInterpolation\milxImageInterpolation.cxx(202) : see reference to function template instantiation 'int milx::ImageInterpolation::ExecuteInterpolation<double>(wxString,wxString)' being compiled
2>Build log was saved at "file://c:\milx-view\build\lib\src\milxImageInterpolation\milx-ImageInterpolation.dir\Debug\BuildLog.htm"
2>milx-ImageInterpolation - 9 error(s), 0 warning(s)
3>Embedding manifest...

Thanks Neil


-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Sent: Sunday, 7 March 2010 11:05 AM
To: Burdett, Neil (ICT Centre, Herston - RBWH)
Cc: mike.jackson at bluequartz.net; insight-users at itk.org
Subject: Re: [Insight-users] Visual studio error ... cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::PDEDeformableRegistrationFilter

Hi Neil,

Thanks for posting the additional code.

Please try replacing the line:

    multires_2to1->SetRegistrationFilter( filter_2to1  );

with

    multires_2to1->SetRegistrationFilter( filter_2to1.GetPointer()   );


and let us know what you find.


    Thanks,


          Luis




More information about the Insight-users mailing list