[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
Tue Mar 2 18:39:51 EST 2010


 Hi Luis,
        Sorry for the delay in responding, it seems that my previous message was too big as I attached copies of my files. 

B) From itkRegistrationBasedInterpolatorFilter.h RegistrationBasedInterpolatorFilter inherits from the itk ImageToImageFilter class (see below). Is this not correct?

#include <itkImageToImageFilter.h>
#include "itkDiffeomorphicDemonsRegistrationFilter.h"
#include "itkMultiResolutionPDEDeformableRegistration2.h"

namespace itk{

template <class TInputImage, class TOutputImage>
class __declspec(dllexport) RegistrationBasedInterpolatorFilter:
public ImageToImageFilter<TInputImage, TOutputImage>{

  public:
    /** standard class typedefs */
    typedef RegistrationBasedInterpolatorFilter Self;
    typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
    typedef SmartPointer<Self> Pointer;
    typedef SmartPointer<const Self> ConstPointer;

    /** Method for creation through the object factory.  */
    itkNewMacro(Self);

    /** Run-time type information (and related methods). */
    itkTypeMacro(RegistrationBasedInterpolatorFilter, ImageToImageFilter);

    typedef TInputImage  InputImageType;
    typedef TOutputImage OutputImageType;

...


c) The class has itkNewMacro(self) in itkRegistrationBasedInterpolatorFilter.h (see above)

This seems to build and run fine under Linux but not under visual studio.

Thanks for taking the time to investigate this it's much appreciated

Neil

-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
Sent: Wednesday, 10 February 2010 4:40 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.

Three observations:


A) You seem to be mixing 2D images with 3D images.


B)  Does the class  RegistrationBasedInterpolatorFilter
      derives from:

typedef typename itk::PDEDeformableRegistrationFilter <
SliceInputImageType, SliceInputImageType, DemonsDeformationFieldType>
BaseRegistrationFilterType;

       ??

 It should, if you want to do:

         typename BaseRegistrationFilterType::Pointer filter_2to1;

and then

       multires_2to1->SetRegistrationFilter( filter_2to1 );



C)  Does the class

             RegistrationBasedInterpolatorFilter

       has an itkNewMacro() in its header file ?




     Luis






More information about the Insight-users mailing list