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 » Mon, 2009-05-18, 03:19

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: 1708
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken » Mon, 2009-05-18, 16:21

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 » Tue, 2009-05-19, 02:06

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: 1225
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#4 Post by Marco Eichelberg » Tue, 2009-05-19, 08:20

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 » Tue, 2009-05-19, 09:13

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 » Wed, 2009-05-20, 01:22

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 » Wed, 2009-05-20, 09:07

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 » Thu, 2009-05-21, 02:43

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 » Thu, 2009-05-21, 12:16

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 » Fri, 2009-05-22, 01:29

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 » Mon, 2009-05-25, 09:42

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 » Mon, 2009-05-25, 11:17

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 » Mon, 2009-05-25, 11:41

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 » Tue, 2009-05-26, 02:10

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 » Tue, 2009-05-26, 09:34

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: Bing [Bot] and 1 guest