DCMTK  Version 3.6.3
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
DSRCompositeReferenceValue Class Reference

Class for composite reference values. More...

+ Inheritance diagram for DSRCompositeReferenceValue:

Public Member Functions

 DSRCompositeReferenceValue ()
 default constructor
 
 DSRCompositeReferenceValue (const OFString &sopClassUID, const OFString &sopInstanceUID, const OFBool check=OFTrue)
 constructor More...
 
 DSRCompositeReferenceValue (const DSRCompositeReferenceValue &referenceValue)
 copy constructor More...
 
virtual ~DSRCompositeReferenceValue ()
 destructor
 
DSRCompositeReferenceValueoperator= (const DSRCompositeReferenceValue &referenceValue)
 assignment operator More...
 
OFBool operator== (const DSRCompositeReferenceValue &referenceValue) const
 comparison operator "equal" More...
 
OFBool operator!= (const DSRCompositeReferenceValue &referenceValue) const
 comparison operator "not equal" More...
 
virtual void clear ()
 clear all internal variables. More...
 
virtual OFBool isValid () const
 check whether the current reference value is valid. More...
 
virtual OFBool isEmpty () const
 check whether the current reference value is empty. More...
 
virtual OFBool isComplete () const
 check whether the current reference value is complete, i.e. whether both mandatory UIDs are non-empty. More...
 
virtual OFCondition print (STD_NAMESPACE ostream &stream, const size_t flags) const
 print reference value. More...
 
virtual OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read reference value from XML document More...
 
virtual OFCondition writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const
 write reference value in XML format More...
 
virtual OFCondition readSequence (DcmItem &dataset, const DcmTagKey &tagKey, const OFString &type, const size_t flags)
 read referenced SOP sequence from dataset. More...
 
virtual OFCondition writeSequence (DcmItem &dataset, const DcmTagKey &tagKey) const
 write referenced SOP sequence to dataset. More...
 
virtual OFCondition renderHTML (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, size_t &annexNumber, const size_t flags) const
 render composite reference value in HTML/XHTML format More...
 
const OFStringgetSOPClassUID () const
 get SOP class UID More...
 
const OFString getSOPClassName (const OFString &defaultName="unknown SOP Class UID") const
 get name associated with the SOP class UID (if any) More...
 
const OFStringgetSOPInstanceUID () const
 get SOP instance UID More...
 
const DSRCompositeReferenceValuegetValue () const
 get reference to composite reference value More...
 
OFCondition getValue (DSRCompositeReferenceValue &referenceValue) const
 get copy of composite reference value More...
 
OFCondition setValue (const DSRCompositeReferenceValue &referenceValue, const OFBool check=OFTrue)
 set composite reference value. More...
 
OFCondition setReference (const OFString &sopClassUID, const OFString &sopInstanceUID, const OFBool check=OFTrue)
 set SOP class UID and SOP instance UID value. More...
 
OFCondition setReference (DcmItem &dataset, const OFBool check=OFTrue)
 set SOP class UID and SOP instance UID value from dataset. More...
 
OFCondition setSOPClassUID (const OFString &sopClassUID, const OFBool check=OFTrue)
 set SOP class UID value. More...
 
OFCondition setSOPClassUID (const DcmElement &delem, const unsigned long pos=0, const OFBool check=OFTrue)
 set SOP class UID value from element. More...
 
OFCondition setSOPClassUID (DcmItem &dataset, const DcmTagKey &tagKey, const unsigned long pos=0, const OFBool check=OFTrue)
 set SOP class UID value from dataset. More...
 
OFCondition setSOPInstanceUID (const OFString &sopInstanceUID, const OFBool check=OFTrue)
 set SOP instance UID value. More...
 
OFCondition setSOPInstanceUID (const DcmElement &delem, const unsigned long pos=0, const OFBool check=OFTrue)
 set SOP instance UID value from element. More...
 
OFCondition setSOPInstanceUID (DcmItem &dataset, const DcmTagKey &tagKey, const unsigned long pos=0, const OFBool check=OFTrue)
 set SOP instance UID value from dataset. More...
 

Protected Member Functions

DSRCompositeReferenceValuegetValuePtr ()
 get pointer to reference value More...
 
virtual OFCondition readItem (DcmItem &dataset, const size_t flags)
 read reference value from dataset More...
 
virtual OFCondition writeItem (DcmItem &dataset) const
 write reference value to dataset More...
 
virtual OFCondition checkSOPClassUID (const OFString &sopClassUID) const
 check the specified SOP class UID for validity. More...
 
virtual OFCondition checkSOPInstanceUID (const OFString &sopInstanceUID) const
 check the specified SOP instance UID for validity. More...
 
