DCMTK Version 3.6.8
OFFIS DICOM Toolkit
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
DiOverlay Class Reference

Class to handle a set of overlay planes. More...

+ Inheritance diagram for DiOverlay:

Public Member Functions

 DiOverlay (const DiDocument *docu=NULL, const Uint16 alloc=0, const Uint16 stored=0, const Uint16 high=0)
 constructor More...
 
 DiOverlay (const DiOverlay *overlay, const signed long left_pos, const signed long top_pos, const double xfactor, const double yfactor)
 constructor, clip/scale More...
 
 DiOverlay (const DiOverlay *overlay, const int horz, const int vert, const Uint16 columns, const Uint16 rows)
 constructor, flip More...
 
 DiOverlay (const DiOverlay *overlay, const int degree, const Uint16 columns, const Uint16 rows)
 constructor, rotate More...
 
virtual ~DiOverlay ()
 destructor
 
int isPlaneVisible (unsigned int plane)
 check whether specified plane is currently visible (not hidden) More...
 
int showPlane (unsigned int plane)
 make specified plane visible More...
 
int showPlane (unsigned int plane, const double fore, const double thresh, const EM_Overlay mode)
 make specified plane visible and set parameters More...
 
int showPlane (unsigned int plane, const Uint16 pvalue)
 make specified plane visible and set p-value. More...
 
int showAllPlanes ()
 make all planes visible More...
 
int showAllPlanes (const double fore, const double thresh, const EM_Overlay mode)
 make all planes visible More...
 
int hidePlane (unsigned int plane)
 make specified plane invisible More...
 
int hideAllPlanes ()
 make all planes invisible More...
 
int placePlane (unsigned int plane, const signed int left_pos, const signed int top_pos)
 move plane to a new place More...
 
unsigned int getPlaneGroupNumber (unsigned int plane) const
 get group number of specified plane More...
 
const char * getPlaneLabel (unsigned int plane) const
 get label of specified plane More...
 
const char * getPlaneDescription (unsigned int plane) const
 get description of specified plane More...
 
EM_Overlay getPlaneMode (unsigned int plane) const
 get overlay mode of specified plane More...
 
unsigned int getCount () const
 get number of overlay planes More...
 
signed long getLeft () const
 get current x-coordinate of overlay origin. More...
 
signed long getTop () const
 get current y-coordinate of overlay origin. More...
 
int hasEmbeddedData () const
 check whether there are any overlay planes embedded in the pixel data More...
 
int addPlane (const unsigned int group, const signed int left_pos, const signed int top_pos, const unsigned int columns, const unsigned int rows, const DcmOverlayData &data, const DcmLongString &label, const DcmLongString &description, const EM_Overlay mode)
 add plane to list of additional overlay planes More...
 
int removePlane (const unsigned int group)
 remove specified plane from list of additional overlay planes More...
 
int hasPlane (unsigned int plane, const int visible=0) const
 check whether specified plane exists More...
 
void * getPlaneData (const unsigned long frame, unsigned int plane, unsigned int &left_pos, unsigned int &top_pos, unsigned int &width, unsigned int &height, EM_Overlay &mode, const Uint16 columns, const Uint16 rows, const int bits=8, const Uint16 fore=0xff, const Uint16 back=0x0)
 get overlay plane data as an array of 1/8/16 bit values. More...
 
void * getFullPlaneData (const unsigned long frame, unsigned int plane, unsigned int &width, unsigned int &height, const int bits=8, const Uint16 fore=0xff, const Uint16 back=0x0)
 get overlay plane data as an array of 1/8/16 bit values. More...
 
unsigned long create6xxx3000PlaneData (Uint8 *&buffer, unsigned int plane, unsigned int &width, unsigned int &height, unsigned long &frames)
 create overlay plane data in (6xxx,3000) format. More...
 
- Public Member Functions inherited from DiObjectCounter
void addReference ()
 add a reference. More...
 
void removeReference ()
 remove a reference. More...
 

Static Public Attributes

static const unsigned int MaxOverlayCount
 constant defining the maximum number of overlay planes (16)
 
static const unsigned int FirstOverlayGroup
 constant defining the group number of the first overlay plane (0x6000)
 

Protected Member Functions

