After some tweaking around, I found out that JPEG compression works provided that the minimum difference between two pixels is 2.<br>For example, if I have an image that only consists of n and n+1, the saved image will only contains the value n.
<br>However, if the image consists of value n and n+2, then the saved image will contains both n and n+2.<br>In other words, the image will stores fine if I multiply it by a factor of 2. <br><br>Can someone please tell me why is this happening?
<br>By the way, the my pixel is of type short, is there any possibility that this is the reason for this weird phenomena?<br><br><br><div><span class="gmail_quote">On 9/24/07, <b class="gmail_sendername">Pechin Lo</b> <
<a href="mailto:pechin@gmail.com">pechin@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I've been using ITK to load and write DICOM files for quite sometime and is quite happy with it. Recently however I try to write volumetric DICOM files using JPEG format, and for some reason I found out that the original information and the saved information is not the same. For some strange reason, random voxels/pixels in the saved image have +1 in intensity ( the rest are the same as the original image).
<br><br>There doesn't seem to be any problem with my code, as when I switch the compression to JPEG2000, the whole thing works just fine, that is the difference between original image and the saved image is 0. <br><br>
Anyone have any idea what is wrong here?<br><br>Thanks.<br clear="all"><span class="sg"><br>Pechin
</span></blockquote></div><br><br>Pechin<br>