DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Attributes | Private Attributes | List of all members
DiOverlayPlane Class Reference

Class to handle a single overlay plane. More...

Public Member Functions

 DiOverlayPlane (const DiDocument *docu, const unsigned int group, Uint16 alloc, const Uint16 stored, const Uint16 high)
 constructor More...
 
 DiOverlayPlane (const unsigned int group, const Sint16 left_pos, const Sint16 top_pos, const Uint16 columns, const Uint16 rows, const DcmOverlayData &data, const DcmLongString &label, const DcmLongString &description, const EM_Overlay mode)
 constructor, additional More...
 
 DiOverlayPlane (DiOverlayPlane *plane, const unsigned int bit, Uint16 *data, Uint16 *temp, const Uint16 width, const Uint16 height, const Uint16 columns, const Uint16 rows)
 constructor, copy More...
 
 ~DiOverlayPlane ()
 destructor
 
Sint16 getLeft (const Sint32 left_pos=0) const
 get x-coordinate of overlay plane origin More...
 
Sint16 getTop (const Sint32 top_pos=0) const
 get y-coordinate of overlay plane origin More...
 
Uint16 getWidth () const
 get width of overlay plane More...
 
Uint16 getHeight () const
 get height of overlay plane More...
 
Uint16 getRight (const Sint32 left_pos=0) const
 get right border of overlay plane origin More...
 
Uint16 getBottom (const Sint32 top_pos=0) const
 get bottom border of overlay plane origin More...
 
int isValid () const
 check whether overlay plane is valid More...
 
int isVisible () const
 check whether overlay plane is visible More...
 
void show ()
 make overlay plane visible
 
void hide ()
 make overlay plane invisible
 
void place (const signed int left_pos, const signed int top_pos)
 move overlay plane to a new place More...
 
void setScaling (const double xfactor, const double yfactor)
 set scaling factor in x- and y-direction More...
 
void setFlipping (const int horz, const int vert, const signed long columns, const signed long rows)
 set flipping More...
 
void setRotation (const int degree, const signed long left_pos, const signed long top_pos, const Uint16 columns, const Uint16 rows)
 set rotation More...
 
void show (const double fore, const double thresh, const EM_Overlay mode)
 make overlay plane visible and set parameters More...
 
int show (const Uint16 pvalue)
 make overlay plane visible and set p-value. More...
 
unsigned long getNumberOfFrames () const
 get number of frames More...
 
double getForeground () const
 get foreground color of the plane More...
 
double getThreshold () const
 get threshold value of the plane More...
 
Uint16 getPValue () const
 get p-value of the plane. More...
 
EM_Overlay getMode () const
 get overlay plane mode More...
 
int isEmbedded () const
 check whether overlay plane is embedded in the pixel data More...
 
const char * getLabel () const
 get label of overlay plane More...
 
const char * getDescription () const
 get description of overlay plane More...
 
Uint16 getGroupNumber () const
 get group number of overlay plane More...
 
void * getData (const unsigned long frame, const Uint16 xmin, const Uint16 ymin, const Uint16 xmax, const Uint16 ymax, const int bits, const Uint16 fore, const Uint16 back)
 get overlay plane data as an array of 1/8/16 bit values. More...
 
unsigned long create6xxx3000Data (Uint8 *&buffer, unsigned int &width, unsigned int &height, unsigned long &frames)
 create overlay plane data in (6xxx,3000) format. More...
 
int reset (const unsigned long frame)
 reset internal 'cursor' to the beginning of the specified frame More...
 
int getNextBit ()
 get value of the current overlay plane bit and move 'cursor' to the next position More...
 
void setStart (const Uint16 x, const Uint16 y)
 set internal 'cursor' to a specific position More...
 

Protected Attributes

Uint32 NumberOfFrames
 number of frames
 
Uint16 ImageFrameOrigin
 number of starting frame
 
Uint32 FirstFrame
 first frame to be processed (from DicomImage constructor)
 
Sint16 Top
 y-coordinate of overlay plane's origin
 
Sint16 Left
 x-coordinate of overlay plane's origin
 
Uint16 Height
 visible height
 
Uint16 Width
 visible width
 
Uint16 Rows
 number of (stored) rows
 
Uint16 Columns
 number of (stored) columns
 
Uint16 BitsAllocated
 number of allocated bits per pixel
 
Uint16 BitPosition
 position of overlay plane bit
 
double Foreground
 "color" of overlay plane (in percent: '0.0' = dark, '1.0' = bright)
 
double Threshold
 threshold value used for "threshold replace"
 
Uint16 PValue
 P-value used for bitmap shutters.
 
