Loading...
Searching...
No Matches
DRTTypes Class Reference

General purpose class hiding global functions, constants and types from the global namespace. More...

Inheritance diagram for DRTTypes:

## Public Member Functions

virtual | ~DRTTypes ()
| destructor.

## Static Public Member Functions

static OFCondition | addElementToDataset (OFCondition &result, DcmItem &dataset, DcmElement *element, const OFString &vm, const OFString &type, const char *moduleName=NULL)
| add given element to the dataset.
static OFCondition | getElementFromDataset (DcmItem &dataset, DcmElement &element)
| get element from dataset
static OFCondition | getStringValueFromElement (const DcmElement &element, OFString &stringValue, const signed long pos=0)
| get string value from element
static OFCondition | getStringValueFromDataset (DcmItem &dataset, const DcmTagKey &tagKey, OFString &stringValue)
| get string value from dataset
static OFCondition | putStringValueToDataset (DcmItem &dataset, const DcmTag &tag, const OFString &stringValue, const OFBool allowEmpty=OFTrue)
| put string value to dataset
static OFBool | checkElementValue (DcmElement &element, const OFString &vm, const OFString &type, const OFCondition &searchCond=EC_Normal, const char *moduleName=NULL)
| check element value for correct value multiplicity and type
static OFCondition | getAndCheckElementFromDataset (DcmItem &dataset, DcmElement &element, const OFString &vm, const OFString &type, const char *moduleName=NULL)
| get element from dataset and check it for correct value multiplicity and type.
static OFCondition | getAndCheckStringValueFromDataset (DcmItem &dataset, const DcmTagKey &tagKey, OFString &stringValue, const OFString &vm, const OFString &type, const char *moduleName=NULL)
| get string value from dataset and check it for correct value multiplicity and type.

## Detailed Description

General purpose class hiding global functions, constants and types from the global namespace.

Some of them might be moved to 'ofstd' or 'dcmdata' later on. All functions and constants are static and can, therefore, be accessed without creating an instance of this class.

## Constructor & Destructor Documentation

## ~DRTTypes()

virtual DRTTypes::~DRTTypes | ( |  | ) |

virtual

destructor.

(only needed to avoid compiler warnings)

## Member Function Documentation

## addElementToDataset()

OFCondition DRTTypes::addElementToDataset | ( | OFCondition & | result,
|  | DcmItem & | dataset,
|  | DcmElement * | element,
|  | const OFString & | vm,
|  | const OFString & | type,
|  | const char * | moduleName = NULL )

static

add given element to the dataset.

The element is only added if 'result' is EC_Normal and the 'element' pointer is not NULL.

Parameters

  result | reference to status variable (checked before adding and updated afterwards!)
  dataset | reference to DICOM dataset to which the element should be added
  element | pointer to DICOM element which should be added. deleted if not inserted.
  vm | value multiplicity (according to the data dictionary) to be checked for. (See DcmElement::checkVM() for a list of valid values.) Interpreted as cardinality (number of items) for sequence attributes.
  type | value type (valid value: "1", "2" or something else which is not checked)
  moduleName | optional module name to be printed (default: "RT object" if NULL)

Returns
  current value of 'result', EC_Normal if successful, an error code otherwise

## checkElementValue()

OFBool DRTTypes::checkElementValue | ( | DcmElement & | element,
|  | const OFString & | vm,
|  | const OFString & | type,
|  | const OFCondition & | searchCond = EC_Normal,
|  | const char * | moduleName = NULL )

static

check element value for correct value multiplicity and type

Parameters

  element | DICOM element to be checked
  vm | value multiplicity (according to the data dictionary) to be checked for. (See DcmElement::checkVM() for a list of valid values.) Interpreted as cardinality (number of items) for sequence attributes.
  type | value type (valid value: "1", "1C", "2" or something else which is not checked)
  searchCond | optional flag indicating the status of a previous 'search' function call
  moduleName | optional module name to be printed (default: "RT object" if NULL)

Returns
  OFTrue if element value is correct, OFFalse otherwise

References EC_Normal.

## getAndCheckElementFromDataset()