Uint16 * Init (const DiOverlay *overlay)
 initialize new overlay managing object More...
 
int convertToPlaneNumber (unsigned int &plane, const int mode) const
 convert given plane or group number to a valid plane number More...
 
unsigned int convertToGroupNumber (const unsigned int plane) const
 convert five plane number to corresponding group number More...
 
int isValidGroupNumber (const unsigned int group) const
 check whether given group number is valid. More...
 
int checkPlane (const unsigned int plane, const int mode=1)
 check whether the specified plane is valid. More...
 
- Protected Member Functions inherited from DiObjectCounter
 DiObjectCounter ()
 constructor. More...
 
virtual ~DiObjectCounter ()
 destructor
 

Private Attributes

signed long Left
 left offset to all planes
 
signed long Top
 top offset to all planes
 
Uint16 Width
 maximum width of all planes
 
Uint16 Height
 maximum height of all planes
 
unsigned long Frames
 maximum number of frames
 
int AdditionalPlanes
 status, if true planes are added later with addPlane()
 
DiOverlayDataData
 points to overlay data (provides shared data)
 

Detailed Description

Class to handle a set of overlay planes.

Constructor & Destructor Documentation

◆ DiOverlay() [1/4]

DiOverlay::DiOverlay ( const DiDocument docu = NULL,
const Uint16  alloc = 0,
const Uint16  stored = 0,
const Uint16  high = 0 
)

constructor

Parameters
docupointer to dataset (encapsulated)
allocbits allocated for image pixel data
storedbits stored for image pixel data
highhigh bit for image pixel data

◆ DiOverlay() [2/4]

DiOverlay::DiOverlay ( const DiOverlay overlay,
const signed long  left_pos,
const signed long  top_pos,
const double  xfactor,
const double  yfactor 
)

constructor, clip/scale

Parameters
overlaypointer to reference overlay object
left_posx-coordinate of new overlay origin (offset for all planes)
top_posy-coordinate of new overlay origin (offset for all planes)
xfactorscaling factor in x-direction
yfactorscaling factor in y-direction

◆ DiOverlay() [3/4]

DiOverlay::DiOverlay ( const DiOverlay overlay,
const int  horz,
const int  vert,
const Uint16  columns,
const Uint16  rows 
)

constructor, flip

Parameters
overlaypointer to reference overlay object
horzflip horizontally if true
vertflip vertically if true
columnswidth of the surrounding image
rowsheight of the surrounding image

◆ DiOverlay() [4/4]

DiOverlay::DiOverlay ( const DiOverlay overlay,
const int  degree,
const Uint16  columns,
const Uint16  rows 
)

constructor, rotate

Parameters
overlaypointer to reference overlay object
degreeangle by which the overlay planes should be rotated
columnswidth of the surrounding image
rowsheight of the surrounding image

Member Function Documentation

◆ addPlane()

int DiOverlay::addPlane ( const unsigned int  group,
const signed int  left_pos,
const signed int  top_pos,
const unsigned int  columns,
const unsigned int  rows,
const DcmOverlayData data,
const DcmLongString label,
const DcmLongString description,
const EM_Overlay  mode 
)

add plane to list of additional overlay planes

Parameters
groupgroup number of plane to be added (0x6000-0x60ff). If group number already exists in the list of additional planes the old one is replaced. If the number exists in the list of planes stored in the image dataset the new plane hides it.
left_posx-coordinate of the plane origin
top_posy-coordinate of the plane origin
columnswidth of the overlay plane (in pixels)
rowsheight of the overlay plane
dataelement where the plane data is stored
labelelement where the plane label is stored
descriptionelement where the plane description is stored
modeoverlay plane mode
Returns
status, true if successful, false otherwise

◆ checkPlane()

int DiOverlay::checkPlane ( const unsigned int  plane,
const int  mode = 1 
)
protected

check whether the specified plane is valid.

and determine maximum resolution and number of frames which are common for all overlay planes so far.

Parameters
planeindex of plane (0..15)
modeif true the maximum number of frames is determined, otherwise not
Returns
status, true if successful, false otherwise

◆ convertToGroupNumber()

unsigned int DiOverlay::convertToGroupNumber ( const unsigned int  plane) const
inlineprotected

convert five plane number to corresponding group number

