DCMTK: CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > Class Template Reference

DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > Class Template Reference

Class for SR numeric values and measurements (extended version with additional support of the DICOM Content Mapping Resource). More...

Inheritance diagram for CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >:

## Public Member Functions
| CMR_SRNumericMeasurementValueWithUnits ()
| default constructor
| CMR_SRNumericMeasurementValueWithUnits (const OFString &numericValue, const T_Units &measurementUnit, const OFBool check=OFTrue)
| constructor
| CMR_SRNumericMeasurementValueWithUnits (const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| constructor
| CMR_SRNumericMeasurementValueWithUnits (const OFString &numericValue, const T_Units &measurementUnit, const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| constructor
| CMR_SRNumericMeasurementValueWithUnits (const CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > &numericMeasurement)
| copy constructor
| CMR_SRNumericMeasurementValueWithUnits (const CMR_SRNumericMeasurementValue &numericMeasurement)
| copy constructor
virtual | ~CMR_SRNumericMeasurementValueWithUnits ()
| destructor
CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > & | operator= (const CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > &numericMeasurement)
| assignment operator
OFCondition | setValue (const OFString &numericValue, const T_Units &measurementUnit, const OFBool check=OFTrue)
| set numeric value and measurement unit.
OFCondition | setValue (const OFString &numericValue, const T_Units &measurementUnit, const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| set numeric value, measurement unit and numeric value qualifier.
OFCondition | setMeasurementUnit (const T_Units &measurementUnit, const OFBool check=OFTrue)
| set measurement unit.
Public Member Functions inherited from CMR_SRNumericMeasurementValue
| CMR_SRNumericMeasurementValue ()
| default constructor
| CMR_SRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
| constructor
| CMR_SRNumericMeasurementValue (const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| constructor
| CMR_SRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| constructor
| CMR_SRNumericMeasurementValue (const CMR_SRNumericMeasurementValue &numericMeasurement)
| copy constructor
| CMR_SRNumericMeasurementValue (const DSRNumericMeasurementValue &numericMeasurement)
| copy constructor
virtual | ~CMR_SRNumericMeasurementValue ()
| destructor
CMR_SRNumericMeasurementValue & | operator= (const CMR_SRNumericMeasurementValue &numericMeasurement)
| assignment operator
OFCondition | setValue (const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| set empty numeric value and measurement unit with a numeric value qualifier.
OFCondition | setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| set numeric value, measurement unit and numeric value qualifier.
OFCondition | setNumericValueQualifier (const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
| set numeric value qualifier.
OFCondition | setValue (const DSRNumericMeasurementValue &numericMeasurement, const OFBool check=OFTrue)
| set numeric measurement value.
OFCondition | setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
| set numeric value and measurement unit.
OFCondition | setValue (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| set empty numeric value and measurement unit with a numeric value qualifier.
OFCondition | setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| set numeric value, measurement unit and numeric value qualifier.
OFCondition | setNumericValueQualifier (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| set numeric value qualifier.
Public Member Functions inherited from DSRNumericMeasurementValue
| DSRNumericMeasurementValue ()
| default constructor
| DSRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
| constructor
| DSRNumericMeasurementValue (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| constructor
| DSRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| constructor
| DSRNumericMeasurementValue (const DSRNumericMeasurementValue &numericMeasurement)
| copy constructor
virtual | ~DSRNumericMeasurementValue ()
| destructor
DSRNumericMeasurementValue & | operator= (const DSRNumericMeasurementValue &numericMeasurement)
| assignment operator
virtual void | clear ()
| clear all internal variables.
OFBool | isEqual (const DSRNumericMeasurementValue &numericMeasurement) const
| check whether values are "equal".
OFBool | isNotEqual (const DSRNumericMeasurementValue &numericMeasurement) const
| check whether values are "not equal".
virtual OFBool | isValid () const
| check whether the current numeric measurement value is valid.
virtual OFBool | isEmpty () const
| check whether the current numeric measurement value is empty.
virtual OFBool | isComplete () const
| check whether the current numeric measurement value is complete, i.e. whether the numeric value is non-empty and the measurement unit is complete, or whether the value qualifier is complete.
virtual OFCondition | print (STD_NAMESPACE ostream &stream, const size_t flags) const
| print numeric measurement value.
virtual OFCondition | readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
| read numeric measurement value from XML document
virtual OFCondition | writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const
| write numeric measurement value in XML format
virtual OFCondition | readSequence (DcmItem &dataset, const size_t flags)
| read measured value sequence and numeric value qualifier code sequence from dataset.
virtual OFCondition | writeSequence (DcmItem &dataset) const
| write measured value sequence and numeric value qualifier code sequence to dataset.
virtual OFCondition | renderHTML (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, size_t &annexNumber, const size_t flags) const
| render numeric measurement value in HTML/XHTML format
const DSRNumericMeasurementValue & | getValue () const
| get reference to numeric measurement value
OFCondition | getValue (DSRNumericMeasurementValue &numericMeasurement) const
| get copy of numeric measurement value
const OFString & | getNumericValue () const
| get numeric value
const DSRCodedEntryValue & | getMeasurementUnit () const
| get measurement unit
const DSRCodedEntryValue & | getNumericValueQualifier () const
| get numeric value qualifier (conditional)
OFCondition | getMeasurementUnit (DSRCodedEntryValue &measurementUnit) const
| get copy of measurement unit
OFCondition | getNumericValueQualifier (DSRCodedEntryValue &valueQualifier) const
| get copy of numeric value qualifier (conditional)
OFCondition | getFloatingPointRepresentation (Float64 &floatingPoint) const
| get floating point representation of the numeric value (optional)
OFCondition | getRationalRepresentation (Sint32 &rationalNumerator, Uint32 &rationalDenominator) const
| get rational representation of the numeric value (optional)
OFCondition | setValue (const DSRNumericMeasurementValue &numericMeasurement, const OFBool check=OFTrue)
| set numeric measurement value.
OFCondition | setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
| set numeric value and measurement unit.
OFCondition | setValue (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| set empty numeric value and measurement unit with a numeric value qualifier.
OFCondition | setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| set numeric value, measurement unit and numeric value qualifier.
OFCondition | setNumericValue (const OFString &numericValue, const OFBool check=OFTrue)
| set numeric value.
OFCondition | setNumericValue (const DcmElement &delem, const unsigned long pos=0, const OFBool check=OFTrue)
| set numeric value from element.
OFCondition | setNumericValue (DcmItem &dataset, const DcmTagKey &tagKey, const unsigned long pos=0, const OFBool check=OFTrue)
| set numeric value from dataset.
OFCondition | setMeasurementUnit (const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
| set measurement unit.
OFCondition | setNumericValueQualifier (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
| set numeric value qualifier.
OFCondition | setFloatingPointRepresentation (const Float64 floatingPoint, const OFBool check=OFTrue)
| set floating point representation of the numeric value.
OFCondition | setRationalRepresentation (const Sint32 rationalNumerator, const Uint32 rationalDenominator, const OFBool check=OFTrue)
| set rational representation of the numeric value.
void | removeFloatingPointRepresentation ()
| remove floating point representation of the numeric value (if any).
void | removeRationalRepresentation ()
| remove rational representation of the numeric value (if any).

## Protected Member Functions
virtual OFCondition | checkMeasurementUnit (const DSRCodedEntryValue &measurementUnit) const
| check the specified measurement unit for validity.
virtual OFCondition | checkMeasurementUnit (const T_Units &measurementUnit) const
| check the specified measurement unit for validity.
Protected Member Functions inherited from CMR_SRNumericMeasurementValue
virtual OFCondition | checkNumericValueQualifier (const DSRCodedEntryValue &valueQualifier) const
| check the specified numeric value qualifier for validity.
Protected Member Functions inherited from DSRNumericMeasurementValue
DSRNumericMeasurementValue * | getValuePtr ()
| get pointer to numeric measurement value
virtual OFCondition | readItem (DcmItem &dataset, const size_t flags)
| read numeric measurement value from dataset
virtual OFCondition | writeItem (DcmItem &dataset) const
| write numeric measurement value to dataset
virtual OFCondition | checkNumericValue (const OFString &numericValue) const
| check the specified numeric value for validity.
virtual OFCondition | checkRationalRepresentation (const Sint32 rationalNumerator, const Uint32 rationalDenominator) const
| check the specified rational representation for validity.
virtual OFCondition | checkCurrentValue () const
| check the currently stored numeric measurement value for validity.

## Detailed Description

template<typename T_Units, OFBool T_DefinedGroup = OFFalse>
class CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >

Class for SR numeric values and measurements (extended version with additional support of the DICOM Content Mapping Resource).

This class checks whether the optional value qualifier uses a coded entry from the Defined Context Group 42 (Numeric Value Qualifier), see DICOM PS 3.3 Table C.18.1-1. It also provides a means of specifying the Context Group for the measurement unit as a C++ template type parameter. Both Baseline (BCID) and Defined Context Groups (DCID) are supported.

Template Parameters

  T_Units | template type used for the measurement units (context group)
  T_DefinedGroup | flag indicating whether 'T_Units' is used as a baseline (default) or defined context group

## Constructor & Destructor Documentation

## ◆ CMR_SRNumericMeasurementValueWithUnits() [1/5]

template<typename T_Units, OFBool T_DefinedGroup>

CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::CMR_SRNumericMeasurementValueWithUnits | ( | const OFString & | numericValue,
|  | const T_Units & | measurementUnit,
|  | const OFBool | check = OFTrue )

constructor

Parameters

  numericValue | numeric value (VR=DS, mandatory)
  measurementUnit | code representing the units of measurement (mandatory)
  check | if enabled, check 'numericValue' and 'measurementUnit' for validity before setting them. See corresponding setValue() method for details.

References CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(), and setValue().

## ◆ CMR_SRNumericMeasurementValueWithUnits() [2/5]

template<typename T_Units, OFBool T_DefinedGroup>

CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::CMR_SRNumericMeasurementValueWithUnits | ( | const CID42_NumericValueQualifier & | valueQualifier,
|  | const OFBool | check = OFTrue )

constructor

Parameters

  valueQualifier | code representing the numeric value qualifier (mandatory). Used to specify the reason for the absence of the measured value sequence, i.e. why the numeric value and measurement unit are empty.
  check | if enabled, check value for validity before setting it. See corresponding setValue() method for details.

References CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue().

## ◆ CMR_SRNumericMeasurementValueWithUnits() [3/5]

template<typename T_Units, OFBool T_DefinedGroup>

CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::CMR_SRNumericMeasurementValueWithUnits | ( | const OFString & | numericValue,
|  | const T_Units & | measurementUnit,
|  | const CID42_NumericValueQualifier & | valueQualifier,
|  | const OFBool | check = OFTrue )

constructor

Parameters

  numericValue | numeric value (VR=DS, mandatory)
  measurementUnit | code representing the units of measurement (mandatory)
  valueQualifier | code representing the numeric value qualifier (optional)
  check | if enabled, check values for validity before setting them. See corresponding setValue() method for details.

References CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(), and setValue().

## ◆ CMR_SRNumericMeasurementValueWithUnits() [4/5]

template<typename T_Units, OFBool T_DefinedGroup>

CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::CMR_SRNumericMeasurementValueWithUnits | ( | const CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > & | numericMeasurement | ) |

copy constructor

Parameters

  numericMeasurement | numeric measurement value to be copied (not checked !)

References CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue(), and CMR_SRNumericMeasurementValueWithUnits().

## ◆ CMR_SRNumericMeasurementValueWithUnits() [5/5]

template<typename T_Units, OFBool T_DefinedGroup>

CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::CMR_SRNumericMeasurementValueWithUnits | ( | const CMR_SRNumericMeasurementValue & | numericMeasurement | ) |

copy constructor

Parameters

  numericMeasurement | numeric measurement value to be copied (not checked !)

References CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue().

## Member Function Documentation

## ◆ checkMeasurementUnit() [1/2]

template<typename T_Units, OFBool T_DefinedGroup>

OFCondition CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::checkMeasurementUnit | ( | const DSRCodedEntryValue & | measurementUnit | ) | const
| protectedvirtual

check the specified measurement unit for validity.

First, the inherited method CMR_SRNumericMeasurementValue::checkMeasurementUnit() is called. Then, conformance with any Defined Context Group (T_Units) is checked.

Parameters

  measurementUnit | measurement unit to be checked

Returns
  status, EC_Normal if measurement unit is valid, an error code otherwise

Reimplemented from DSRNumericMeasurementValue.

References DSRNumericMeasurementValue::checkMeasurementUnit(), OFCondition::good(), and SR_EC_CodedEntryNotInContextGroup.

Referenced by setMeasurementUnit(), and setValue().

## ◆ checkMeasurementUnit() [2/2]

template<typename T_Units, OFBool T_DefinedGroup>

OFCondition CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::checkMeasurementUnit | ( | const T_Units & | measurementUnit | ) | const
| protectedvirtual

check the specified measurement unit for validity.

This method also checks conformance with any Defined Context Group (T_Units).

Parameters

  measurementUnit | measurement unit to be checked

Returns
  status, EC_Normal if measurement unit is valid, an error code otherwise

References SR_EC_InvalidValue.

## ◆ operator=()

template<typename T_Units, OFBool T_DefinedGroup>

CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > & CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::operator= | ( | const CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup > & | numericMeasurement | ) |

assignment operator

Parameters

  numericMeasurement | numeric measurement value to be copied (not checked !)

Returns
  reference to this numeric value after 'numericMeasurement' has been copied

References CMR_SRNumericMeasurementValueWithUnits(), and CMR_SRNumericMeasurementValue::operator=().

## ◆ setMeasurementUnit()

template<typename T_Units, OFBool T_DefinedGroup>

OFCondition CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setMeasurementUnit | ( | const T_Units & | measurementUnit,
|  | const OFBool | check = OFTrue )

set measurement unit.

Before setting the code, it is usually checked. If the code is invalid the current code is not replaced and remains unchanged.

Parameters

  measurementUnit | measurement unit to be set (mandatory)
  check | if enabled, check value for validity before setting it. See checkMeasurementUnit() method for details. An empty value is never accepted, use the clear() method instead.

Returns
  status, EC_Normal if successful, an error code otherwise

References checkMeasurementUnit(), EC_Normal, OFCondition::good(), and DSRNumericMeasurementValue::setMeasurementUnit().

## ◆ setValue() [1/2]

template<typename T_Units, OFBool T_DefinedGroup>

OFCondition CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setValue | ( | const OFString & | numericValue,
|  | const T_Units & | measurementUnit,
|  | const CID42_NumericValueQualifier & | valueQualifier,
|  | const OFBool | check = OFTrue )

set numeric value, measurement unit and numeric value qualifier.

Before setting the values, they are usually checked. Please note that both 'numericValue' and 'measurementUnit' either have to be empty or non-empty. If one of the three values is invalid, the current numeric measurement value is not replaced and remains unchanged. If the values are replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters

  numericValue | numeric value to be set (VR=DS, mandatory)
  measurementUnit | measurement unit to be set (mandatory)
  valueQualifier | numeric value qualifier to be set (optional). Use an empty code to remove the current value.
  check | if enabled, check values for validity before setting them. See checkXXX() methods for details.

Returns
  status, EC_Normal if successful, an error code otherwise

References checkMeasurementUnit(), DSRNumericMeasurementValue::checkNumericValue(), CMR_SRNumericMeasurementValue::checkNumericValueQualifier(), EC_Normal, OFString::empty(), OFCondition::good(), and CMR_SRNumericMeasurementValue::setValue().

## ◆ setValue() [2/2]

template<typename T_Units, OFBool T_DefinedGroup>

OFCondition CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setValue | ( | const OFString & | numericValue,
|  | const T_Units & | measurementUnit,
|  | const OFBool | check = OFTrue )

set numeric value and measurement unit.

Before setting the values, they are usually checked. Please note that both values (i.e. 'numericValue' and 'measurementUnit') either have to be empty or non-empty. If the value pair is invalid, the current value pair is not replaced and remains unchanged. If the value pair is replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters

  numericValue | numeric value to be set (VR=DS, mandatory)
  measurementUnit | measurement unit to be set (mandatory)
  check | if enabled, check values for validity before setting them. See checkXXX() methods for details.

Returns
  status, EC_Normal if successful, an error code otherwise

References setValue().

Referenced by CMR_SRNumericMeasurementValueWithUnits(), CMR_SRNumericMeasurementValueWithUnits(), and setValue().

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

- dcmsr/include/dcmtk/dcmsr/cmr/srnumvlu.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.16.1