OFCondition DRTTypes::getAndCheckElementFromDataset | ( | DcmItem & | dataset,
|  | DcmElement & | element,
|  | const OFString & | vm,
|  | const OFString & | type,
|  | const char * | moduleName = NULL )

static

get element from dataset and check it for correct value multiplicity and type.

This functions calls the above one to check the element value.

Parameters

  dataset | reference to DICOM dataset from which the element should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
  element | DICOM element used to store the value
  vm | value multiplicity (according to the data dictionary) to be checked for. (See DcmElement::checkVM() for a list of valid values.) Interpreted as cardinality (number of items) for sequence attributes.
  type | value type (valid value: "1", "1C", "2" or something else which is not checked)
  moduleName | optional module name to be printed (default: "RT object" if NULL)

Returns
  status, EC_Normal if element could be retrieved and value is correct, an error code otherwise

## getAndCheckStringValueFromDataset()

OFCondition DRTTypes::getAndCheckStringValueFromDataset | ( | DcmItem & | dataset,
|  | const DcmTagKey & | tagKey,
|  | OFString & | stringValue,
|  | const OFString & | vm,
|  | const OFString & | type,
|  | const char * | moduleName = NULL )

static

get string value from dataset and check it for correct value multiplicity and type.

This functions calls the above one to check the element value.

Parameters

  dataset | reference to DICOM dataset from which the element should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
  tagKey | DICOM tag specifying the attribute from which the string should be retrieved
  stringValue | reference to character string in which the result should be stored. (This parameter is automatically cleared if the tag could not be found.)
  vm | value multiplicity (according to the data dictionary) to be checked for. (See DcmElement::checkVM() for a list of valid values.) Interpreted as cardinality (number of items) for sequence attributes.
  type | value type (valid value: "1", "1C", "2" or something else which is not checked)
  moduleName | optional module name to be printed (default: "RT object" if NULL)

Returns
  status, EC_Normal if element could be retrieved and value is correct, an error code otherwise

## getElementFromDataset()

OFCondition DRTTypes::getElementFromDataset | ( | DcmItem & | dataset,
|  | DcmElement & | element )

static

get element from dataset

Parameters

  dataset | reference to DICOM dataset from which the element should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
  element | reference to DICOM element which should be retrieved. The return value is also stored in this parameter.

Returns
  status, EC_Normal if successful, an error code otherwise

## getStringValueFromDataset()

OFCondition DRTTypes::getStringValueFromDataset | ( | DcmItem & | dataset,
|  | const DcmTagKey & | tagKey,
|  | OFString & | stringValue )

static

get string value from dataset

Parameters

  dataset | reference to DICOM dataset from which the string should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
  tagKey | DICOM tag specifying the attribute from which the string should be retrieved
  stringValue | reference to character string in which the result should be stored. (This parameter is automatically cleared if the tag could not be found.)

Returns
  status, EC_Normal if successful, an error code otherwise

## getStringValueFromElement()

OFCondition DRTTypes::getStringValueFromElement | ( | const DcmElement & | element,
|  | OFString & | stringValue,
|  | const signed long | pos = 0 )

static

get string value from element

Parameters

  element | reference to DICOM element from which the string value should be retrieved
  stringValue | reference to character string where the result should be stored
  pos | index of the value to get (0..vm-1), -1 for all components

Returns
  reference character string if successful, empty string otherwise

## putStringValueToDataset()

OFCondition DRTTypes::putStringValueToDataset | ( | DcmItem & | dataset,
|  | const DcmTag & | tag,
|  | const OFString & | stringValue,
|  | const OFBool | allowEmpty = OFTrue )

static

put string value to dataset

Parameters

  dataset | reference to DICOM dataset to which the string should be put.
  tag | DICOM tag specifying the attribute to which the string should be put
  stringValue | character string specifying the value to be set
  allowEmpty | allow empty element to be inserted if OFTrue. Do not insert empty element otherwise.

Returns
  status, EC_Normal if successful, an error code otherwise

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

- dcmrt/include/dcmtk/dcmrt/drttypes.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0