EM_Overlay Mode
 current overlay mode
 
EM_Overlay DefaultMode
 default (stored) overlay mode
 
OFString Label
 label of overlay plane
 
OFString Description
 textual description of overlay plane
 
Uint16 GroupNumber
 group number of overlay plane
 
int Valid
 validity status
 
int Visible
 visibility status
 

Private Attributes

unsigned long BitPos
 current bit position
 
unsigned long StartBitPos
 starting bit position of current frame
 
unsigned int StartLeft
 x-coordinate of first pixel in surrounding memory buffer
 
unsigned int StartTop
 y-coordinate of first pixel in surrounding memory buffer
 
int EmbeddedData
 true, if overlay data in embedded in pixel data
 
const Uint16 * Ptr
 pointer to current element of 'Data'
 
const Uint16 * StartPtr
 pointer to starting element of current frame
 
const Uint16 * Data
 pointer to overlay data (standalone) or pixel data (embedded)
 

Detailed Description

Class to handle a single overlay plane.

Constructor & Destructor Documentation

DiOverlayPlane::DiOverlayPlane ( const DiDocument docu,
const unsigned int  group,
Uint16  alloc,
const Uint16  stored,
const Uint16  high 
)

constructor

Parameters
docupointer to dataset (encapsulated)
groupgroup number of the overlay plane
allocvalue for bits allocated of the surrounding image
storedvalue for bits stored of the surrounding image
highvalue for high bit of the surrounding image
DiOverlayPlane::DiOverlayPlane ( const unsigned int  group,
const Sint16  left_pos,
const Sint16  top_pos,
const Uint16  columns,
const Uint16  rows,
const DcmOverlayData data,
const DcmLongString label,
const DcmLongString description,
const EM_Overlay  mode 
)

constructor, additional

Parameters
groupgroup number of the overlay plane
left_posx-coordinate of the plane origin
top_posy-coordinate of the plane origin
columnswidth of the overlay plane
rowsheight of the overlay plane
dataelement containing the plane data
labelelement containing the plane label
descriptionelement containing the plane description
modeoverlay plane mode
DiOverlayPlane::DiOverlayPlane ( DiOverlayPlane plane,
const unsigned int  bit,
Uint16 *  data,
Uint16 *  temp,
const Uint16  width,
const Uint16  height,
const Uint16  columns,
const Uint16  rows 
)

constructor, copy

Parameters
planereference overlay plane to be copied
bitposition of the plane bit
datapointer to buffer for plane data
temptemporary buffer used to extract plane information
widthwidth of the array where the plane is stored
heightheight of the array where the plane is stored
columnswidth of the overlay plane
rowsheight of the overlay plane

Member Function Documentation

unsigned long DiOverlayPlane::create6xxx3000Data ( Uint8 *&  buffer,
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)
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
Uint16 DiOverlayPlane::getBottom ( const Sint32  top_pos = 0) const
inline

get bottom border of overlay plane origin

Parameters
top_posoffset to be subtracted from the actual value (optional).
Returns
bottom border of overlay plane origin. Negative values are set to 0.

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

void* DiOverlayPlane::getData ( const unsigned long  frame,
const Uint16  xmin,
const Uint16  ymin,
const Uint16  xmax,
const Uint16  ymax,
const int  bits,
const Uint16  fore,
const Uint16  back 
)

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

Overlay plane is clipped to the area specified by the four min/max coordinates. Memory isn't handled internally and must therefore be deleted from calling program.

Parameters
framenumber of frame
xminx-coordinate of the top left hand corner
yminy-coordinate of the top left hand corner
xmaxx-coordinate of the bottom right hand corner
ymaxy-coordinate of the bottom right hand corner
bitsnumber of bits (stored) in the resulting array
foreforeground color used for the plane (0x00-0xff)
backtransparent background color (0x00-0xff)
Returns
pointer to pixel data if successful, NULL otherwise
const char* DiOverlayPlane::getDescription ( ) const
inline

get description of overlay plane

Returns
description if successful, NULL otherwise
double DiOverlayPlane::getForeground ( ) const
inline

get foreground color of the plane

Returns
foreground color (in percent: 0.0-1.0)

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

Uint16 DiOverlayPlane::getGroupNumber ( ) const
inline

get group number of overlay plane

Returns
group number (0x6000-0x60ff)
Uint16 DiOverlayPlane::getHeight ( ) const
inline

get height of overlay plane

Returns
height of overlay plane
const char* DiOverlayPlane::getLabel ( ) const
inline

get label of overlay plane

Returns
label if successful, NULL otherwise
Sint16 DiOverlayPlane::getLeft ( const Sint32  left_pos = 0) const
inline

