DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Fri, 2018-06-22, 16:02

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon, 2018-06-04, 15:20 
Offline

Joined: Mon, 2017-08-07, 16:06
Posts: 9
Hello,

I received some JPEG Baseline compressed image data from a customer which is an Ophthalmic Grayscale 8-Bit Multi-frame DICOM image created by a Carl Zeiss Meditec Scanner. Decompression of that data set using DCMTK 3.6.0 (dcmdjpeg +te ...) was unfortunately not working. When debugging DCMTK , I found out that some JPEG properties of the jpeg_decompress_struct object where not in line with what's written in the DICOM header (after calling jpeg_consume_input). For instance, the - I guess IJG - library assumes that the image (which is grayscale) has a jpeg_color_space being YCBCR with 3 samples per pixel that it wants to convert to RGB and DCMTK terminates the run with the error message "Error: Buffer for decompressed image (8 bits/sample) too small". It seems that there is JPEG Header that is different from the DICOM Header. When trying to adapt the jpeg_decompress_struct manually with values, that to me make sense such as: comps_in_scan = 1; jpeg_color_space = JCS_GRAYSCALE; etc.. I managed to decompress the data set, however, the image is not usable after that and the log output of DCMTK is "Corrupt JPEG data: bad Huffman code" and some more logs.

What is interesting is, that I could successfully decompress the data set with a commercial decompression tool, however, all other non-commercial tools that I tested failed.
Is there a way to get that data set decompressed with DCMTK? For example by applying some command line options (I couldnt find anything that helped) or by trying to to adapt the DCMTK code myself? Any hint is highly appreciated.

I can provide a strongly anonymized data set on request (the pixel data do not contain any personal information as well).

Best wishes,
David


Top
 Profile  
 
PostPosted: Tue, 2018-06-05, 07:59 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1668
Location: Oldenburg, Germany
Hi David,

you can send it to bugs at dcmtk dot org and we take a look as time permits. More importantly, you should also inform upstream (i.e. Zeiss) if that is viable for you.

Thank you,
Michael


Top
 Profile  
 
PostPosted: Tue, 2018-06-05, 08:21 
Offline

Joined: Mon, 2017-08-07, 16:06
Posts: 9
Hello Michael,

I have sent you the data set to the email you provided. Before talking directly to the customer I wanted to make sure that the problem is not inside the JPEG decompression library but in the data set itself. What still irritates me is that there is software that can decompress it successfully (frames look good in the Viewer after decompression) and that there is software that cannot decompress it.

Would be great if you could have a look at the data.


Top
 Profile  
 
PostPosted: Tue, 2018-06-05, 09:25 
Offline

Joined: Mon, 2017-08-07, 16:06
Posts: 9
I have sent the problematic image data to the DCMTK support team and got immediately a response with an analysis of the problem. The values of Photometric Interpretation and Samples per Pixel in the DICOM Header contradict the data inside the JPEG bitstream (which is YCBCR and 3 samples per pixel). After modification of these two tags to "YBR_FULL" and "3" the data set could be converted successfully.

The data could have also been corrupted by the PACS archive itself when storing the data and not by the modality vendor itself. I will clarify that.

So, all good. Thanks again for the great support !!

Best wishes,
David


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group