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 &quot;VTKImageToImageFilter&quot; and what they did was something like that:<br>
<br><br>    template &lt;class TImage&gt;<br>    const typename FilterManager&lt;TImage&gt;::ImageType * FilterManager&lt;TImage&gt;::getAnything(int anyParameter) const<br>    {<br>        // any code<br>        return anyItkFilter-&gt;GetOutput();<br>
    }<br><br>Now I want to call the method in this way:<br><br>    typedef itk::GremlinDetector&lt;Short3DType&gt; GremlinDetectorType;<br>    GremlinDetectorType::popUpImage(filterManager-&gt;getAnything(number));<br><br>
where &quot;popUpImage&quot; (a static method) is declared in this way:<br><br>    template &lt;class TImage&gt;<br>    void GremlinDetector&lt;TImage&gt;::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 &quot;const&quot; in the method header. Of course the compiler complains:<br><br>    error C2664: &#39;itk::GremlinDetector&lt;TImage&gt;::popUpAllImages&#39; : cannot convert parameter 1 from &#39;const itk::Image&lt;TPixel,VImageDimension&gt; *&#39; to &#39;itk::Image&lt;TPixel,VImageDimension&gt; *&#39;<br>
<br>But I don&#39;t know how to fix that problem. If I remove the &quot;const&quot; expressions from the getAnything()-header the application crashes and I can&#39;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>