DSRSpatialCoordinatesValue Class Reference

Class for spatial coordinate values. More...

Inheritance diagram for DSRSpatialCoordinatesValue:

DSRSCoordTreeNode List of all members.

Public Member Functions

 DSRSpatialCoordinatesValue ()
 default contructor
 DSRSpatialCoordinatesValue (const DSRTypes::E_GraphicType graphicType)
 constructor
 DSRSpatialCoordinatesValue (const DSRSpatialCoordinatesValue &coordinatesValue)
 copy constructor
virtual ~DSRSpatialCoordinatesValue ()
 destructor
DSRSpatialCoordinatesValueoperator= (const DSRSpatialCoordinatesValue &coordinatesValue)
 assignment operator
virtual void clear ()
 clear all internal variables.
virtual OFBool isValid () const
 check whether the current spatial coordinates value is valid.
virtual OFBool isShort (const size_t flags) const
 check whether the content is short.
virtual OFCondition print (ostream &stream, const size_t flags) const
 print spatial coordinates.
virtual OFCondition read (DcmItem &dataset, OFConsole *logStream)
 read spatial coordinates value from dataset
virtual OFCondition write (DcmItem &dataset, OFConsole *logStream) const
 write spatial coordinates reference value to dataset
virtual OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor)
 read spatial coordinates value from XML document
virtual OFCondition writeXML (ostream &stream, const size_t flags, OFConsole *logStream) const
 write spatial coordinates value in XML format
virtual OFCondition renderHTML (ostream &docStream, ostream &annexStream, size_t &annexNumber, const size_t flags, OFConsole *logStream) const
 render spatial coordinates value in HTML format
const DSRSpatialCoordinatesValuegetValue () const
 get reference to spatial coordinates value
DSRTypes::E_GraphicType getGraphicType () const
 get current graphic type.
OFCondition setGraphicType (const DSRTypes::E_GraphicType graphicType)
 set current graphic type.
OFCondition getValue (DSRSpatialCoordinatesValue &coordinatesValue) const
 get copy of spatial coordinates value
OFCondition setValue (const DSRSpatialCoordinatesValue &coordinatesValue)
 set spatial coordinates value.
DSRGraphicDataListgetGraphicDataList ()
 get reference to graphic data list.

Protected Member Functions

DSRSpatialCoordinatesValuegetValuePtr ()
 get pointer to spatial coordinates value
OFBool checkData (const DSRTypes::E_GraphicType graphicType, const DSRGraphicDataList &graphicDataList, OFConsole *logStream=NULL) const
 check the graphic type and data for validity.

Private Attributes

DSRTypes::E_GraphicType GraphicType
 graphic type (associated DICOM VR=CS, type 1)
DSRGraphicDataList GraphicDataList
 graphic data (associated DICOM VR=FL, VM=2-n, type 1)

Friends

class DSRContentItem

Detailed Description

Class for spatial coordinate values.

Definition at line 50 of file dsrscovl.h.


Constructor & Destructor Documentation

DSRSpatialCoordinatesValue::DSRSpatialCoordinatesValue const DSRTypes::E_GraphicType  graphicType  ) 
 

constructor

Parameters:
graphicType graphic type specifying the geometry of the coordinates

DSRSpatialCoordinatesValue::DSRSpatialCoordinatesValue const DSRSpatialCoordinatesValue coordinatesValue  ) 
 

copy constructor

Parameters:
coordinatesValue spatial coordinates value to be copied (not checked !)


Member Function Documentation

OFBool DSRSpatialCoordinatesValue::checkData const DSRTypes::E_GraphicType  graphicType,
const DSRGraphicDataList graphicDataList,
OFConsole logStream = NULL
const [protected]
 

check the graphic type and data for validity.

If 'graphicType' is valid the number of entries in the 'graphicDatalist' are checked. A POINT needs exactly 1 value pair (column,row), a MULTIPOINT at least 1?, a closed POLYLINE at least 1? where the first and last pair are equal, a CIRCLE exactly 2 and an ELLIPSE exactly 4.

Parameters:
graphicType graphic type to be checked
graphicDataList list of graphic data to be checked
logStream pointer to error/warning output stream (output disabled if NULL)
Returns:
OFTrue if graphic type and data are valid, OFFalse otherwise

virtual void DSRSpatialCoordinatesValue::clear  )  [virtual]
 

clear all internal variables.

Graphic type is set to GT_invalid. Since an empty list of graphic data is invalid the spatial coordinates value becomes invalid afterwards.

Reimplemented in DSRSCoordTreeNode.

DSRGraphicDataList& DSRSpatialCoordinatesValue::getGraphicDataList  )  [inline]
 

get reference to graphic data list.

This list contains an ordered set of (columns,rows) pairs that denote positions in an image. The allowed number of pairs is depending on the graphic type.

Returns:
reference to graphic data list

Definition at line 206 of file dsrscovl.h.

References GraphicDataList.

