DCMTK: DiOverlay Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
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
| DiOverlay (const DiOverlay *overlay, const signed long left_pos, const signed long top_pos, const double xfactor, const double yfactor)
| constructor, clip/scale
| DiOverlay (const DiOverlay *overlay, const int horz, const int vert, const Uint16 columns, const Uint16 rows)
| constructor, flip
| DiOverlay (const DiOverlay *overlay, const int degree, const Uint16 columns, const Uint16 rows)
| constructor, rotate
virtual | ~DiOverlay ()
| destructor
int | isPlaneVisible (unsigned int plane)
| check whether specified plane is currently visible (not hidden)
int | showPlane (unsigned int plane)
| make specified plane visible
int | showPlane (unsigned int plane, const double fore, const double thresh, const EM_Overlay mode)
| make specified plane visible and set parameters
int | showPlane (unsigned int plane, const Uint16 pvalue)
| make specified plane visible and set p-value.
int | showAllPlanes ()
| make all planes visible
int | showAllPlanes (const double fore, const double thresh, const EM_Overlay mode)
| make all planes visible
int | hidePlane (unsigned int plane)
| make specified plane invisible
int | hideAllPlanes ()
| make all planes invisible
int | placePlane (unsigned int plane, const signed int left_pos, const signed int top_pos)
| move plane to a new place
unsigned int | getPlaneGroupNumber (unsigned int plane) const
| get group number of specified plane
const char * | getPlaneLabel (unsigned int plane) const
| get label of specified plane
const char * | getPlaneDescription (unsigned int plane) const
| get description of specified plane
EM_Overlay | getPlaneMode (unsigned int plane) const
| get overlay mode of specified plane
unsigned int | getCount () const
| get number of overlay planes
signed long | getLeft () const
| get current x-coordinate of overlay origin.
signed long | getTop () const
| get current y-coordinate of overlay origin.
int | hasEmbeddedData () const
| check whether there are any overlay planes embedded in the pixel data
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
int | removePlane (const unsigned int group)
| remove specified plane from list of additional overlay planes
int | hasPlane (unsigned int plane, const int visible=0) const
| check whether specified plane exists
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.
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.
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.
Public Member Functions inherited from DiObjectCounter
void | addReference ()
| add a reference.
void | removeReference ()
| remove a reference.

## 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
int | convertToPlaneNumber (unsigned int &plane, const int mode) const
| convert given plane or group number to a valid plane number
unsigned int | convertToGroupNumber (const unsigned int plane) const
| convert five plane number to corresponding group number
int | isValidGroupNumber (const unsigned int group) const
| check whether given group number is valid.
int | checkPlane (const unsigned int plane, const int mode=1)
| check whether the specified plane is valid.
Protected Member Functions inherited from DiObjectCounter
| DiObjectCounter ()
| constructor.
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()
DiOverlayData * | Data
| 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

  docu | pointer to dataset (encapsulated)
  alloc | bits allocated for image pixel data
  stored | bits stored for image pixel data
  high | high bit for image pixel data

Referenced by DiOverlay(), DiOverlay(), DiOverlay(), and Init().

## ◆ 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

  overlay | pointer to reference overlay object
  left_pos | x-coordinate of new overlay origin (offset for all planes)
  top_pos | y-coordinate of new overlay origin (offset for all planes)
  xfactor | scaling factor in x-direction
  yfactor | scaling factor in y-direction

References DiOverlay().

## ◆ DiOverlay() [3/4]

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

constructor, flip

Parameters

  overlay | pointer to reference overlay object
  horz | flip horizontally if true
  vert | flip vertically if true
  columns | width of the surrounding image
  rows | height of the surrounding image

References DiOverlay().

## ◆ DiOverlay() [4/4]

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

constructor, rotate

Parameters

  overlay | pointer to reference overlay object
  degree | angle by which the overlay planes should be rotated
  columns | width of the surrounding image
  rows | height of the surrounding image

References DiOverlay().

## 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

  group | group 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_pos | x-coordinate of the plane origin
  top_pos | y-coordinate of the plane origin
  columns | width of the overlay plane (in pixels)
  rows | height of the overlay plane
  data | element where the plane data is stored
  label | element where the plane label is stored
  description | element where the plane description is stored
  mode | overlay 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

  plane | index of plane (0..15)
  mode | if 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

  plane | index of plane (0..15)

Returns
  group number

References FirstOverlayGroup.

## ◆ convertToPlaneNumber()

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

convert given plane or group number to a valid plane number

Parameters

  plane | plane or group number to be converted
  mode | true 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)

Referenced by hasPlane().

## ◆ 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

  buffer | stores pointer to overlay data (memory is allocated internally)
  plane | number (0..15) or group number (0x60nn) of overlay plane
  width | returns width of overlay plane (in pixels)
  height | returns height of overlay plane (in pixels)
  frames | returns 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

References Data.

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

## ◆ 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

  frame | number of frame
  plane | index of plane (starting from 0) or group number (0x6000-0x60ff)
  width | get width of the overlay plane (in pixels)
  height | get height of the overlay plane
  bits | number of bits (stored) in the resulting array, default: 8
  fore | foreground color used for the plane (default: 0xff = white, for 8 bits)
  back | transparent 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

References Left.

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

  frame | number of frame
  plane | index of plane (starting from 0) or group number (0x6000-0x60ff)
  left_pos | get x-coordinate of the plane origin
  top_pos | get y-coordinate of the plane origin
  width | get width of the overlay plane (in pixels)
  height | get height of the overlay plane
  mode | get overlay plane mode
  columns | width of the surrounding image
  rows | height of the surrounding image
  bits | number of bits (stored) in the resulting array, default: 8
  fore | foreground color used for the plane (default: 0xff = white, for 8 bits)
  back | transparent 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

  plane | index 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

  plane | index 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

  plane | index 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

  plane | index 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

References Top.

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

  plane | index of plane (starting from 0) or group number (0x6000-0x60ff)
  visible | flag indicating whether plane should be visible or not (default: 0 = ignore)

Returns
  status, true if such a plane exists, false otherwise

References AdditionalPlanes, convertToPlaneNumber(), and Data.

## ◆ 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

  plane | index 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

  overlay | reference object used as a template

Returns
  pointer to a new array of pixel data

References DiOverlay().

## ◆ isPlaneVisible()

int DiOverlay::isPlaneVisible | ( | unsigned int | plane | ) |

check whether specified plane is currently visible (not hidden)

Parameters

  plane | index 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

  group | group 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

  plane | index of plane (starting from 0) or group number (0x6000-0x60ff)
  left_pos | new x-coordinate of the overlay plane origin
  top_pos | new 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

  group | group number of plane to be removed (0x6000-0x60ff)

Returns
  status, true if successful, false otherwise

References Data.

## ◆ 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

  fore | foreground color for overlay planes (in percent: 0.0-1.0)
  thresh | threshold value for overlay planes (in percent: 0.0-1.0)
  mode | new 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

  plane | index 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

  plane | index of plane (starting from 0) or group number (0x6000-0x60ff)
  fore | foreground color for overlay plane (in percent: 0.0-1.0)
  thresh | threshold value for overlay plane (0.0-1.0)
  mode | new 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

  plane | index of plane (starting from 0) or group number (0x6000-0x60ff)
  pvalue | p-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:

- dcmimgle/include/dcmtk/dcmimgle/diovlay.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2