Loading...
Searching...
No Matches
DSRNumericMeasurementValue Class Reference

Class for numeric values and measurements. More...

Inheritance diagram for DSRNumericMeasurementValue:

## Public Member Functions

| 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

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 | checkMeasurementUnit (const DSRCodedEntryValue &measurementUnit) const
| check the specified measurement unit for validity.
virtual OFCondition | checkNumericValueQualifier (const DSRCodedEntryValue &valueQualifier) const
| check the specified numeric value qualifier 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.

## Private Attributes

OFString | NumericValue
| Numeric Value (VR=DS, type 1 within a type 2 sequence).
DSRCodedEntryValue | MeasurementUnit
| Measurement Unit (type 1 within a type 2 sequence).
DSRCodedEntryValue | ValueQualifier
| Numeric Value Qualifier (type 1C).
DcmFloatingPointDouble | FloatingPointValue
| Floating Point Value (VR=FD, type 1C).
DcmSignedLong | RationalNumeratorValue
| Rational Numerator Value (VR=SL, type 1C).
DcmUnsignedLong | RationalDenominatorValue
| Rational Denominator Value (VR=UL, type 1C).

## Friends

class | DSRContentItem

## Detailed Description

Class for numeric values and measurements.

## Constructor & Destructor Documentation

## DSRNumericMeasurementValue() [1/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue | ( | const OFString & | numericValue,
|  | const DSRCodedEntryValue & | 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.

## DSRNumericMeasurementValue() [2/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue | ( | const DSRCodedEntryValue & | 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.

## DSRNumericMeasurementValue() [3/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue | ( | const OFString & | numericValue,
|  | const DSRCodedEntryValue & | measurementUnit,
|  | const DSRCodedEntryValue & | 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.

## DSRNumericMeasurementValue() [4/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue | ( | const DSRNumericMeasurementValue & | numericMeasurement | ) |

copy constructor

Parameters

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

References DSRNumericMeasurementValue().

## Member Function Documentation

## checkCurrentValue()

virtual OFCondition DSRNumericMeasurementValue::checkCurrentValue | ( |  | ) | const

protected virtual

check the currently stored numeric measurement value for validity.

See above checkXXX() methods for details.

Returns
  status, EC_Normal if current value is valid, an error code otherwise

## checkMeasurementUnit()

virtual OFCondition DSRNumericMeasurementValue::checkMeasurementUnit | ( | const DSRCodedEntryValue & | measurementUnit | ) | const

protected virtual

check the specified measurement unit for validity.

Internally, the methods DSRCodedEntryValue::isEmpty() and DSRCodedEntryValue::checkCurrentValue() are used for this purpose. Conformance with the Context Group 82 (as defined in the DICOM standard) is not yet checked.

Parameters

  measurementUnit | measurement unit to be checked

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

Reimplemented in CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >.

Referenced by CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::checkMeasurementUnit().

## checkNumericValue()

virtual OFCondition DSRNumericMeasurementValue::checkNumericValue | ( | const OFString & | numericValue | ) | const

protected virtual

check the specified numeric value for validity.

Currently, the only checks performed are that the string is non-empty and that the given value conforms to the corresponding VR (DS) and VM (1).

Parameters

  numericValue | numeric value to be checked

Returns
  status, EC_Normal if numeric value is valid, an error code otherwise

Referenced by CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setValue().

## checkNumericValueQualifier()

virtual OFCondition DSRNumericMeasurementValue::checkNumericValueQualifier | ( | const DSRCodedEntryValue & | valueQualifier | ) | const

protected virtual

check the specified numeric value qualifier for validity.

Internally, DSRCodedEntryValue::isEmpty() and DSRCodedEntryValue::checkCurrentValue() are used for this purpose. Conformance with the Context Group 42 (as defined in the DICOM standard) is not checked; see class CMR_SRNumericMeasurementValue if needed, which supports such additional checks.

Parameters

  valueQualifier | numeric value qualifier to be checked

Returns
  status, EC_Normal if value qualifier is valid, an error code otherwise

Reimplemented in CMR_SRNumericMeasurementValue.

