DCMTK
Version 3.6.1 20121102
OFFIS DICOM Toolkit
|
Class for image reference values. More...
Public Member Functions | |
DSRImageReferenceValue () | |
default contructor | |
DSRImageReferenceValue (const OFString &sopClassUID, const OFString &sopInstanceUID, const OFBool check=OFTrue) | |
constructor More... | |
DSRImageReferenceValue (const OFString &imageSOPClassUID, const OFString &imageSOPInstanceUID, const OFString &pstateSOPClassUID, const OFString &pstateSOPInstanceUID, const OFBool check=OFTrue) | |
constructor More... | |
DSRImageReferenceValue (const DSRImageReferenceValue &referenceValue) | |
copy constructor More... | |
DSRImageReferenceValue (const DSRCompositeReferenceValue &imageReferenceValue, const DSRCompositeReferenceValue &pstateReferenceValue) | |
copy constructor More... | |
virtual | ~DSRImageReferenceValue () |
destructor | |
DSRImageReferenceValue & | operator= (const DSRImageReferenceValue &referenceValue) |
assignment operator More... | |
virtual void | clear () |
clear all internal variables. More... | |
virtual OFBool | isValid () const |
check whether the current image reference value is valid. More... | |
virtual OFBool | isShort (const size_t flags) const |
check whether the content is short. More... | |
virtual OFCondition | print (STD_NAMESPACE ostream &stream, const size_t flags) const |
print image reference. More... | |
virtual OFCondition | readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor) |
read image reference from XML document More... | |
virtual OFCondition | writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const |
write image reference in XML format More... | |
virtual OFCondition | renderHTML (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, size_t &annexNumber, const size_t flags) const |
render image reference value in HTML/XHTML format More... | |
OFCondition | createIconImage (const OFString &filename, const unsigned long frame=0, const unsigned long width=64, const unsigned long height=64) |
create an icon image from the given DICOM image and associate it with this image reference. More... | |
OFCondition | createIconImage (DcmObject *object, const E_TransferSyntax xfer=EXS_Unknown, const unsigned long frame=0, const unsigned long width=64, const unsigned long height=64) |
create an icon image from the given DICOM image and associate it with this image reference. More... | |
OFCondition | createIconImage (const DicomImage *image, const unsigned long width=64, const unsigned long height=64) |
create an icon image from the given DICOM image and associate it with this image reference. More... | |
void | deleteIconImage () |
delete the currently stored icon image, i.e. free the associated memory and "forget" the internal reference to it | |
const DicomImage * | getIconImage () const |
get reference to icon image associated with this image reference value (if any). More... | |
const DSRImageReferenceValue & | getValue () const |
get reference to image reference value More... | |
OFCondition | getValue (DSRImageReferenceValue &referenceValue) const |
get copy of image reference value More... | |
OFCondition | setValue (const DSRImageReferenceValue &referenceValue, const OFBool check=OFTrue) |
set image reference value. More... | |
const DSRCompositeReferenceValue & | getPresentationState () const |
get reference to presentation state value More... | |
OFCondition | setPresentationState (const DSRCompositeReferenceValue &pstateValue, const OFBool check=OFTrue) |
set presentation state value. More... | |
DSRImageFrameList & | getFrameList () |
get reference to list of referenced frame numbers More... | |
OFBool | appliesToFrame (const Sint32 frameNumber) const |
check whether the image reference applies to a specific frame. More... | |
![]() | |
DSRCompositeReferenceValue () | |
default contructor | |
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... | |
virtual OFBool | isEmpty () const |
check whether the current reference value is empty. More... | |
virtual OFCondition | readSequence (DcmItem &dataset, const OFString &type) |
read referenced SOP sequence from dataset. More... | |
virtual OFCondition | writeSequence (DcmItem &dataset) const |
write referenced SOP sequence to dataset. More... | |
const OFString & | getSOPClassUID () const |
get SOP class UID 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 | setSOPClassUID (const OFString &sopClassUID, const OFBool check=OFTrue) |
set SOP class UID value. More... | |
OFCondition | setSOPInstanceUID (const OFString &sopInstanceUID, const OFBool check=OFTrue) |
set SOP instance UID value. More... | |
OFCondition | checkCurrentValue () const |
check the currently stored reference value for validity. More... | |
Protected Member Functions | |
DSRImageReferenceValue * | getValuePtr () |
get pointer to image reference value More... | |
virtual OFCondition | readItem (DcmItem &dataset) |
read image reference value from dataset More... | |
virtual OFCondition | writeItem (DcmItem &dataset) const |
write image reference value to dataset More... | |
virtual OFCondition | checkSOPClassUID (const OFString &sopClassUID) const |
check the specified SOP class UID for validity. More... | |
virtual OFCondition | checkPresentationState (const DSRCompositeReferenceValue &referenceValue) const |
check the given reference to a presentation state object for validity. More... | |
![]() | |
DSRCompositeReferenceValue * | getValuePtr () |
get pointer to reference value More... | |
virtual OFCondition | checkSOPInstanceUID (const OFString &sopInstanceUID) const |
check the specified SOP instance UID for validity. More... | |
Private Attributes | |
DSRCompositeReferenceValue | PresentationState |
composite reference value (SOP class/instance UID) to presentation state (optional) | |
DSRImageFrameList | FrameList |
list of referenced frame numbers (associated DICOM VR=IS, VM=1-n, type 1C) | |
DicomImage * | IconImage |
icon image from Icon Image Sequence (optional) | |
Friends | |
class | DSRContentItem |
Additional Inherited Members | |
![]() | |
OFString | SOPClassUID |
reference SOP class UID (VR=UI, type 1) | |
OFString | SOPInstanceUID |
reference SOP instance UID (VR=UI, type 1) | |
Class for image reference values.
DSRImageReferenceValue::DSRImageReferenceValue | ( | const OFString & | sopClassUID, |
const OFString & | sopInstanceUID, | ||
const OFBool | check = OFTrue |
||
) |
constructor
sopClassUID | referenced SOP class UID of the image object. (VR=UI, mandatory) |
sopInstanceUID | referenced SOP instance UID of the image 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. |
DSRImageReferenceValue::DSRImageReferenceValue | ( | const OFString & | imageSOPClassUID, |
const OFString & | imageSOPInstanceUID, | ||
const OFString & | pstateSOPClassUID, | ||
const OFString & | pstateSOPInstanceUID, | ||
const OFBool | check = OFTrue |
||
) |
constructor
imageSOPClassUID | referenced SOP class UID of the image object. (VR=UI, mandatory) |
imageSOPInstanceUID | referenced SOP instance UID of the image object. (VR=UI, mandatory) |
pstateSOPClassUID | referenced SOP class UID of the presentation state object. (VR=UI, optional) |
pstateSOPInstanceUID | referenced SOP instance UID of the presentation state object. (VR=UI, optional) |
check | if enabled, check all four UID values for validity before setting them. See checkXXX() for details. Empty values are never accepted. |
DSRImageReferenceValue::DSRImageReferenceValue | ( | const DSRImageReferenceValue & | referenceValue) |
copy constructor
referenceValue | image reference value to be copied (not checked !) |
DSRImageReferenceValue::DSRImageReferenceValue | ( | const DSRCompositeReferenceValue & | imageReferenceValue, |
const DSRCompositeReferenceValue & | pstateReferenceValue | ||
) |
copy constructor
imageReferenceValue | image reference value to be copied (not checked !) |
pstateReferenceValue | presentation state reference value to be copied (not checked !) |
OFBool DSRImageReferenceValue::appliesToFrame | ( | const Sint32 | frameNumber) | const |
check whether the image reference applies to a specific frame.
The image reference applies to a frame (of multiframe images) if the list of referenced frame numbers is empty or the frame number is part of the list.
frameNumber | number of the frame to be checked |
|
protectedvirtual |
check the given reference to a presentation state object for validity.
The presentation state object is "valid" if both UIDs are empty or both are not empty and SOP class UID refers to a softcopy presentation state (see DSRTypes::E_PresentationStateType for a list of supported SOP classes).
referenceValue | value to be checked |
|
protectedvirtual |
check the specified SOP class UID for validity.
Currently, this method does not further specialize the checks performed in the base class DSRCompositeReferenceValue. Later on, this method might be extended to also check whether the specified SOP class is really an image storage SOP class.
sopClassUID | SOP class UID to be checked |
Reimplemented from DSRCompositeReferenceValue.
|
virtual |
clear all internal variables.
Since an empty image reference is invalid the reference becomes invalid afterwards.
Reimplemented from DSRCompositeReferenceValue.
Reimplemented in DSRImageTreeNode.
OFCondition DSRImageReferenceValue::createIconImage | ( | const OFString & | filename, |
const unsigned long | frame = 0 , |
||
const unsigned long | width = 64 , |
||
const unsigned long | height = 64 |
||
) |
create an icon image from the given DICOM image and associate it with this image reference.
According to the DICOM standard, this icon image should be representative of the referenced image and the size of the icon image "may be no greater than 128 rows by 128 columns". For monochrome images, either the first stored or an automatically computed min-max VOI window is selected. Please note that this icon image is only used in readItem() and writeItem() but not in the other input/output methods.
filename | name of the DICOM image file to be used to create the icon image |
frame | number of the frame to be used to create the icon image (0 = 1st frame) |
width | width of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'height'. |
height | height of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'width'. |
OFCondition DSRImageReferenceValue::createIconImage | ( | DcmObject * | object, |
const E_TransferSyntax | xfer = EXS_Unknown , |
||
const unsigned long | frame = 0 , |
||
const unsigned long | width = 64 , |
||
const unsigned long | height = 64 |
||
) |
create an icon image from the given DICOM image and associate it with this image reference.
According to the DICOM standard, this icon image should be representative of the referenced image and the size of the icon image "may be no greater than 128 rows by 128 columns". For monochrome images, either the first stored or an automatically computed min-max VOI window is selected. Please note that this icon image is only used in readItem() and writeItem() but not in the other input/output methods.
object | pointer to DICOM data structures (fileformat, dataset or item) that contain the DICOM image to be used to create the icon image |
xfer | transfer syntax of the 'object'. In case of a fileformat or dataset, the value EXS_Unknown is also allowed. |
frame | number of the frame to be used to create the icon image (0 = 1st frame) |
width | width of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'height'. |
height | height of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'width'. |
OFCondition DSRImageReferenceValue::createIconImage | ( | const DicomImage * | image, |
const unsigned long | width = 64 , |
||
const unsigned long | height = 64 |
||
) |
create an icon image from the given DICOM image and associate it with this image reference.
According to the DICOM standard, this icon image should be representative of the referenced image and the size of the icon image "may be no greater than 128 rows by 128 columns". Please note that this icon image is only used in readItem() and writeItem() but not in the other input/output methods.
image | pointer to DICOM image to be used to create the icon image. Only single frame images should be passed since only the first frame is used. |
width | width of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'height'. |
height | height of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'width'. |
|
inline |
get reference to list of referenced frame numbers
|
inline |
get reference to icon image associated with this image reference value (if any).
Please note that the icon image might be invalid even if the pointer is not NULL. Therefore, the DicomImage::getStatus() method should always be called to check the status of the image.
|
inline |
get reference to presentation state value
|
inline |
get reference to image reference value
OFCondition DSRImageReferenceValue::getValue | ( | DSRImageReferenceValue & | referenceValue) | const |
get copy of image reference value
referenceValue | reference to variable in which the value should be stored |
|
inlineprotected |
get pointer to image reference value
|
virtual |
check whether the content is short.
This method is used to check whether the rendered output of this content item can be expanded inline or not (used for renderHTML()).
flags | flag used to customize the output (see DSRTypes::HF_xxx) |
Reimplemented in DSRImageTreeNode.
|
virtual |
check whether the current image reference value is valid.
The reference value is valid if SOP class UID and SOP instance UID are valid (see checkSOP...UID() for details) and the optional presentation state is valid (see checkPresentationState()).
Reimplemented from DSRCompositeReferenceValue.
Reimplemented in DSRImageTreeNode.
DSRImageReferenceValue& DSRImageReferenceValue::operator= | ( | const DSRImageReferenceValue & | referenceValue) |
assignment operator
referenceValue | image reference value to be copied (not checked !) |
|
virtual |
print image reference.
The output of a typical image reference value looks like this: (CT image,"1.2.3") or (CT image,"1.2.3"),(GSPS,"1.2.3.4") if a presentation state is present. If the SOP class UID is unknown the UID is printed instead of the related name.
stream | output stream to which the image reference value should be printed |
flags | flag used to customize the output (see DSRTypes::PF_xxx) |
Reimplemented from DSRCompositeReferenceValue.
Reimplemented in DSRImageTreeNode.
|
protectedvirtual |
read image reference value from dataset
dataset | DICOM dataset from which the value should be read |
Reimplemented from DSRCompositeReferenceValue.
|
virtual |
read image reference from XML document
doc | document containing the XML file content |
cursor | cursor pointing to the starting node |
Reimplemented from DSRCompositeReferenceValue.
|
virtual |
render image 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 from DSRCompositeReferenceValue.
OFCondition DSRImageReferenceValue::setPresentationState | ( | const DSRCompositeReferenceValue & | pstateValue, |
const OFBool | check = OFTrue |
||
) |
set presentation state value.
Before setting the presentation state value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged.
pstateValue | value to be set |
check | If enabled, check value for validity before setting it. See checkXXX() for details. Empty UID values are accepted for disabling the optional presentation state. |
OFCondition DSRImageReferenceValue::setValue | ( | const DSRImageReferenceValue & | referenceValue, |
const OFBool | check = OFTrue |
||
) |
set image 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 image reference value to dataset
dataset | DICOM dataset to which the value should be written |
Reimplemented from DSRCompositeReferenceValue.
|
virtual |
write image reference 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 from DSRCompositeReferenceValue.
Reimplemented in DSRImageTreeNode.