OFCondition checkCurrentValue () const
 check the currently stored reference value for validity. More...
 

Protected Attributes

OFString SOPClassUID
 reference SOP class UID (VR=UI, type 1)
 
OFString SOPInstanceUID
 reference SOP instance UID (VR=UI, type 1)
 

Friends

class DSRContentItem
 

Detailed Description

Class for composite reference values.

Constructor & Destructor Documentation

◆ DSRCompositeReferenceValue() [1/2]

DSRCompositeReferenceValue::DSRCompositeReferenceValue ( const OFString sopClassUID,
const OFString sopInstanceUID,
const OFBool  check = OFTrue 
)

constructor

Parameters
sopClassUIDreferenced SOP class UID of the composite object. (VR=UI, mandatory)
sopInstanceUIDreferenced SOP instance UID of the composite object. (VR=UI, mandatory)
checkif enabled, check 'sopClassUID' and 'sopInstanceUID' for validity before setting them. See checkXXX() for details. Empty values are never accepted.

◆ DSRCompositeReferenceValue() [2/2]

DSRCompositeReferenceValue::DSRCompositeReferenceValue ( const DSRCompositeReferenceValue referenceValue)

copy constructor

Parameters
referenceValuereference value to be copied (not checked !)

Member Function Documentation

◆ checkCurrentValue()

OFCondition DSRCompositeReferenceValue::checkCurrentValue ( ) const
protected

check the currently stored reference value for validity.

See above checkXXX() methods for details.

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

◆ checkSOPClassUID()

virtual OFCondition DSRCompositeReferenceValue::checkSOPClassUID ( const OFString sopClassUID) const
protectedvirtual

check the specified SOP class UID for validity.

The only checks performed are that the UID is non-empty and that it conforms to the corresponding VR (UI) and VM (1). Derived classes should overwrite this method for more specific tests (e.g. allowing only particular SOP classes).

Parameters
sopClassUIDSOP class UID to be checked
Returns
status, EC_Normal if value is valid, an error code otherwise

Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.

◆ checkSOPInstanceUID()

virtual OFCondition DSRCompositeReferenceValue::checkSOPInstanceUID ( const OFString sopInstanceUID) const
protectedvirtual

check the specified SOP instance UID for validity.

The only checks performed are that the UID is non-empty and that it conforms to the corresponding VR (UI) and VM (1). Derived classes should overwrite this method for more specific tests.

Parameters
sopInstanceUIDSOP instance UID to be checked
Returns
status, EC_Normal if value is valid, an error code otherwise

◆ clear()

virtual void DSRCompositeReferenceValue::clear ( )
virtual

clear all internal variables.

Since an empty reference value is invalid the reference becomes invalid afterwards.

Reimplemented in DSRImageReferenceValue, DSRWaveformReferenceValue, DSRCompositeTreeNode, DSRImageTreeNode, and DSRWaveformTreeNode.

◆ getSOPClassName()

const OFString DSRCompositeReferenceValue::getSOPClassName ( const OFString defaultName = "unknown SOP Class UID") const

get name associated with the SOP class UID (if any)

Parameters
defaultNamestring value that is returned if the SOP class UID is unknown
Returns
name associated with the current SOP class UID (might be empty, e.g. in case the SOP class UID is empty or 'defaultName' is an empty string)

◆ getSOPClassUID()

const OFString& DSRCompositeReferenceValue::getSOPClassUID ( ) const
inline

get SOP class UID

Returns
current SOP class UID (might be invalid or an empty string)

◆ getSOPInstanceUID()

const OFString& DSRCompositeReferenceValue::getSOPInstanceUID ( ) const
inline

get SOP instance UID

Returns
current SOP instance UID (might be invalid or an empty string)

◆ getValue() [1/2]

const DSRCompositeReferenceValue& DSRCompositeReferenceValue::getValue ( ) const
inline

get reference to composite reference value

Returns
reference to composite reference value

◆ getValue() [2/2]

OFCondition DSRCompositeReferenceValue::getValue ( DSRCompositeReferenceValue referenceValue) const

get copy of composite reference value

Parameters
referenceValuereference to variable in which the value should be stored
Returns
status, EC_Normal if successful, an error code otherwise

◆ getValuePtr()

DSRCompositeReferenceValue* DSRCompositeReferenceValue::getValuePtr ( )
inlineprotected

get pointer to reference value

Returns
pointer to reference value (never NULL)

◆ isComplete()

virtual OFBool DSRCompositeReferenceValue::isComplete ( ) const
virtual

check whether the current reference value is complete, i.e. whether both mandatory UIDs are non-empty.

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 reference value.