## checkRationalRepresentation()

virtual OFCondition DSRNumericMeasurementValue::checkRationalRepresentation | ( | const Sint32 | rationalNumerator,
|  | const Uint32 | rationalDenominator ) const

protected virtual

check the specified rational representation for validity.

The only check that is performed is that the 'rationalDenominator' is not zero, i.e. it is not checked whether this representation is consistent with the numeric value stored as a string.

Parameters

  rationalNumerator | numerator of the rational representation to be checked
  rationalDenominator | denominator of a rational representation to be checked

Returns
  status, EC_Normal if rational representation is valid, an error code otherwise

## clear()

virtual void DSRNumericMeasurementValue::clear | ( |  | ) |

virtual

clear all internal variables.

Use this method to create an empty numeric measurement value.

Reimplemented in DSRNumTreeNode.

## getFloatingPointRepresentation()

OFCondition DSRNumericMeasurementValue::getFloatingPointRepresentation | ( | Float64 & | floatingPoint | ) | const

get floating point representation of the numeric value (optional)

Parameters

  floatingPoint | reference to variable in which the floating point representation should be stored

Returns
  status, EC_Normal if successful, an error code otherwise. Returns SR_EC_RepresentationNotAvailable if floating point representation is not available.

## getMeasurementUnit() [1/2]

const DSRCodedEntryValue & DSRNumericMeasurementValue::getMeasurementUnit | ( |  | ) | const

inline

get measurement unit

Returns
  reference to current measurement unit code (might be invalid or empty)

References MeasurementUnit.

## getMeasurementUnit() [2/2]

OFCondition DSRNumericMeasurementValue::getMeasurementUnit | ( | DSRCodedEntryValue & | measurementUnit | ) | const

get copy of measurement unit

Parameters

  measurementUnit | reference to variable in which the code should be stored

Returns
  always returns EC_Normal

## getNumericValue()

const OFString & DSRNumericMeasurementValue::getNumericValue | ( |  | ) | const

inline

get numeric value

Returns
  current numeric value (might be invalid or an empty string)

References NumericValue.

## getNumericValueQualifier() [1/2]

const DSRCodedEntryValue & DSRNumericMeasurementValue::getNumericValueQualifier | ( |  | ) | const

inline

get numeric value qualifier (conditional)

Returns
  reference to current numeric value qualifier code (might be invalid or empty)

References ValueQualifier.

## getNumericValueQualifier() [2/2]

OFCondition DSRNumericMeasurementValue::getNumericValueQualifier | ( | DSRCodedEntryValue & | valueQualifier | ) | const

get copy of numeric value qualifier (conditional)

Parameters

  valueQualifier | reference to variable in which the code should be stored

Returns
  always returns EC_Normal

## getRationalRepresentation()

OFCondition DSRNumericMeasurementValue::getRationalRepresentation | ( | Sint32 & | rationalNumerator,
|  | Uint32 & | rationalDenominator ) const

get rational representation of the numeric value (optional)

Parameters

  rationalNumerator | reference to variable in which the integer numerator of the rational representation should be stored
  rationalDenominator | reference to variable in which the integer denominator of the rational representation should be stored

Returns
  status, EC_Normal if successful, an error code otherwise. Returns SR_EC_RepresentationNotAvailable if rational representation is not available.

## getValue() [1/2]

const DSRNumericMeasurementValue & DSRNumericMeasurementValue::getValue | ( |  | ) | const

inline

get reference to numeric measurement value

Returns
  reference to numeric measurement value

References DSRNumericMeasurementValue().

## getValue() [2/2]

OFCondition DSRNumericMeasurementValue::getValue | ( | DSRNumericMeasurementValue & | numericMeasurement | ) | const

get copy of numeric measurement value

Parameters

  numericMeasurement | reference to variable in which the value should be stored

Returns
  always returns EC_Normal

References DSRNumericMeasurementValue().

## getValuePtr()

DSRNumericMeasurementValue * DSRNumericMeasurementValue::getValuePtr | ( |  | ) |

inline protected

get pointer to numeric measurement value

Returns
  pointer to numeric measurement value (never NULL)

