DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Static Public Member Functions
DRTTypes Class Reference

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

+ Inheritance diagram for DRTTypes:

List of all members.

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 multipicity 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 multipicity 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 multipicity 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

virtual DRTTypes::~DRTTypes ( ) [virtual]

destructor.

(only needed to avoid compiler warnings)


Member Function Documentation

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
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 multipicity 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
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 multipicity 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
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 multipicity 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
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
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
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
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 Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027