Returns
OFTrue if value is complete, OFFalse otherwise

◆ isEmpty()

virtual OFBool DSRCompositeReferenceValue::isEmpty ( ) const
virtual

check whether the current reference value is empty.

Checks whether both mandatory UIDs of the reference value are empty.

Returns
OFTrue if value is empty, OFFalse otherwise

◆ isValid()

virtual OFBool DSRCompositeReferenceValue::isValid ( ) const
virtual

check whether the current reference value is valid.

The reference value is valid if SOP class UID and SOP instance UID are valid. See checkSOPClassUID() and checkSOPInstanceUID() methods for details.

Returns
OFTrue if reference value is valid, OFFalse otherwise

Reimplemented in DSRImageReferenceValue, DSRCompositeTreeNode, DSRImageTreeNode, and DSRWaveformTreeNode.

◆ operator!=()

OFBool DSRCompositeReferenceValue::operator!= ( const DSRCompositeReferenceValue referenceValue) const

comparison operator "not equal"

Parameters
referenceValuereference value that should be compared to the current one
Returns
OFTrue if both composite reference values are not equal, OFFalse otherwise

◆ operator=()

DSRCompositeReferenceValue& DSRCompositeReferenceValue::operator= ( const DSRCompositeReferenceValue referenceValue)

assignment operator

Parameters
referenceValuereference value to be copied (not checked !)
Returns
reference to this reference value after 'referenceValue' has been copied

◆ operator==()

OFBool DSRCompositeReferenceValue::operator== ( const DSRCompositeReferenceValue referenceValue) const

comparison operator "equal"

Parameters
referenceValuereference value that should be compared to the current one
Returns
OFTrue if both composite reference values are equal, OFFalse otherwise

◆ print()

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

print reference value.

The output of a typical composite reference value looks like this: (BasicTextSR,"1.2.3"). If the SOP class UID is unknown, the UID is printed instead of the related name.

