<br>Hi Michael,<br><br>You can't use the call to GetDimension() from an image<br>to set the dimension of another image.<br><br>This is because GetDimension() will act at run-time, while<br>you need something that will make the dimension available<br>
at compilation time.<br><br><br>What you need is code of the sort:<br><br><i>template <class TImage><br>void MyClass<TImage>::writeImage(ImageType *image)<br>{<br>
typedef itk::Image<unsigned char, TImage::ImageDimension> OutputImageType;</i><br>}<br><br><br>and in some primitive compilers <br>like Visual Studio 6.0 and Borland 5.5,<br>you may have to do:<br><br><i><br>template <class TImage><br>
void MyClass<TImage>::writeImage(ImageType *image)<br>{</i><br><i>typedef itk::Image<unsigned char, </i><br>:itk::GetImageDimension< TImage >::ImageDimension<br><i>> OutputImageType;</i><br>}<br><br><br>
Regards,<br><br><br> Luis<br><br><br>------------------------------------------------------------<br><div class="gmail_quote">On Mon, Sep 7, 2009 at 4:17 AM, Michael Xanadu <span dir="ltr"><<a href="mailto:xanadu.michael@googlemail.com">xanadu.michael@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sorry, the error message in the mail I posted before is wrong. The compiler really says:<br>
<br>error C2971: 'itk::Image' : template parameter 'VImageDimension' : 'dimension' : a local variable cannot be used as a non-type argument<br>
<br><br>Regards, michael<br><br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>