Hi,<br><br>I want to get the dimension of an itk::Image and want to give it to another image, like this:<br><br><br><i>template <class TImage><br>void MyClass<TImage>::writeImage(ImageType *image)<br>{<br> unsigned int dimension = ImageType::GetImageDimension();<br>
typedef itk::Image<unsigned char, dimension> OutputImageType;<br><br> ....<br>}</i><br><br><br>ImageType is defined in the header and looks like this:<br><br><br><i>template <class TImage ><br>class ITK_EXPORT MyClass<br>
{<br>public:<br><br> typedef TImage ImageType;<br> <br> ...<br>}</i><br><br><br>But I get a error message at compiling:<br><br>error C2864: 'itk::MyClass<TImage>::dimension' : only static const integral data members can be initialized within a class<br>
<br>Is it possible to define the dimension in a dynamic way, like I need it?<br><br><br>Regards, Michael<br>