DCMTK
Version 3.6.6
OFFIS DICOM Toolkit
|
Class for composite reference values. More...
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 | |
DSRCompositeReferenceValue & | operator= (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 OFString & | getSOPClassUID () 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 OFString & | getSOPInstanceUID () const |
get SOP instance UID More... | |
const DSRCompositeReferenceValue & | getValue () 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 | |
DSRCompositeReferenceValue * | getValuePtr () |
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 |
Class for composite reference values.
DSRCompositeReferenceValue::DSRCompositeReferenceValue | ( | const OFString & | sopClassUID, |
const OFString & | sopInstanceUID, | ||
const OFBool | check = OFTrue |
||
) |
constructor
sopClassUID | referenced SOP class UID of the composite object. (VR=UI, mandatory) |
sopInstanceUID | referenced SOP instance UID of the composite object. (VR=UI, mandatory) |
check | if enabled, check 'sopClassUID' and 'sopInstanceUID' for validity before setting them. See checkXXX() for details. Empty values are never accepted. |
DSRCompositeReferenceValue::DSRCompositeReferenceValue | ( | const DSRCompositeReferenceValue & | referenceValue | ) |
copy constructor
referenceValue | reference value to be copied (not checked !) |
|
protected |
check the currently stored reference value for validity.
See above checkXXX() methods for details.
|
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).
sopClassUID | SOP class UID to be checked |
Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.
|
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.
sopInstanceUID | SOP instance UID to be checked |
|
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.
const OFString DSRCompositeReferenceValue::getSOPClassName | ( | const OFString & | defaultName = "unknown SOP Class UID" | ) | const |
get name associated with the SOP class UID (if any)
defaultName | string value that is returned if the SOP class UID is unknown |
|
inline |
get SOP class UID
|
inline |
get SOP instance UID
|
inline |
get reference to composite reference value
OFCondition DSRCompositeReferenceValue::getValue | ( | DSRCompositeReferenceValue & | referenceValue | ) | const |
get copy of composite reference value
referenceValue | reference to variable in which the value should be stored |
|
inlineprotected |
get pointer to reference value
|
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.
|
virtual |
check whether the current reference value is empty.
Checks whether both mandatory UIDs of the reference value are empty.
|
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.
Reimplemented in DSRImageReferenceValue, DSRCompositeTreeNode, DSRImageTreeNode, and DSRWaveformTreeNode.
OFBool DSRCompositeReferenceValue::operator!= | ( | const DSRCompositeReferenceValue & | referenceValue | ) | const |
comparison operator "not equal"
referenceValue | reference value that should be compared to the current one |
DSRCompositeReferenceValue& DSRCompositeReferenceValue::operator= | ( | const DSRCompositeReferenceValue & | referenceValue | ) |
assignment operator
referenceValue | reference value to be copied (not checked !) |
OFBool DSRCompositeReferenceValue::operator== | ( | const DSRCompositeReferenceValue & | referenceValue | ) | const |
comparison operator "equal"
referenceValue | reference value that should be compared to the current one |
|
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.
stream | output stream to which the reference value should be printed |
flags | flag used to customize the output (see DSRTypes::PF_xxx) |
Reimplemented in DSRImageReferenceValue, DSRImageTreeNode, DSRWaveformTreeNode, DSRWaveformReferenceValue, and DSRCompositeTreeNode.
|
protectedvirtual |
read reference value from dataset
dataset | DICOM dataset from which the value should be read |
flags | flag used to customize the reading process (see DSRTypes::RF_xxx) |
Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.
|
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.
dataset | DICOM dataset from which the sequence should be read |
tagKey | DICOM tag specifying the attribute (= sequence) that should be read |
type | value type of the sequence (valid value: "1", "2", something else) This parameter is used for checking purpose, any difference is reported. |
flags | flag used to customize the reading process (see DSRTypes::RF_xxx) |
|
virtual |
read reference value from XML document
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) |
Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.
|
virtual |
render composite reference value in HTML/XHTML format
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) |
Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.
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.
sopClassUID | referenced SOP class UID to be set. (VR=UI, mandatory) |
sopInstanceUID | referenced SOP instance UID to be set. (VR=UI, mandatory) |
check | if enabled, check 'sopClassUID' and 'sopInstanceUID' for validity before setting them. See checkXXX() for details. Empty values are never accepted. |
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.
dataset | DICOM dataset from which the UID values should be retrieved |
check | if enabled, check retrieved UID values for validity before setting them. See checkXXX() for details. Empty values are never accepted. |
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.
delem | DICOM element from which the UID value should be retrieved |
pos | index of the value in case of multi-valued elements (0..vm-1) |
check | if enabled, check UID value for validity before setting it. See checkSOPClassUID() for details. An empty value is never accepted. |
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.
sopClassUID | SOP class UID to be set |
check | if enabled, check 'sopClassUID' for validity before setting it. See checkSOPClassUID() for details. Am empty value is never accepted. |
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.
dataset | DICOM dataset from which the UID 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 UID value for validity before setting it. See checkSOPClassUID() for details. An empty value is never accepted. |
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.
delem | DICOM element from which the UID value should be retrieved |
pos | index of the value in case of multi-valued elements (0..vm-1) |
check | if enabled, check UID value for validity before setting it. See checkSOPInstanceUID() for details. An empty value is never accepted. |
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.
sopInstanceUID | SOP instance UID to be set |
check | if enabled, check 'sopInstanceUID' for validity before setting it. See checkSOPInstanceUID() for details. An empty value is never accepted. |
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.
dataset | DICOM dataset from which the UID 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 UID value for validity before setting it. See checkSOPInstanceUID() for details. An empty value is never accepted. |
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.
referenceValue | value to be set |
check | if enabled, check value for validity before setting it. See checkXXX() for details. Empty values are never accepted. |
|
protectedvirtual |
write reference value to dataset
dataset | DICOM dataset to which the value should be written |
Reimplemented in DSRImageReferenceValue, and DSRWaveformReferenceValue.
|
virtual |
write referenced SOP sequence to dataset.
If the value is empty an empty sequence (without any items) is written.
dataset | DICOM dataset to which the sequence should be written |
tagKey | DICOM tag specifying the attribute (= sequence) that should be written |
|
virtual |
write reference value in XML format
stream | output stream to which the XML document is written |
flags | flag used to customize the output (see DSRTypes::XF_xxx) |
Reimplemented in DSRImageReferenceValue, DSRWaveformReferenceValue, DSRImageTreeNode, DSRWaveformTreeNode, and DSRCompositeTreeNode.