Parameters
planeindex of plane (0..15)
Returns
group number

◆ convertToPlaneNumber()

int DiOverlay::convertToPlaneNumber ( unsigned int &  plane,
const int  mode 
) const
protected

convert given plane or group number to a valid plane number

Parameters
planeplane or group number to be converted
modetrue or false, see return value
Returns
status, true if successful, false otherwise. (1 = additional plane with the specified group number would be new, 2 = additional plane with the specified group number already exists, 3 = 'plane' is the number of a valid plane - only if 'mode' us false)

◆ create6xxx3000PlaneData()

unsigned long DiOverlay::create6xxx3000PlaneData ( Uint8 *&  buffer,
unsigned int  plane,
unsigned int &  width,
unsigned int &  height,
unsigned long &  frames 
)

create overlay plane data in (6xxx,3000) format.

(1 bit allocated and stored, foreground color is 1, background color is 0, data is 16 bit padded - even length) Memory isn't handled internally and must therefore be deleted from calling program.

Parameters
bufferstores pointer to overlay data (memory is allocated internally)
planenumber (0..15) or group number (0x60nn) of overlay plane
widthreturns width of overlay plane (in pixels)
heightreturns height of overlay plane (in pixels)
framesreturns number of frames (multiple overlay frames possible!)
Returns
number of bytes allocated for the 'buffer' if successful, 0 otherwise

◆ getCount()

unsigned int DiOverlay::getCount ( ) const
inline

get number of overlay planes

Returns
number of overlay planes

◆ getFullPlaneData()

void * DiOverlay::getFullPlaneData ( const unsigned long  frame,
unsigned int  plane,
unsigned int &  width,
unsigned int &  height,
const int  bits = 8,
const Uint16  fore = 0xff,
const Uint16  back = 0x0 
)

get overlay plane data as an array of 1/8/16 bit values.

Memory isn't handled internally and must therefore be deleted from calling program.

Parameters
framenumber of frame
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
widthget width of the overlay plane (in pixels)
heightget height of the overlay plane
bitsnumber of bits (stored) in the resulting array, default: 8
foreforeground color used for the plane (default: 0xff = white, for 8 bits)
backtransparent background color (default: 0x00 = black)
Returns
pointer to pixel data if successful, NULL otherwise

◆ getLeft()

signed long DiOverlay::getLeft ( ) const
inline

get current x-coordinate of overlay origin.

This value is added to the origin of all overlay planes.

Returns
x-coordinate of overlay origin

Referenced by DiMonoOutputPixelTemplate< T1, T2, T3 >::overlay().

◆ getPlaneData()

void * DiOverlay::getPlaneData ( const unsigned long  frame,
unsigned int  plane,
unsigned int &  left_pos,
unsigned int &  top_pos,
unsigned int &  width,
unsigned int &  height,
EM_Overlay mode,
const Uint16  columns,
const Uint16  rows,
const int  bits = 8,
const Uint16  fore = 0xff,
const Uint16  back = 0x0 
)

get overlay plane data as an array of 1/8/16 bit values.

Memory isn't handled internally and must therefore be deleted from calling program.

Parameters
framenumber of frame
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
left_posget x-coordinate of the plane origin
top_posget y-coordinate of the plane origin
widthget width of the overlay plane (in pixels)
heightget height of the overlay plane
modeget overlay plane mode
columnswidth of the surrounding image
rowsheight of the surrounding image
bitsnumber of bits (stored) in the resulting array, default: 8
foreforeground color used for the plane (default: 0xff = white, for 8 bits)
backtransparent background color (default: 0x00 = black)
Returns
pointer to pixel data if successful, NULL otherwise

◆ getPlaneDescription()

const char * DiOverlay::getPlaneDescription ( unsigned int  plane) const

get description of specified plane

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
Returns
plane description if successful, NULL otherwise

◆ getPlaneGroupNumber()

unsigned int DiOverlay::getPlaneGroupNumber ( unsigned int  plane) const

get group number of specified plane

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
Returns
group number (0x6000-0x60ff) if successful, 0 otherwise

◆ getPlaneLabel()

const char * DiOverlay::getPlaneLabel ( unsigned int  plane) const

get label of specified plane

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
Returns
plane label if successful, NULL otherwise

◆ getPlaneMode()