Parameters
streamoutput stream to which the reference value should be printed
flagsflag used to customize the output (see DSRTypes::PF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRImageReferenceValue, DSRImageTreeNode, DSRWaveformTreeNode, DSRWaveformReferenceValue, and DSRCompositeTreeNode.

◆ readItem()

virtual OFCondition DSRCompositeReferenceValue::readItem ( DcmItem dataset,
const size_t  flags 
)
protectedvirtual

read reference value from dataset

Parameters
datasetDICOM dataset from which the value should be read
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.

◆ readSequence()

virtual OFCondition DSRCompositeReferenceValue::readSequence ( DcmItem dataset,
const DcmTagKey tagKey,
const OFString type,
const size_t  flags 
)
virtual

read referenced SOP sequence from dataset.

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

Parameters
datasetDICOM dataset from which the sequence should be read
tagKeyDICOM tag specifying the attribute (= sequence) that should be read
typevalue type of the sequence (valid value: "1", "2", something else) This parameter is used for checking purpose, any difference is reported.
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

◆ readXML()

virtual OFCondition DSRCompositeReferenceValue::readXML ( const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags 
)
virtual

read reference value from XML document

Parameters
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsflag used to customize the reading process (see DSRTypes::XF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.

◆ renderHTML()

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

render composite reference value in HTML/XHTML format

Parameters
docStreamoutput stream to which the main HTML/XHTML document is written
annexStreamoutput stream to which the HTML/XHTML document annex is written
annexNumberreference to the variable where the current annex number is stored. Value is increased automatically by 1 after a new entry has been added.
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.

◆ setReference() [1/2]

OFCondition DSRCompositeReferenceValue::setReference ( const OFString sopClassUID,
const OFString sopInstanceUID,
const OFBool  check = OFTrue 
)

set SOP class UID and SOP instance UID value.

Before setting the values, they are usually checked. If the value pair is invalid the current value pair is not replaced and remains unchanged.

Parameters
sopClassUIDreferenced SOP class UID to be set. (VR=UI, mandatory)
sopInstanceUIDreferenced SOP instance UID to be set. (VR=UI, mandatory)
checkif enabled, check 'sopClassUID' and 'sopInstanceUID' for validity before setting them. See checkXXX() for details. Empty values are never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setReference() [2/2]

OFCondition DSRCompositeReferenceValue::setReference ( DcmItem dataset,
const OFBool  check = OFTrue 
)

set SOP class UID and SOP instance UID value from dataset.

Internally, the methods setSOPClassUID() and setSOPInstanceUID() are called with the given 'dataset' and the tags DCM_SOPClassUID and DCM_SOPInstanceUID, respectively. I.e., the SOP class UID might be set even if the SOP instance UID value is invalid.

Parameters
datasetDICOM dataset from which the UID values should be retrieved
checkif enabled, check retrieved UID values for validity before setting them. See checkXXX() for details. Empty values are never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setSOPClassUID() [1/3]

OFCondition DSRCompositeReferenceValue::setSOPClassUID ( const OFString sopClassUID,
const OFBool  check = OFTrue 
)

set SOP class UID value.

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

Parameters
sopClassUIDSOP class UID to be set
checkif enabled, check 'sopClassUID' for validity before setting it. See checkSOPClassUID() for details. Am empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setSOPClassUID() [2/3]

OFCondition DSRCompositeReferenceValue::setSOPClassUID ( const DcmElement delem,
const unsigned long  pos = 0,
const OFBool  check = OFTrue 
)

set SOP class UID 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.

Parameters
delemDICOM element from which the UID value should be retrieved
posindex of the value in case of multi-valued elements (0..vm-1)
checkif enabled, check UID value for validity before setting it. See checkSOPClassUID() for details. An empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setSOPClassUID() [3/3]

OFCondition DSRCompositeReferenceValue::setSOPClassUID ( DcmItem dataset,
const DcmTagKey tagKey,
const unsigned long  pos = 0,
const OFBool  check = OFTrue 
)

set SOP class UID 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.

Parameters
datasetDICOM dataset from which the UID value should be retrieved
tagKeyDICOM tag specifying the attribute from which the value should be retrieved. The search is limited to the top-level of the dataset.
posindex of the value in case of multi-valued elements (0..vm-1)
checkif enabled, check UID value for validity before setting it. See checkSOPClassUID() for details. An empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setSOPInstanceUID() [1/3]

OFCondition DSRCompositeReferenceValue::setSOPInstanceUID ( const OFString sopInstanceUID,
const OFBool  check = OFTrue 
)

set SOP instance UID value.

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

Parameters
sopInstanceUIDSOP instance UID to be set
checkif enabled, check 'sopInstanceUID' for validity before setting it. See checkSOPInstanceUID() for details. An empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setSOPInstanceUID() [2/3]

OFCondition DSRCompositeReferenceValue::setSOPInstanceUID ( const DcmElement delem,
const unsigned long  pos = 0,
const OFBool  check = OFTrue 
)

set SOP instance UID 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.

Parameters
delemDICOM element from which the UID value should be retrieved
posindex of the value in case of multi-valued elements (0..vm-1)
checkif enabled, check UID value for validity before setting it. See checkSOPInstanceUID() for details. An empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setSOPInstanceUID() [3/3]

OFCondition DSRCompositeReferenceValue::setSOPInstanceUID ( DcmItem dataset,
const DcmTagKey tagKey,
const unsigned long  pos = 0,
const OFBool  check = OFTrue 
)

set SOP instance UID 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.

Parameters
datasetDICOM dataset from which the UID value should be retrieved
tagKeyDICOM tag specifying the attribute from which the value should be retrieved. The search is limited to the top-level of the dataset.
posindex of the value in case of multi-valued elements (0..vm-1)
checkif enabled, check UID value for validity before setting it. See checkSOPInstanceUID() for details. An empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setValue()

OFCondition DSRCompositeReferenceValue::setValue ( const DSRCompositeReferenceValue referenceValue,
const OFBool  check = OFTrue 
)

set composite reference value.

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

Parameters
referenceValuevalue to be set
checkif enabled, check value for validity before setting it. See checkXXX() for details. Empty values are never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ writeItem()

virtual OFCondition DSRCompositeReferenceValue::writeItem ( DcmItem dataset) const
protectedvirtual

write reference value to dataset

Parameters
datasetDICOM dataset to which the value should be written
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.

◆ writeSequence()

virtual OFCondition DSRCompositeReferenceValue::writeSequence ( DcmItem dataset,
const DcmTagKey tagKey 
) const
virtual

write referenced SOP sequence to dataset.

If the value is empty an empty sequence (without any items) is written.

Parameters
datasetDICOM dataset to which the sequence should be written
tagKeyDICOM tag specifying the attribute (= sequence) that should be written
Returns
status, EC_Normal if successful, an error code otherwise

◆ writeXML()

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

write reference value in XML format

Parameters
streamoutput stream to which the XML document is written
flagsflag used to customize the output (see DSRTypes::XF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRImageReferenceValue, DSRWaveformReferenceValue, DSRImageTreeNode, DSRWaveformTreeNode, and DSRCompositeTreeNode.


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


Generated on Mon Feb 5 2018 for DCMTK Version 3.6.3 by Doxygen 1.8.14