Hi my friends,<br><br>I have a class called FilterManager which uses templates and is derivated from ProcessObject. This class has a method getAnything() which shall return the pointer of an itk:Image. I looked at the example "VTKImageToImageFilter" and what they did was something like that:<br>
<br><br> template <class TImage><br> const typename FilterManager<TImage>::ImageType * FilterManager<TImage>::getAnything(int anyParameter) const<br> {<br> // any code<br> return anyItkFilter->GetOutput();<br>
}<br><br>Now I want to call the method in this way:<br><br> typedef itk::GremlinDetector<Short3DType> GremlinDetectorType;<br> GremlinDetectorType::popUpImage(filterManager->getAnything(number));<br><br>
where "popUpImage" (a static method) is declared in this way:<br><br> template <class TImage><br> void GremlinDetector<TImage>::popUpImage(ImageType *image) //ImageType is defined in the header as: typedef TImage ImageType; <br>
{<br> //do anything with the image<br> }<br><br><br>It seems that I have a problem with "const" in the method header. Of course the compiler complains:<br><br> error C2664: 'itk::GremlinDetector<TImage>::popUpAllImages' : cannot convert parameter 1 from 'const itk::Image<TPixel,VImageDimension> *' to 'itk::Image<TPixel,VImageDimension> *'<br>
<br>But I don't know how to fix that problem. If I remove the "const" expressions from the getAnything()-header the application crashes and I can't make popUpImage() to a const method, because I may not change that code. Can somebody help me please?<br>
<br><br>Regards, Michael<br>