[ITK Community] [Insight-users] Template question

Tim Allman dr.tim.allman at gmail.com
Tue Jan 14 15:12:14 EST 2014


I'm writing to get some advice on C++ templates from some of the experts 
on this list.

I want to write a class which is templated on the image type. There are 
many classes in ITK that are templated like this.

    template<typename TImage>
    class ImageProcessor { };

The problem is that the class knows nothing about TImage until compile 
time and I would like to take advantage of the code assistance in Xcode 
as I write the class. This would require that the IDE know that TImage 
is really an ITK Image.

This gets me closer

    template
    <
         template<typename TPixel, insigned Dimension> class TImage
     >
    class ImageProcessor { };

but it still contains no information about itk::Image<TPixel, Dimension> 
beyond its signature.

This gets me closer

    template<class TPixel,unsigned Dim>
    class ImageProcessor
    {
       public:
         typedef itk::Image<TPixel, Dim> ImageType;
    ...
    };

but I'm curious to know if there is any way of getting the what I want.

Thanks,
Tim


-- 
Tim Allman, Ph.D.
35 Margaret Street,
Guelph Ontario N1E 5R6
Canada

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140114/0ce96a07/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dr_tim_allman.vcf
Type: text/x-vcard
Size: 160 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20140114/0ce96a07/attachment-0002.vcf>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

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-users


More information about the Community mailing list