Invert the Overlay data

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Posts: 4
Joined: Mon, 2004-12-06, 05:57

Invert the Overlay data

#1 Post by Yamini » Fri, 2005-02-18, 06:24

Is there a way to do an invert (inverse video) of the overlay data, along with the image?
I checked DicomScope 3.6.0 that it doesnt invert the overlay info.
And I couldnt find any api in the DVPSOverlay class.

But can someone suggest any alternate way to do it ?

Marco Eichelberg
Posts: 1292
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany

#2 Post by Marco Eichelberg » Fri, 2005-02-18, 10:36

This depends on how you define the term invert here. If you want to convert visible overlay pixels into invisible and vice versa, there is no such API, you would have to do low-level bit manipulations yourself. If you want to change the color (shade of gray) that is used to display the visible bits of the overlay, that is possible.
You won't find an API in class DVPSOverlay (which is part of the presentation state code in module dcmpstat) because the display color is not maintained with the overlay, but is defined for each so-called "presentation layer". In a DICOM GSPS, all graphical objects (text, vector graphics and bitmap overlays) are organised in layers. Each layer has one color and there is a well-defined order in which the layers have to be drawn. The API is in class DcmPresentationState:

Code: Select all

size_t getOverlayInPresentationStateActivationLayer(size_t idx);
OFCondition setGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16 gray);
The first method returns the index of the layer object to which the overlay with the given index belongs (overlays are addressed by index at this level, see the complete class interface for how to determine this index). The second methods assigns a new gray value to the given layer. Gray values at this point are 16-bit, with 0=black and 0xFFFF=white.

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

#3 Post by Jörg Riesmeier » Fri, 2005-02-18, 10:56

You could also use the class DicomImage directly in case you don't have any GSPS object. There are API methods that allow to modify the visual appearance of the overlay planes - see DicomImage::showOverlay() and DicomImage::showAllOverlays().

Depending on what you mean by "invert" you could extend the list of overlay display modes defined in "diutils.h" and modify the code in "dimoopxt.h" accordingly. This should be pretty easy.

Btw, what is the background of your question, i.e. what are you trying to achieve? Maybe, we could add this feature to the next release.

Post Reply

Who is online

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