[Insight-users] Read Write Dicom Image

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Mar 30 05:42:41 EDT 2009


Hi Hui,

On Fri, Mar 27, 2009 at 11:21 PM, Hui Wang <cougarhui at yahoo.com> wrote:
> Hi, Mathieu,
>
> Attached two images. DicomInput.dcm is the one I am working with and it
> causes the error. But DicomImageReadWrite.cxx works fine on the
> other one which I downloaded from itk source codes. Would you please try
> DicomImageReadWriter.exe on DicomInput.dcm? Thanks in advance.

Thanks for the input image. Here is what is happening:

1. You DICOM file contains digital trash:
...
(130d,0000) ?? (UL) 1099164365\1276292990\3804772504\555532589
# 16,1 (4)  Generic Group Length
(140d,0000) ?? (UL) 835531882\1219434392\151033222\3313626383
# 16,1 (4)  Generic Group Length
(150d,0000) ?? (UL) 4259307444\1128414896\4113509537\2144277863
 # 16,1 (4)  Generic Group Length
(160d,0000) ?? (UL) 3824301659\1114577058\3573223579\2679727550
 # 16,1 (4)  Generic Group Length
(160d,0001) ?? 43\4c\55\54\00\00\00\00\50\52\45\48\01\00\00\00\50\52\45\53\00\00\00\00\00\00\00\00\00\00\00\00
        # 36,? (1)  Illegal Element
(170d,0000) ?? (UL) 3850819895\1116855751\1080659125\3543366330
 # 16,1 (4)  Generic Group Length
...
2. When quickly parsing the header, GDCM 1.x decide to skip private
group, by using a deprecated mechanism: using private group length.
3. Because group length specified is trash, the DICOM parsing ends up early.


A couple of solutions:
1. Use itkBooleanMacro(LoadPrivateTags) from the itk::GDCMImageIO and
set it to On,
2. Use a more global solution for any instance of GDCMIOmageIO:
LoadPrivateTagsDefaultOn(),
3. Switch to using GDCM 2.x (ITK_USE_SYSTEM_GDCM), which is a much
more robust implementation of DICOM than GDCM 1.x,
4. Rewrite your image using gdcmconv 2.0.11 (not released):

  gdcmconv  --remove-private-tags DicomInput.dcm out.dcm


Meanwhile contact your private vendor:
(0002,0012) UI [1.2.826.0.2.202387.1969.9.22.4.0.0]               #
34,1 Implementation Class UID
(0002,0013) SH [DJ-v4.0.0Win]                                     #
12,1 Implementation Version Name
(0002,0016) AE [DIGITAL_JACKET]                                   #
14,1 Source Application Entity Title

And tell them:
1. To actually read the DICOM PS 3.3-2007 standard, at least once in
their life (PS 3.5-2007, 7.2 Group Length)
2. Group elements are deprecated as of PS 3.3-2008.


HTH
-- 
Mathieu


More information about the Insight-users mailing list