[Insight-developers] Problems creating a "global" itk-object

Luis Ibanez luis.ibanez at kitware.com
Mon Jul 6 09:36:32 EDT 2009


Hi Siegesmund,

You are missing to use the "typename" keyword.

Instead of:

*            vtkToItkType::Pointer vtkToItkFilter; *

you should do

          typename *vtkToItkType::Pointer vtkToItkFilter;

*
"typename" is required everytime that you access a
trait of a type that depends on the template arguments
of the current class.

In your case the type vtkToItkType dependes on the
template argument TOutputImage, and you are trying
to access the trait "Pointer" out of "vtkToItkType".


      Regards,


           Luis
*
*------------------------------------------------------------------
On Mon, Jul 6, 2009 at 8:45 AM, <siegesmund at image-systems.biz> wrote:

>  Hi,
>
> I'm new to ITK and to this mailing list.
> I wanna define a *VTKImageToImageFilter<TOutputImage>* object (derived
> from ProcessObject) in the header of my class VtkItkBridge (I use C++):
>
>
> *template <class TOutputImage >
> class ITK_EXPORT VtkItkBridge : public ProcessObject
> {
> public:
> ...
> // there's other code here, too
> ...
> typedef TOutputImage OutputImageType;
> typedef itk::VTKImageToImageFilter<OutputImageType> vtkToItkType;
> vtkToItkType::Pointer vtkToItkFilter;
> ...
> }*
>
>
> Now I wanna create that object in the constructor of my class, so I can use
> it in class' methods:
>
>
> *template <class TOutputImage>
> VtkItkBridge<TOutputImage>::VtkItkBridge()
> {
> vtkToItkObject = vtkToItkObject::New();
> }*
>
> But I always get many error messages at the line *vtkToItkType::Pointer
> vtkToItkFilter;* while compiling. In fact that is comprehensible, because
> the class can't know what *TOutputImage* or *OutputImageType* means. I
> know, these types have to be instances of itk::Image.
> But I do need a global variable of *VTKImageToImageFilter<TOutputImage>* in
> my class. Does anybody know a possibility how to solve the problem?
>
> Thx
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090706/8702b0ed/attachment.htm>


More information about the Insight-developers mailing list