References DSRNumericMeasurementValue().

## isComplete()

virtual OFBool DSRNumericMeasurementValue::isComplete | ( |  | ) | const

virtual

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.

This is just a basic check that might be useful for "validating" input data. See isValid() for a more sophisticated way of checking the current numeric measurement value.

Returns
  OFTrue if value is complete, OFFalse otherwise

## isEmpty()

virtual OFBool DSRNumericMeasurementValue::isEmpty | ( |  | ) | const

virtual

check whether the current numeric measurement value is empty.

Checks whether both the numeric value and the measurement are empty. The optional value qualifier is not checked since it might contain the reason for the absence of the measured value sequence.

Returns
  OFTrue if value is empty, OFFalse otherwise

## isEqual()

OFBool DSRNumericMeasurementValue::isEqual | ( | const DSRNumericMeasurementValue & | numericMeasurement | ) | const

check whether values are "equal".

Two numeric measurement values are equal if the numeric value, the measurement unit and the value qualifier are equal. Other (additional) information is not used.

Parameters

  numericMeasurement | numeric measurement value that should be compared to the current one

Returns
  OFTrue if both numeric measurement values are equal, OFFalse otherwise

References DSRNumericMeasurementValue().

## isNotEqual()

OFBool DSRNumericMeasurementValue::isNotEqual | ( | const DSRNumericMeasurementValue & | numericMeasurement | ) | const

check whether values are "not equal".

Two numeric measurement values are not equal if either the numeric value or the measurement unit or the value qualifier are not equal. Other (additional) information is not used for comparison.

Parameters

  numericMeasurement | numeric measurement value that should be compared to the current one

Returns
  OFTrue if both numeric measurement values are not equal, OFFalse otherwise

References DSRNumericMeasurementValue().

## isValid()

virtual OFBool DSRNumericMeasurementValue::isValid | ( |  | ) | const

virtual

check whether the current numeric measurement value is valid.

The value is valid if isEmpty() is true or both the numeric value and the measurement unit contain a valid value, and the value qualifier is valid (see checkXXX() methods). The possibly available additional representations of the numeric value are never checked.

Returns
  OFTrue if value is valid, OFFalse otherwise

Reimplemented in DSRNumTreeNode.

## operator=()

DSRNumericMeasurementValue & DSRNumericMeasurementValue::operator= | ( | const DSRNumericMeasurementValue & | 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 DSRNumericMeasurementValue().

## print()

virtual OFCondition DSRNumericMeasurementValue::print | ( | STD_NAMESPACE ostream & | stream,
|  | const size_t | flags ) const

virtual

print numeric measurement value.

The output of a typical numeric measurement value looks like this: "3.5" (cm,UCUM[1.4],"centimeter"). If the value is empty, the text "empty" is printed instead, followed by the numeric value qualifier (if present). The possibly available additional floating point and rational representations of the numeric value are never printed.

Parameters

  stream | output stream to which the numeric measurement value should be printed
  flags | flag used to customize the output (not used)

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRNumTreeNode.

## readItem()

virtual OFCondition DSRNumericMeasurementValue::readItem | ( | DcmItem & | dataset,
|  | const size_t | flags )

protected virtual

read numeric measurement value from dataset

Parameters

  dataset | DICOM dataset from which the value should be read
  flags | flag used to customize the reading process (see DSRTypes::RF_xxx)

Returns
  status, EC_Normal if successful, an error code otherwise

## readSequence()

virtual OFCondition DSRNumericMeasurementValue::readSequence | ( | DcmItem & | dataset,
|  | const size_t | flags )

virtual

read measured value sequence and numeric value qualifier code sequence from dataset.

The number of items within the sequences is checked. If error/warning output are enabled, a warning message is printed if a sequence is absent or contains more than one item.

Parameters

  dataset | DICOM dataset from which the sequences should be read
  flags | flag used to customize the reading process (see DSRTypes::RF_xxx)

Returns
  status, EC_Normal if successful, an error code otherwise

## readXML()

virtual OFCondition DSRNumericMeasurementValue::readXML | ( | const DSRXMLDocument & | doc,
|  | DSRXMLCursor | cursor,
|  | const size_t | flags )

virtual

read numeric measurement value from XML document

Parameters

  doc | document containing the XML file content
  cursor | cursor pointing to the starting node
  flags | flag used to customize the reading process (see DSRTypes::XF_xxx)

Returns
  status, EC_Normal if successful, an error code otherwise

## removeFloatingPointRepresentation()

void DSRNumericMeasurementValue::removeFloatingPointRepresentation | ( |  | ) |

remove floating point representation of the numeric value (if any).

Internally, all elements that belong to this representation are cleared.

## removeRationalRepresentation()

void DSRNumericMeasurementValue::removeRationalRepresentation | ( |  | ) |

remove rational representation of the numeric value (if any).

Internally, all elements that belong to this representation are cleared.

## renderHTML()

virtual OFCondition DSRNumericMeasurementValue::renderHTML | ( | STD_NAMESPACE ostream & | docStream,
|  | STD_NAMESPACE ostream & | annexStream,
|  | size_t & | annexNumber,
|  | const size_t | flags ) const

virtual

render numeric measurement value in HTML/XHTML format

Parameters

  docStream | output stream to which the main HTML/XHTML document is written
  annexStream | output stream to which the HTML/XHTML 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)

