[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://www.itk.org/pipermail/insight-users/attachments/20140114/0ce96a07/attachment.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://www.itk.org/pipermail/insight-users/attachments/20140114/0ce96a07/attachment.vcf>


More information about the Insight-users mailing list