[Insight-users] Problems using image smart pointer

IsabelleNg isabelleNg at homeworking.org
Tue Apr 10 00:31:01 EDT 2007


Hi everyone, 

Any help is appreciated... I'm having problems compiling the following piece
of code: 

typedef itk::ImageFileWriter< ImageType > WriterType; 
WriterType::Pointer writer = WriterType::New(); 
writer->SetFileName("test.mhd"); 
writer->SetInput( this->GetImage()->GetPointer()); 

This code is inside a function of a derived class.  GetImage() should return
a smartpointer obj returned by its supercass, using the macro: 

itkGetConstObjectMacro( Image, ImageType ); 

And m_Image is defined in this superclass as: 

typedef SmartPointer< ImageType >     ImagePointer; 
ImagePointer m_Image; 


The error that I got is 
        
error C2664: 'itk::ImageFileWriter<TInputImage>::SetInput' : cannot convert
parameter 1 from 'const itk::Image<TPixel,VImageDimension> *' to 'const
itk::Image<TPixel,VImageDimension> *' 


Thanks for any of your help, 
Isabelle
-- 
View this message in context: http://www.nabble.com/Problems-using-image-smart-pointer-tf3551006.html#a9913724
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list