DCMTK3.6.0 can't read the test image

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
yueran
Posts: 9
Joined: Wed, 2012-04-25, 08:57

DCMTK3.6.0 can't read the test image

#1 Post by yueran »

Hi, I find DCMTK3.6.0 can't read the test image(I will send the image to dicom@offis.de later).
I find the image's transfer syntax is compressed, but when I decompress the image using chooseRepresentation,
the program goto the red line, I think it is should be the else statement.

I need your help about the reason, maybe it is beause the variable existUnencapsulated=true?
Or the image is not a standard dicom file?

if ((!toType.isEncapsulated() && existUnencapsulated) ||
(toType.isEncapsulated() && existUnencapsulated && alwaysUnencapsulated) ||
(toType.isEncapsulated() && findRepresentationEntry(findEntry, result) == EC_Normal))
{
// representation found
current = result;
recalcVR();
l_error = EC_Normal;

}
else
{
if (original == repListEnd)
l_error = encode(EXS_LittleEndianExplicit, NULL, NULL,
toType, repParam, pixelStack);
else if (toType.isEncapsulated())
l_error = encode((*original)->repType, (*original)->repParam,
(*original)->pixSeq, toType, repParam, pixelStack);
else
l_error = decode((*original)->repType, (*original)->repParam,
(*original)->pixSeq, pixelStack);
}
return l_error;

J. Riesmeier
DCMTK Developer
Posts: 2541
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DCMTK3.6.0 can't read the test image

#2 Post by J. Riesmeier »

I just checked the file you've sent and I could decompress it with dcmdjpeg (from DCMTK 3.6.0). But, wait a moment ... the original file is encoded incorrectly, because the pixel data is not encapsulated in a sequence of pixel items. DCMTK should report this as an error, of course. And, the pixel data is also not decompressed because of the incorrect encoding.

yueran
Posts: 9
Joined: Wed, 2012-04-25, 08:57

Re: DCMTK3.6.0 can't read the test image

#3 Post by yueran »

The file's transfer syntax is 1.2.840.10008.1.2.4.70, it is a jpeg compressed transfer syntax and I can open and decompress the pixel using other tools such as eZDICOM. Could you please tell me the image encapsulate rule? I find a flag in \dcmdata\libsrc\dcpixel.cc line 719
if (getLengthField() == DCM_UndefinedLength)
That means when the length of pixel element is not DCM_UndefinedLength, then it is Unencapsulated that's existUnencapsulated = OFTrue;
I am new to dicom standard, so is the encapsulate rule conform to the standard?

J. Riesmeier
DCMTK Developer
Posts: 2541
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DCMTK3.6.0 can't read the test image

#4 Post by J. Riesmeier »

The encoding of compressed pixel data is described in section A.4 of part 5 of the DICOM standard. The DICOM file you've sent us is not DICOM compliant (not only is this respect, but this is the main reason for your problems).

I've also added a new entry to our internal to-do list, because DCMTK should report an error on such a corrupted dataset (as I've mentioned before).

yueran
Posts: 9
Joined: Wed, 2012-04-25, 08:57

Re: DCMTK3.6.0 can't read the test image

#5 Post by yueran »

OK, thank you. I will read the related part of dicom standard.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest