DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
DiOverlay Class Reference

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

+ Inheritance diagram for DiOverlay:

List of all members.

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
DiOverlayPlanegetPlane (const unsigned int plane) const
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.

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.

Private Member Functions

 DiOverlay (const DiOverlay &)
DiOverlayoperator= (const DiOverlay &)

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::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::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::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::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 overlayplanes should be rotated
columnswidth of the surrounding image
rowsheight of the surrounding image

Member Function Documentation

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
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
unsigned int DiOverlay::convertToGroupNumber ( const unsigned int  plane) const [inline, protected]

convert five plane number to corresponding group number

Parameters:
planeindex of plane (0..15)
Returns:
group number
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)
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
unsigned int DiOverlay::getCount ( ) const [inline]

get number of overlay planes

Returns:
number of overlay planes
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
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
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
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
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
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
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
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

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

Returns:
true if there are embedded planes, false otherwise
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

make all planes invisible

Returns:
status, true if successful, false otherwise
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
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
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
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
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
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

make all planes visible

Returns:
status, true if successful, false otherwise
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
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
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
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 May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027