DSRTypes::E_GraphicType DSRSpatialCoordinatesValue::getGraphicType  )  const [inline]
 

get current graphic type.

The graphic type specifies the geometry of the coordinates stored in the graphic data list.

Returns:
graphic type (might be GT_invalid)

Definition at line 174 of file dsrscovl.h.

References GraphicType.

OFCondition DSRSpatialCoordinatesValue::getValue DSRSpatialCoordinatesValue coordinatesValue  )  const
 

get copy of spatial coordinates value

Parameters:
coordinatesValue reference to variable in which the value should be stored
Returns:
status, EC_Normal if successful, an error code otherwise

const DSRSpatialCoordinatesValue& DSRSpatialCoordinatesValue::getValue  )  const [inline]
 

get reference to spatial coordinates value

Returns:
reference to spatial coordinates value

Definition at line 164 of file dsrscovl.h.

DSRSpatialCoordinatesValue* DSRSpatialCoordinatesValue::getValuePtr  )  [inline, protected]
 

get pointer to spatial coordinates value

Returns:
pointer to spatial coordinates value (never NULL)

Definition at line 217 of file dsrscovl.h.

virtual OFBool DSRSpatialCoordinatesValue::isShort const size_t  flags  )  const [virtual]
 

check whether the content is short.

This method is used to check whether the rendered output of this content item can be expanded inline or not (used for renderHTML()).

Parameters:
flags flag used to customize the output (see DSRTypes::HF_xxx)
Returns:
OFTrue if the content is short, OFFalse otherwise

Reimplemented in DSRSCoordTreeNode.

virtual OFBool DSRSpatialCoordinatesValue::isValid  )  const [virtual]
 

check whether the current spatial coordinates value is valid.

The value is valid if the graphic type is not GT_invalid and the graphic data is valid (see checkData() for details).

Returns:
OFTrue if reference value is valid, OFFalse otherwise

Reimplemented in DSRSCoordTreeNode.

DSRSpatialCoordinatesValue& DSRSpatialCoordinatesValue::operator= const DSRSpatialCoordinatesValue coordinatesValue  ) 
 

assignment operator

Parameters:
coordinatesValue spatial coordinates value to be copied (not checked !)
Returns:
reference to this spatial coordinates value after 'coordinatesValue' has been copied

virtual OFCondition DSRSpatialCoordinatesValue::print ostream &  stream,
const size_t  flags
const [virtual]
 

print spatial coordinates.

The output of a typical spatial coordinates value looks like this: (CIRCLE,0/0,255/255).

Parameters:
stream output stream to which the spatial coordinates value should be printed
flags flag used to customize the output (see DSRTypes::PF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRSCoordTreeNode.

virtual OFCondition DSRSpatialCoordinatesValue::read DcmItem dataset,
OFConsole logStream
[virtual]
 

read spatial coordinates value from dataset

Parameters:
dataset DICOM dataset from which the value should be read
logStream pointer to error/warning output stream (output disabled if NULL)
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DSRSpatialCoordinatesValue::readXML const DSRXMLDocument doc,
DSRXMLCursor  cursor
[virtual]
 

read spatial coordinates value from XML document

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DSRSpatialCoordinatesValue::renderHTML ostream &  docStream,
ostream &  annexStream,
size_t &  annexNumber,
const size_t  flags,
OFConsole logStream
const [virtual]
 

render spatial coordinates value in HTML format

Parameters:
docStream output stream to which the main HTML document is written
annexStream output stream to which the HTML document annex is written
annexNumber reference to the variable where the current annex number is stored. Value is increased automatically by 1 after a new entry has been added.
flags flag used to customize the output (see DSRTypes::HF_xxx)
logStream pointer to error/warning output stream (output disabled if NULL)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRSpatialCoordinatesValue::setGraphicType const DSRTypes::E_GraphicType  graphicType  ) 
 

set current graphic type.

The graphic type specifies the geometry of the coordinates stored in the graphic data list.

Parameters:
graphicType graphic type to be set (GT_invalid is not allowed)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRSpatialCoordinatesValue::setValue const DSRSpatialCoordinatesValue coordinatesValue  ) 
 

set spatial coordinates value.

Before setting the value the graphic type and data are checked (see checkData()). If the value is invalid the current value is not replaced and remains unchanged.

Parameters:
coordinatesValue value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DSRSpatialCoordinatesValue::write DcmItem dataset,
OFConsole logStream
const [virtual]
 

write spatial coordinates reference value to dataset

Parameters:
dataset DICOM dataset to which the value should be written
logStream pointer to error/warning output stream (output disabled if NULL)
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DSRSpatialCoordinatesValue::writeXML ostream &  stream,
const size_t  flags,
OFConsole logStream
const [virtual]
 

write spatial coordinates value in XML format

Parameters:
stream output stream to which the XML document is written
flags flag used to customize the output (see DSRTypes::XF_xxx)
logStream pointer to error/warning output stream (output disabled if NULL)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRSCoordTreeNode.


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


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5