Returns
  status, EC_Normal if successful, an error code otherwise

## setFloatingPointRepresentation()

OFCondition DSRNumericMeasurementValue::setFloatingPointRepresentation | ( | const Float64 | floatingPoint,
|  | const OFBool | check = OFTrue )

set floating point representation of the numeric value.

According to the DICOM standard, this value is "required if the numeric value has insufficient precision to represent the value as a string. May be present otherwise." Please note that it is not checked whether this representation is consistent with the numeric value stored as a string.

Parameters

  floatingPoint | floating point representation of the numeric value
  check | dummy parameter (currently not used)

Returns
  status, EC_Normal if successful, an error code otherwise

## setMeasurementUnit()

OFCondition DSRNumericMeasurementValue::setMeasurementUnit | ( | const DSRCodedEntryValue & | 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

Referenced by CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setMeasurementUnit().

## setNumericValue() [1/3]

OFCondition DSRNumericMeasurementValue::setNumericValue | ( | const DcmElement & | delem,
|  | const unsigned long | pos = 0,
|  | const OFBool | check = OFTrue )

set numeric value from element.

Before setting the value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged. If the value is replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters

  delem | DICOM element from which the numeric value should be retrieved
  pos | index of the value in case of multi-valued elements (0..vm-1)
  check | if enabled, check numeric value for validity before setting it. See checkNumericValue() method for details. An empty value is never accepted.

Returns
  status, EC_Normal if successful, an error code otherwise

## setNumericValue() [2/3]

OFCondition DSRNumericMeasurementValue::setNumericValue | ( | const OFString & | numericValue,
|  | const OFBool | check = OFTrue )

set numeric value.

Before setting the value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged. If the value 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)
  check | if enabled, check value for validity before setting it. See checkNumericValue() method for details. An empty value is never accepted, use the clear() method instead.

Returns
  status, EC_Normal if successful, an error code otherwise

## setNumericValue() [3/3]

OFCondition DSRNumericMeasurementValue::setNumericValue | ( | DcmItem & | dataset,
|  | const DcmTagKey & | tagKey,
|  | const unsigned long | pos = 0,
|  | const OFBool | check = OFTrue )

set numeric value from dataset.

Before setting the value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged. If the value is replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters

  dataset | DICOM dataset from which the numeric value should be retrieved
  tagKey | DICOM tag specifying the attribute from which the value should be retrieved. The search is limited to the top-level of the dataset.
  pos | index of the value in case of multi-valued elements (0..vm-1)
  check | if enabled, check numeric value for validity before setting it. See checkNumericValue() method for details. An empty value is never accepted.

Returns
  status, EC_Normal if successful, an error code otherwise

## setNumericValueQualifier()

OFCondition DSRNumericMeasurementValue::setNumericValueQualifier | ( | const DSRCodedEntryValue & | valueQualifier,
|  | const OFBool | check = OFTrue )