EM_Overlay DiOverlay::getPlaneMode ( unsigned int  plane) const

get overlay mode of specified plane

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
Returns
overlay mode if successful, EMO_Default otherwise

◆ getTop()

signed long DiOverlay::getTop ( ) const
inline

get current y-coordinate of overlay origin.

This value is added to the origin of all overlay planes.

Returns
y-coordinate of overlay origin

Referenced by DiMonoOutputPixelTemplate< T1, T2, T3 >::overlay().

◆ hasEmbeddedData()

int DiOverlay::hasEmbeddedData ( ) const

check whether there are any overlay planes embedded in the pixel data

Returns
true if there are embedded planes, false otherwise

◆ hasPlane()

int DiOverlay::hasPlane ( unsigned int  plane,
const int  visible = 0 
) const
inline

check whether specified plane exists

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
visibleflag indicating whether plane should be visible or not (default: 0 = ignore)
Returns
status, true if such a plane exists, false otherwise

◆ hideAllPlanes()

int DiOverlay::hideAllPlanes ( )

make all planes invisible

Returns
status, true if successful, false otherwise

◆ hidePlane()

int DiOverlay::hidePlane ( unsigned int  plane)

make specified plane invisible

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
Returns
status, true if successful, false otherwise

◆ Init()

Uint16 * DiOverlay::Init ( const DiOverlay overlay)
protected

initialize new overlay managing object

Parameters
overlayreference object used as a template
Returns
pointer to a new array of pixel data

◆ isPlaneVisible()

int DiOverlay::isPlaneVisible ( unsigned int  plane)

check whether specified plane is currently visible (not hidden)

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
Returns
true if plane is visible, false otherwise

◆ isValidGroupNumber()

int DiOverlay::isValidGroupNumber ( const unsigned int  group) const
protected

check whether given group number is valid.

Valid means that the number is even and between 0x6000 and 0x60ff.

Parameters
groupgroup number to be checked
Returns
status, true if valid, false otherwise

◆ placePlane()

int DiOverlay::placePlane ( unsigned int  plane,
const signed int  left_pos,
const signed int  top_pos 
)

move plane to a new place

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
left_posnew x-coordinate of the overlay plane origin
top_posnew y-coordinate of the overlay plane origin
Returns
status, true if successful, false otherwise

◆ removePlane()

int DiOverlay::removePlane ( const unsigned int  group)

remove specified plane from list of additional overlay planes

Parameters
groupgroup number of plane to be removed (0x6000-0x60ff)
Returns
status, true if successful, false otherwise

◆ showAllPlanes() [1/2]

int DiOverlay::showAllPlanes ( )

make all planes visible

Returns
status, true if successful, false otherwise

◆ showAllPlanes() [2/2]

int DiOverlay::showAllPlanes ( const double  fore,
const double  thresh,
const EM_Overlay  mode 
)

make all planes visible

Parameters
foreforeground color for overlay planes (in percent: 0.0-1.0)
threshthreshold value for overlay planes (in percent: 0.0-1.0)
modenew overlay mode (EMO_Default for stored mode)
Returns
status, true if successful, false otherwise

◆ showPlane() [1/3]

int DiOverlay::showPlane ( unsigned int  plane)

make specified plane visible

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
Returns
status, true if successful, false otherwise

◆ showPlane() [2/3]

int DiOverlay::showPlane ( unsigned int  plane,
const double  fore,
const double  thresh,
const EM_Overlay  mode 
)

make specified plane visible and set parameters

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
foreforeground color for overlay plane (in percent: 0.0-1.0)
threshthreshold value for overlay plane (0.0-1.0)
modenew overlay mode (EMO_Default for stored mode)
Returns
status, true if successful, false otherwise

◆ showPlane() [3/3]

int DiOverlay::showPlane ( unsigned int  plane,
const Uint16  pvalue 
)

make specified plane visible and set p-value.

Only applicable for bitmap shutters.

Parameters
planeindex of plane (starting from 0) or group number (0x6000-0x60ff)
pvaluep-value to be used for the overlay plane (0..65535)
Returns
status, true if successful, false otherwise

The documentation for this class was generated from the following file:


Generated on Tue Dec 19 2023 for DCMTK Version 3.6.8 by Doxygen 1.9.4