DCMTK Version 3.6.7
OFFIS DICOM Toolkit
Public Member Functions | Static Public Member Functions | List of all members
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. More...
 

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. More...
 
static OFCondition getElementFromDataset (DcmItem &dataset, DcmElement &element)
 get element from dataset More...
 
static OFCondition getStringValueFromElement (const DcmElement &element, OFString &stringValue, const signed long pos=0)
 get string value from element More...
 
static OFCondition getStringValueFromDataset (DcmItem &dataset, const DcmTagKey &tagKey, OFString &stringValue)
 get string value from dataset More...
 
static OFCondition putStringValueToDataset (DcmItem &dataset, const DcmTag &tag, const OFString &stringValue, const OFBool allowEmpty=OFTrue)
 put string value to dataset More...
 
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 More...
 
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. More...
 
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. More...
 

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()

static 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
resultreference to status variable (checked before adding and updated afterwards!)
datasetreference to DICOM dataset to which the element should be added
elementpointer to DICOM element which should be added. deleted if not inserted.
vmvalue 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.
typevalue type (valid value: "1", "2" or something else which is not checked)
moduleNameoptional module name to be printed (default: "RT object" if NULL)
Returns
current value of 'result', EC_Normal if successful, an error code otherwise

◆ checkElementValue()

static 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
elementDICOM element to be checked
vmvalue 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.
typevalue type (valid value: "1", "1C", "2" or something else which is not checked)
searchCondoptional flag indicating the status of a previous 'search' function call
moduleNameoptional module name to be printed (default: "RT object" if NULL)
Returns
OFTrue if element value is correct, OFFalse otherwise

◆ getAndCheckElementFromDataset()

static 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
datasetreference to DICOM dataset from which the element should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
elementDICOM element used to store the value
vmvalue 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.
typevalue type (valid value: "1", "1C", "2" or something else which is not checked)
moduleNameoptional 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()

static 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
datasetreference to DICOM dataset from which the element should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
tagKeyDICOM tag specifying the attribute from which the string should be retrieved
stringValuereference to character string in which the result should be stored. (This parameter is automatically cleared if the tag could not be found.)
vmvalue 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.
typevalue type (valid value: "1", "1C", "2" or something else which is not checked)
moduleNameoptional 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()

static OFCondition DRTTypes::getElementFromDataset ( DcmItem dataset,
DcmElement element 
)
static

get element from dataset

Parameters
datasetreference to DICOM dataset from which the element should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
elementreference 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()

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

get string value from dataset

Parameters
datasetreference to DICOM dataset from which the string should be retrieved. (Would be 'const' if the methods from 'dcmdata' would also be 'const'.)
tagKeyDICOM tag specifying the attribute from which the string should be retrieved
stringValuereference 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()

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

get string value from element

Parameters
elementreference to DICOM element from which the string value should be retrieved
stringValuereference to character string where the result should be stored
posindex of the value to get (0..vm-1), -1 for all components
Returns
reference character string if successful, empty string otherwise

◆ putStringValueToDataset()

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

put string value to dataset

Parameters
datasetreference to DICOM dataset to which the string should be put.
tagDICOM tag specifying the attribute to which the string should be put
stringValuecharacter string specifying the value to be set
allowEmptyallow 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:


Generated on Fri Apr 19 2024 for DCMTK Version 3.6.7 by Doxygen 1.9.4