set numeric value qualifier.

This conditional code specifies the qualification of the Numeric Value in the Measured Value Sequence, or the reason for the absence of the Measured Value Sequence Item. Before setting the code, it is usually checked. If the code is invalid the current code is not replaced and remains unchanged.

Parameters

  valueQualifier | numeric value qualifier to be set (conditional). Use an empty code to remove the current value.
  check | if enabled, check value for validity before setting it. See checkNumericValueQualifier() method for details.

Returns
  status, EC_Normal if successful, an error code otherwise

Referenced by CMR_SRNumericMeasurementValue::setNumericValueQualifier().

## setRationalRepresentation()

OFCondition DSRNumericMeasurementValue::setRationalRepresentation | ( | const Sint32 | rationalNumerator,
|  | const Uint32 | rationalDenominator,
|  | const OFBool | check = OFTrue )

set rational representation of the numeric value.

According to the DICOM standard, this value is "required if the numeric value has insufficient precision to represent a rational value as a string. May be present otherwise." Please note that it is not checked whether this representation is consistent with the numeric value stored as a string.

Parameters

  rationalNumerator | integer numerator of a rational representation of the numeric value (encoded as a signed integer value)
  rationalDenominator | integer denominator of a rational representation of the numeric value (encoded as a non-zero unsigned integer value)
  check | if enabled, check values for validity before setting them. See checkRationalRepresentation() method for details.

Returns
  status, EC_Normal if successful, an error code otherwise

## setValue() [1/4]

OFCondition DSRNumericMeasurementValue::setValue | ( | const DSRCodedEntryValue & | valueQualifier,
|  | const OFBool | check = OFTrue )

set empty numeric value and measurement unit with a numeric value qualifier.

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

Parameters

  valueQualifier | numeric value qualifier to be set. Shall be 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 checkNumericValueQualifier() method for details.

Returns
  status, EC_Normal if successful, an error code otherwise

## setValue() [2/4]

OFCondition DSRNumericMeasurementValue::setValue | ( | const DSRNumericMeasurementValue & | numericMeasurement,
|  | const OFBool | check = OFTrue )

set numeric measurement value.

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

Parameters

  numericMeasurement | value to be set
  check | if enabled, check value for validity before setting it. See checkXXX() methods for details. Empty values are only accepted for non-mandatory attributes.

Returns
  status, EC_Normal if successful, an error code otherwise

References DSRNumericMeasurementValue().

Referenced by CMR_SRNumericMeasurementValue::setNumericValueQualifier().

## setValue() [3/4]

OFCondition DSRNumericMeasurementValue::setValue | ( | const OFString & | numericValue,
|  | const DSRCodedEntryValue & | measurementUnit,
|  | const DSRCodedEntryValue & | 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

## setValue() [4/4]

OFCondition DSRNumericMeasurementValue::setValue | ( | const OFString & | numericValue,
|  | const DSRCodedEntryValue & | 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

## writeItem()

virtual OFCondition DSRNumericMeasurementValue::writeItem | ( | DcmItem & | dataset | ) | const

protected virtual

write numeric measurement value to dataset

Parameters

  dataset | DICOM dataset to which the value should be written

Returns
  status, EC_Normal if successful, an error code otherwise

## writeSequence()

virtual OFCondition DSRNumericMeasurementValue::writeSequence | ( | DcmItem & | dataset | ) | const

virtual

write measured value sequence and numeric value qualifier code sequence to dataset.

The measured value sequence is always written (might be empty, though). The numeric value qualifier code sequence is conditional and, therefore, only written if non-empty.

Parameters

  dataset | DICOM dataset to which the sequences should be written

Returns
  status, EC_Normal if successful, an error code otherwise

## writeXML()

virtual OFCondition DSRNumericMeasurementValue::writeXML | ( | STD_NAMESPACE ostream & | stream,
|  | const size_t | flags ) const

virtual

write numeric measurement 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)

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRNumTreeNode.

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

- dcmsr/include/dcmtk/dcmsr/dsrnumvl.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0