Hi Mathieu,<br><br>&nbsp;&nbsp; Thanks a lot for your quick response. I am using ITK CVS however it has not been updated for a while<br>(maybe more than 2 months). Seems I have to update it later since I am not able to connect to<br>
<a href="http://www.itk.org:2401">www.itk.org:2401</a> now (is the cvs server for ITK down now?).&nbsp; The link to the old post regarding the <br>dicom compression was wrong,&nbsp; it should be this post <br>&nbsp;&nbsp; <a href="http://www.itk.org/pipermail/insight-users/2007-January/020481.html">http://www.itk.org/pipermail/insight-users/2007-January/020481.html</a><br>
<br>I will also look at the gdcm info you point to me.<br>&nbsp;  <br>Thanks again,<br>Bing<br><br><br><div class="gmail_quote">On Wed, Dec 24, 2008 at 7:01 PM, Mathieu Malaterre <span dir="ltr">&lt;<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>&gt;</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;">Bing,<br>
<div class="Ih2E3d"><br>
On Thu, Dec 25, 2008 at 12:45 AM, Bing Jian &lt;<a href="mailto:bing.jian@gmail.com">bing.jian@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; &nbsp; &nbsp; I have some dicom files that are probably in compressed format as they<br>
&gt; are<br>
&gt; much smaller than other files of same slice size (512x512x1) in the same<br>
&gt; folder<br>
&gt; and there is a tag (0008,2111) called derivative description found in these<br>
&gt; files with value<br>
&gt; &quot;Compress BN JPEG Lossless&quot;.<br>
<br>
</div>The safest way to check whether the image is compressed or not, is<br>
check the transfer syntax.<br>
See gdcminfo for example<br>
(<a href="http://apps.sourceforge.net/mediawiki/gdcm/index.php?title=GDCM_Release_2.0" target="_blank">http://apps.sourceforge.net/mediawiki/gdcm/index.php?title=GDCM_Release_2.0</a>)<br>
<div class="Ih2E3d"><br>
&gt; The problem I encountered is that when reading<br>
&gt; these files using itk::GDCMImageIO, I receive the following message:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Must downscale data from 16 bits to 12&quot;<br>
<br>
:(<br>
<br>
&gt; To make things worse, sometimes my program aborts when trying to access data<br>
&gt; read<br>
&gt; from these files or it returns the wrong intensity values. However I am able<br>
&gt; to read<br>
&gt; these files using MATLAB and other programs. Below is the dicom reading part<br>
&gt; of my ITK code which is based on<br>
&gt;<br>
</div><div class="Ih2E3d">...<br>
&gt;<br>
&gt; The same code works well for other uncompressed dicom files in the same<br>
&gt; folder.<br>
&gt; I found similar questions have been asked in the mailing list, for example,<br>
&gt; &nbsp; <a href="http://www.cmake.org/pipermail/insight-users/2007-April/021955.html" target="_blank">http://www.cmake.org/pipermail/insight-users/2007-April/021955.html</a><br>
<br>
</div>That&#39;s not a question, that&#39;s an example on how to *write* compressed<br>
DICOM file.<br>
<div class="Ih2E3d"><br>
&gt; However, in my case, adding<br>
&gt; &nbsp; &nbsp; dicomIO-&gt;UseCompressionOn();<br>
&gt; &nbsp; &nbsp; dicomIO-&gt;SetCompressionType(itk::GDCMImageIO::JPEG2000); // I also tried<br>
&gt; JPEG<br>
&gt; &nbsp;does not solve the problem.<br>
&gt;<br>
&gt;<br>
&gt; I guess I must have missed some obvious solution and would appreciate any<br>
&gt; clue that will help me out.<br>
&gt; Many thanks in advance and wish you all have a great holiday!<br>
<br>
</div>You may be suffering from the bug that I recently closed in gdcm<br>
1.2.5, which is merged in ITK CVS. You have a couple of options:<br>
<br>
- Switch to ITK CVS<br>
- Use a system gdcm 2.x :<br>
<a href="http://apps.sourceforge.net/mediawiki/gdcm/index.php?title=GDCM_Release_2.0" target="_blank">http://apps.sourceforge.net/mediawiki/gdcm/index.php?title=GDCM_Release_2.0</a><br>
and relink ITK &nbsp;to this one instead.<br>
- Use a system gdcm 1.2.5, and relink ITK &nbsp;to use this one instead.<br>
<br>
By &#39;system&#39;, I mean that you have to start cmake again, turn advanced<br>
option on and select ITK_USE_SYSTEM_GDCM:ON, you&#39;ll be guided from<br>
there.<br>
<br>
Ref:<br>
<a href="http://www.itk.org/pipermail/insight-users/2008-December/028289.html" target="_blank">http://www.itk.org/pipermail/insight-users/2008-December/028289.html</a><br>
<br>
HTH<br>
--<br>
<font color="#888888">Mathieu<br>
</font></blockquote></div><br>