[Insight-developers] Smart Pointer (continue)

Yinpeng Jin yj76@columbia.edu
Thu, 25 Apr 2002 10:40:37 -0400


I think I should also give the "background":
I overwrited the SetInput()


SetInput(InputImagePointer input)
{
  Superclass::SetInput(input);
.......
  itk::ImageRegionIteratorWithIndex <InputImageType> iit(this->GetInput(),
region);
  // compiler error here

}


and typedefs in .h:
  typedef TInputImage InputImageType;
  typedef typename TInputImage::Pointer InputImagePointer;


here is the error message again:
error C2664: '__thiscall itk::ImageRegionIteratorWithIndex<class
itk::Image<class itk::Vector<unsigned char,3>,2>
>::itk::ImageRegionIteratorWithIndex<class itk::Image<cl
ass itk::Vector<unsigned char,3>,2> >(class itk::Image<class
itk::Vector<unsigned char,3>,2> *,const class itk::ImageRegion<2> &)' :
cannot convert parameter 1 from 'class itk::SmartPointer<class
itk::Image<class itk::Vector<unsigned char,3>,2> cons
t >' to 'class itk::Image<class itk::Vector<unsigned char,3>,2> *'
        No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xtree(552) :
while compiling class-template member function 'void __thiscall
itk::VoronoiSegmentationRGBImageFilter<class itk::Image<class
itk::Vector<unsigned char,3>,2>,class itk::Image
<bool,2> >::SetInput(class itk::SmartPointer<class itk::Image<class
itk::Vector<unsigned char,3>,2> >)'

so, how to fix it?

thanks.

Yinpeng.