[Insight-users] WrapITK: ImageReader and SmartPointer

Marcel Luethi marcel.luethi at unibas.ch
Wed Jun 24 11:56:36 EDT 2009


Hi all, 

I noticed that in WrapITK (included with ITK 3.8.1) the itkImageReader
does not behave the same for all the wrapped types. 

Instantiating a ImageReader for an image of type unsigned short will
return a smart pointer, whereas for the signed short image the output
will be the plain image pointer:

> In [4]: itk.ImageFileReader.ISS3.New().GetOutput()
> Out[4]: <C itk::Image<(short int,3u)> instance at
>_f08ecc0400000000_p_itk__ImageTshort_int_3u_t>

>In [5]: itk.ImageFileReader.IUS3.New().GetOutput()
>Out[5]: <C itk::SmartPointer<(itk::Image<(unsigned short,3u)>)>
>instance at
>_d0c04f0200000000_p_itk__SmartPointerTitk__ImageTunsigned_short_3u_t_t>

Is this a bug in WrapITK or is this the intended behavior? It seems that
it does not cause any troubles as long as one is sticking to the
standard filters. However, for my own extensions this behavior causes
some problems.

Thank you for your help and best regards, 

Marcel 

ps. I am working on Linux (Fedora Core 9, 64bit) and Python 2.5



More information about the Insight-users mailing list