[Insight-users] Reading compressed DICOM files

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Dec 24 19:01:21 EST 2008


Bing,

On Thu, Dec 25, 2008 at 12:45 AM, Bing Jian <bing.jian at gmail.com> wrote:
> Hi all,
>
>     I have some dicom files that are probably in compressed format as they
> are
> much smaller than other files of same slice size (512x512x1) in the same
> folder
> and there is a tag (0008,2111) called derivative description found in these
> files with value
> "Compress BN JPEG Lossless".

The safest way to check whether the image is compressed or not, is
check the transfer syntax.
See gdcminfo for example
(http://apps.sourceforge.net/mediawiki/gdcm/index.php?title=GDCM_Release_2.0)

> The problem I encountered is that when reading
> these files using itk::GDCMImageIO, I receive the following message:
>
>        "Must downscale data from 16 bits to 12"

:(

> To make things worse, sometimes my program aborts when trying to access data
> read
> from these files or it returns the wrong intensity values. However I am able
> to read
> these files using MATLAB and other programs. Below is the dicom reading part
> of my ITK code which is based on
>
...
>
> The same code works well for other uncompressed dicom files in the same
> folder.
> I found similar questions have been asked in the mailing list, for example,
>   http://www.cmake.org/pipermail/insight-users/2007-April/021955.html

That's not a question, that's an example on how to *write* compressed
DICOM file.

> However, in my case, adding
>     dicomIO->UseCompressionOn();
>     dicomIO->SetCompressionType(itk::GDCMImageIO::JPEG2000); // I also tried
> JPEG
>  does not solve the problem.
>
>
> I guess I must have missed some obvious solution and would appreciate any
> clue that will help me out.
> Many thanks in advance and wish you all have a great holiday!

You may be suffering from the bug that I recently closed in gdcm
1.2.5, which is merged in ITK CVS. You have a couple of options:

- Switch to ITK CVS
- Use a system gdcm 2.x :
http://apps.sourceforge.net/mediawiki/gdcm/index.php?title=GDCM_Release_2.0
and relink ITK  to this one instead.
- Use a system gdcm 1.2.5, and relink ITK  to use this one instead.

By 'system', I mean that you have to start cmake again, turn advanced
option on and select ITK_USE_SYSTEM_GDCM:ON, you'll be guided from
there.

Ref:
http://www.itk.org/pipermail/insight-users/2008-December/028289.html

HTH
-- 
Mathieu


More information about the Insight-users mailing list