How to get the error information

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

How to get the error information

#1 Post by liuxinming »

For example, with regard to a MessageBox showing "Missing Attribute" message, how can I get the exact Attribute value through some method in dcmtk?

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi!

Are you talking about network communication? Which tool / functions are you using?

Regards,
Michael

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

#3 Post by liuxinming »

Michael Onken wrote:Hi!

Are you talking about network communication? Which tool / functions are you using?

Regards,
Michael
Sorry for the unclearly introduction on my task. I have been attempting to display dicom pictures in an application which was designed by myself. But for some pictures, before it could be displayed, the messagesbox appearred as mentioned above.

BTW, there were other messages, such as "Invalid dicom document". I have not known what can cause an "invalid" dicom file yet.

Thanks.

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#4 Post by Marco Eichelberg »

I have not known what can cause an "invalid" dicom file yet.
Anything that would cause DCMTK's image processing library to reject a DICOM image:
  • Missing attributes such as Rows, Columns, BitsAllocated etc.
  • Compressed pixel data but decompression codec not registered or not available
  • Damaged file (e.g. too short)
  • Unsupported color model, bit depth, resolution etc. (actually rather unlikely)
  • Not enough memory available
Probably there is more, but this is what comes to mind.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#5 Post by Jörg Riesmeier »

Usually, the error log shows where the problem is, so you should redirect the ofConsole to a string stream or file.

Btw, what does dcm2pnm report on these sample images in verbose/debug mode?

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

#6 Post by liuxinming »

The report is:
reading DICOM file: IM_0044
preparing pixel data.
ERROR: cannot change to unencapsulated representation for pixel data !
$dcmtk: dcm2pnm v3.5.4 2005-12-20 $

dcm2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF or BMP
error: Invalid data value

As for another sample, there were just messy codes appearing in the commond line. Then with the process going on, only click sounds coming seemingly from the CPU could be heard.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#7 Post by Jörg Riesmeier »

ERROR: cannot change to unencapsulated representation for pixel data !
That means that the pixel data is compressed (probably JPEG). Try again with dcmj2pnm.
As for another sample, there were just messy codes appearing in the commond line. Then with the process going on, only click sounds coming seemingly from the CPU could be heard.
In this case you probably forgot to specify the output filename, so the rendered image is written to stdout (see syntax usage).

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

#8 Post by liuxinming »

One report is:
reading DICOM file: US-PAL-8-10x-echo
preparing pixel data.
writing frame 1 to US-PAL-8-10x-echo.0.ppm
writing frame 2 to US-PAL-8-10x-echo.1.ppm
writing frame 3 to US-PAL-8-10x-echo.2.ppm
writing frame 4 to US-PAL-8-10x-echo.3.ppm
writing frame 5 to US-PAL-8-10x-echo.4.ppm
writing frame 6 to US-PAL-8-10x-echo.5.ppm
writing frame 7 to US-PAL-8-10x-echo.6.ppm
writing frame 8 to US-PAL-8-10x-echo.7.ppm
writing frame 9 to US-PAL-8-10x-echo.8.ppm
writing frame 10 to US-PAL-8-10x-echo.9.ppm
cleaning up memory.


But as for another sample named "IM_44", the machine kept hanging on for such a long time that I couldn' t wait for the end of the process.

Here are the informations of the two samples:

US-PAL-8-10x-echo:
Datatype: OB
Transfer Syntax: 1.2.840.10008.1.2.5(RLE Lossless)
PhotometricInterpretation: PALETTE COLOR
Bit Allocated: 8
Bit Stored: 8
Num of Frames: 10


IM_44:
Datatype: OB
Transfer Syntax: 1.2.840.10008.1.2.4.50(JPEG Baseline)
PhotometricInterpretation: YBR_FULL_422
Bit Allocated: 8
Bit Stored: 8
Num of Frames: 749


However, when I attemptted to read the pixeldatas(from both the samples above) in order to show them in my application, the messagebox with the "Invalid dicom document" message launched.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#9 Post by Jörg Riesmeier »

But as for another sample named "IM_44", the machine kept hanging on for such a long time that I couldn' t wait for the end of the process.
I guess that your system has too few memory to store the uncompressed movie in memory and starts swapping ...
However, when I attemptted to read the pixeldatas(from both the samples above) in order to show them in my application, the messagebox with the "Invalid dicom document" message launched.
You probably forgot to register the RLE and JPEG decoders.

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

#10 Post by liuxinming »

You probably forgot to register the RLE and JPEG decoders
I have checked the codes referring to decoder register and added the codes to accomplish the decoding process. For other samples, it did the trick, while the " Invalid Data Value" message obtained for the above two samples.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#11 Post by Jörg Riesmeier »

Did you also register support for color images by including "diregist.h" to your application (and linking the dcmimage library)?

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

#12 Post by liuxinming »

Jörg Riesmeier wrote:Did you also register support for color images by including "diregist.h" to your application (and linking the dcmimage library)?
Absolutely I did. I' ve checked the including files and library files again.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#13 Post by Jörg Riesmeier »

And what is the output of dcmj2pnm on these particular images (in verbose/debug mode)? I hope we are not going round in circles ...

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

#14 Post by liuxinming »

reading DICOM file: US-PAL-8-10x-echo
preparing pixel data.
writing frame 1 to US-PAL-8-10x-echo.0.ppm
writing frame 2 to US-PAL-8-10x-echo.1.ppm
writing frame 3 to US-PAL-8-10x-echo.2.ppm
writing frame 4 to US-PAL-8-10x-echo.3.ppm
writing frame 5 to US-PAL-8-10x-echo.4.ppm
writing frame 6 to US-PAL-8-10x-echo.5.ppm
writing frame 7 to US-PAL-8-10x-echo.6.ppm
writing frame 8 to US-PAL-8-10x-echo.7.ppm
writing frame 9 to US-PAL-8-10x-echo.8.ppm
writing frame 10 to US-PAL-8-10x-echo.9.ppm
cleaning up memory.

As for IM_0044, the machine kept hanging on.

Sorry for my neglection. The message was no longer "Invalid DICOM Document, but "Invalid Data Value".

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#15 Post by Jörg Riesmeier »

For "US-PAL-8-10x-echo" you apparently also have to register the RLE decoder. For "IM_0044" I already wrote "I guess that your system has too few memory to store the uncompressed movie in memory and starts swapping ..."

Post Reply

Who is online

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