<br>Hi Zoltan,<br><br>There are three pixel types involved here:<br><ol><li>The PixelType of the image in the input file</li><li>The PixelType that you used to declare your image in your program</li><li>The PixelType of the image in the output file</li>
</ol>The itkImageFileReader, by default converts the pixel type of the input image<br>(1) to the pixel of the image that you declared in your code (2), then when you<br>write the image to disk, the pixel type of the output image (3) will be exactly <br>
the same used in the typedef in your code (2).<br><br><br>Therefore, the reason why your output image is of type USHORT is that you<br>probably used in your code a typedef similar to:<br><br> typedef unsigned short PixelType;<br>
typedef itk::Image< PixelType, Dimension > ImageType;<br> typedef itk::ImageFileReader< ImageType > ReaderType;<br><br>If you know that your input image is of pixel type: UCHAR<br>then you should use a declaration such as:<br>
<br> typedef unsigned char PixelType;<br><br><br><br> Regards,<br><br><br> Luis<br><br><br>----------------------------------------<br><br><div class="gmail_quote">On Wed, Aug 5, 2009 at 10:33 AM, Zoltan Seress <span dir="ltr"><<a href="mailto:seress.zoltan@gmail.com">seress.zoltan@gmail.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;">Dear members!<div><br></div><div>I am a newbie in ITK and I ran into an annoying problem. I try to read raw data (obtained from brainweb) with the support of its .mhd header, then write it without any modification as it is presented in the user's guide. But at the end the resulted .mhd contains different information about ElementType, namely the original MET_UCHAR is replaced with MET_USHORT, what's more the resulted raw data size decreases. What is hidden in the background?</div>
<div>Thanks in advance!<br clear="all"><br></div><div>Cheers,<br>-- <br>Zoltan Seress<br>
</div>
<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>