Yes, you should report it here: <a href="http://public.kitware.com/Bug/">http://public.kitware.com/Bug/</a><div><br></div><div>Regards,</div><div>Dženan<br><br><div class="gmail_quote">On Tue, Jun 22, 2010 at 13:39, Aurelien Bricier <span dir="ltr"><<a href="mailto:aurelien.bricier@c-s.fr">aurelien.bricier@c-s.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello ITK users,<br>
<br>
I tried to read a 4 channels (RGBA) png image file into an<br>
itk:Image<unsigned char, 2> and the output image makes no sense. It<br>
appears that it works fine with RGB png images. In fact, I located the<br>
issue in ConvertPixelBuffer::ConvertRGBAToGray() that computes the<br>
grayscale pixel value by applying the following formula:<br>
<br>
((2125.0 * static_cast<double>RedPixelValue +<br>
7154.0 * static_cast<double>GreenPixelValue +<br>
0721.0 * static_cast<double>BluePixelValue)/1000.0) //OK<br>
* static_cast<double>AlphaPixelValue<br>
//Here is the issue<br>
<br>
In a RGBA png image, the range of AlphaPixelValue is [0,255]. The<br>
resulting grayscale value is no longer reasonably allowed to be casted<br>
into an unsigned char. That's why the reader output doesn't make any<br>
sense. I isolated this behavior in the attachment. Is there another<br>
place where I should report this bug?<br>
<br>
Regards,<br><font color="#888888">
Aurelien.<br>
<br>
</font><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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<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></div>