get x-coordinate of overlay plane origin

Parameters
left_posoffset to be subtracted from the actual value (optional)
Returns
x-coordinate of overlay plane origin

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

EM_Overlay DiOverlayPlane::getMode ( ) const
inline

get overlay plane mode

Returns
overlay plane mode

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

int DiOverlayPlane::getNextBit ( )
inline

get value of the current overlay plane bit and move 'cursor' to the next position

Returns
true if plane bit is set, false otherwise

References BitPos, BitPosition, BitsAllocated, Ptr, and StartPtr.

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

unsigned long DiOverlayPlane::getNumberOfFrames ( ) const
inline

get number of frames

Returns
number of frames
Uint16 DiOverlayPlane::getPValue ( ) const
inline

get p-value of the plane.

Only valid for bitmap shutters.

Returns
p-value (0..65535)

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

Uint16 DiOverlayPlane::getRight ( const Sint32  left_pos = 0) const
inline

get right border of overlay plane origin

Parameters
left_posoffset to be subtracted from the actual value (optional).
Returns
right border of overlay plane origin. Negative values are set to 0.

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

double DiOverlayPlane::getThreshold ( ) const
inline

get threshold value of the plane

Returns
threshold value (in percent: 0.0-1.0)

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

Sint16 DiOverlayPlane::getTop ( const Sint32  top_pos = 0) const
inline

get y-coordinate of overlay plane origin

Parameters
top_posoffset to be subtracted from the actual value (optional)
Returns
y-coordinate of overlay plane origin

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

Uint16 DiOverlayPlane::getWidth ( ) const
inline

get width of overlay plane

Returns
width of overlay plane
int DiOverlayPlane::isEmbedded ( ) const
inline

check whether overlay plane is embedded in the pixel data

Returns
true if plane is embedded, false otherwise
int DiOverlayPlane::isValid ( ) const
inline

check whether overlay plane is valid

Returns
true if plane is valid, false otherwise
int DiOverlayPlane::isVisible ( ) const
inline

check whether overlay plane is visible

Returns
true if plane is visible, false otherwise

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

void DiOverlayPlane::place ( const signed int  left_pos,
const signed int  top_pos 
)

move overlay plane to a new place

Parameters
left_posx-coordinate of the new plane origin (maybe negative)
top_posy-coordinate of the new plane origin (maybe negative)
int DiOverlayPlane::reset ( const unsigned long  frame)
inline

reset internal 'cursor' to the beginning of the specified frame

Parameters
framenumber of current frame
Returns
status, true if successful, false otherwise

References BitPos, BitPosition, BitsAllocated, Columns, Data, FirstFrame, getBottom(), getRight(), GroupNumber, ImageFrameOrigin, NumberOfFrames, Ptr, Rows, StartBitPos, StartLeft, StartPtr, StartTop, and Valid.

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

void DiOverlayPlane::setFlipping ( const int  horz,
const int  vert,
const signed long  columns,
const signed long  rows 
)

set flipping

Parameters
horzflip horizontally if true
vertflip vertically if true
columnswidth of surrounding image (incl. origin offset)
rowsheight of surrounding image (incl. origin offset)
void DiOverlayPlane::setRotation ( const int  degree,
const signed long  left_pos,
const signed long  top_pos,
const Uint16  columns,
const Uint16  rows 
)

set rotation

Parameters
degreeangle by which the plane should be rotated
left_posx-coordinate of the origin for all overlay planes
top_posy-coordinate of the origin for all overlay planes
columnswidth of surrounding image (already rotated)
rowsheight of surrounding image (already rotated)
void DiOverlayPlane::setScaling ( const double  xfactor,
const double  yfactor 
)

set scaling factor in x- and y-direction

Parameters
xfactorscaling factor in x-direction
yfactorscaling factor in y-direction
void DiOverlayPlane::setStart ( const Uint16  x,
const Uint16  y 
)
inline

set internal 'cursor' to a specific position

Parameters
xnew x-coordinate to start from
ynew y-coordinate to start from

References BitPos, BitsAllocated, Columns, Left, Ptr, StartBitPos, StartPtr, and Top.

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

void DiOverlayPlane::show ( const double  fore,
const double  thresh,
const EM_Overlay  mode 
)

make overlay plane visible and set parameters

Parameters
foreforeground color of the plane (in percent: 0.0-1.0)
threshthreshold value for 'threshold replace' (0.0-1.0)
modenew overlay plane mode (EMO_Default for stored mode)
int DiOverlayPlane::show ( const Uint16  pvalue)

make overlay plane visible and set p-value.

Only applicable for bitmap shutters.

Parameters
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 Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8