dcm(j)2pnm not detecting overlay

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
iuvenis
Posts: 3
Joined: Mon, 2021-10-25, 12:12

dcm(j)2pnm not detecting overlay

#1 Post by iuvenis »

We've been using dcmj2pnm to extract jpg copies of dcm images and recently discovered that overlays in the dcm are sometimes not included in the result. dcmj2pnm simply acts as if the dcm contained no overlay data at all (even though it is rendered correctly by e.g. horos and shown by dcmdump), not showing any errors in verbose mode and complaining that there is no overlay layer if it is specified with the +O option. I couldn't figure out from the source code why this might be, but after some experimentation found, that if I convert the dcm to JPEG transfer syntax with monochrome pixel data first, dcmj2pnm suddenly does find and extract the overlay data. I am using dcmtk 3.6.6.

Can anyone help me understand what's wrong here? Is it something about this specific dcm, something about dcmtk, or something about my (lack of) dicom understanding? I uploaded the anonymized dcm in question here:
https://drive.proton.me/urls/00XYQ8BC6W#56uPSlVjODiK

The commands I used are

Code: Select all

dcmcjpeg +pl +cm overlay.dcm converted.dcm
and

Code: Select all

dcmj2pnm --write-jpeg converted.dcm out.jpg
The overlay is a bunch of white lines at the bottom.

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

Re: dcm(j)2pnm not detecting overlay

#2 Post by J. Riesmeier »

The short answer is: dcmj2pnm does not support rendering of overlay planes in color (e.g. RGB) images. It only works for monochrome DICOM images.

iuvenis
Posts: 3
Joined: Mon, 2021-10-25, 12:12

Re: dcm(j)2pnm not detecting overlay

#3 Post by iuvenis »

Alright, thanks for the quick reply.

That information would be a good addition to the help/documentation of dcmj2pnm. That is, unless I just missed it somehow.

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

Re: dcm(j)2pnm not detecting overlay

#4 Post by J. Riesmeier »

Maybe, you are right. Currently, it is only documented in the source code.

Here is some background information: At the time when I implemented support for overlay rendering (more than 25 years ago), there were many uncertainties in the DICOM standard regarding "color overlays", especially regarding embedded overlay data. Furthermore, there was no real use in practice for overlays in color images, but technically speaking it seems to be allowed according to the current edition of the DICOM standard. And, companies seem to use it for ultrasound images, even though your sample file contains various violations of the standard.

In fact, some years ago, there was already a feature request for adding support for overlay in color images to the DCMTK. I found a note in our issue tracker (internal Feature #197). Maybe, we should increase priority for this feature from "low" to "normal".

iuvenis
Posts: 3
Joined: Mon, 2021-10-25, 12:12

Re: dcm(j)2pnm not detecting overlay

#5 Post by iuvenis »

Does "internal feature" mean that the public cannot track its status? The issue tracker here does not show me a ticket #197 even after clearing all filters:
https://support.dcmtk.org/redmine/projects/dcmtk/issues

Could you maybe give me some idea of whether it's likely that this feature will find its way into dcmtk within, say, the next 1-2 years, or whether you deem it to be too low in priority / difficult to implement right for that?

Thanks for your time and sorry for resurrecting an old thread, but I didn't see a point in starting a new one for this.

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

Re: dcm(j)2pnm not detecting overlay

#6 Post by J. Riesmeier »

The link to issue #197 would be this one: https://support.dcmtk.org/redmine/issues/197

However, it is only visible to users that are logged in, because it is a rather old entry that is written in German and it also contains confidential information (e.g. name and email address of the person who submitted the original request).
If you want to track issue #197, you should check the commit messages of the public DCMTK git repository, because we typically reference the issue numbers in the commit message. Something like: "This closes DCMTK Feature #197."
Could you maybe give me some idea of whether it's likely that this feature will find its way into dcmtk within, say, the next 1-2 years, or whether you deem it to be too low in priority / difficult to implement right for that?
Well, the above mentioned entry is over 19 years old, so it is not very likely that this feature will be implemented soon. Also priority is not very high.
Maybe, you'll find this blog post useful in this context as it explains "how are new features added to the DCMTK": https://blog.jriesmeier.com/2013/03/how ... the-dcmtk/

Post Reply

Who is online

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