[Insight-users] passing itkImage to a function ...C++ template problem

Mr Gaffe lagaffe74130 at yahoo.fr
Thu Oct 14 17:12:25 EDT 2004


Hello,
I a new to itk and I try to create my own class which can do some basic itk transformation with templated itk object, and I failed, I really don't know how to do this.
 
In my .h declaration I did:

class BasicTransformation

{

public:


template<typename TPixel, typename VImageDimension> void myFunction(itk::Image<TPixel, VImageDimension> imageData);

}

-> it doesn't compile, because I have to define all the template values ? (so I don't understand how to use the template, since I had to specify so early, my function have to work with different itkImage type ...).

If I specify the type it compile but it is not very interresting...

template<typename TPixel, typename VImageDimension> void myFunction(itk::Image<unsigned short, 3> imageData); 

-> What is very weard is that if I use an ImageSource, it compiles without specify the type of ImageSource .... (at this time started to begin mad :-)

template<typename TOutputImage> void volumeRendering(itk::ImageSource<TOutputImage> imageSource);

So,

-> 1 - can someone could explain to me how to pass a itk object to a function in another class, please .

->2 - In my processing class is it better to have an itkImage to begin the process or an ImageSource ?


Thanks for help

Lagaffe 



		
---------------------------------
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20041014/c7adcc33/attachment.html


More information about the Insight-users mailing list