DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Private Attributes | Friends
DSRImageReferenceValue Class Reference

Class for image reference values. More...

+ Inheritance diagram for DSRImageReferenceValue:

List of all members.

Public Member Functions

 DSRImageReferenceValue ()
 default contructor
 DSRImageReferenceValue (const OFString &sopClassUID, const OFString &sopInstanceUID)
 constructor.
 DSRImageReferenceValue (const OFString &imageSOPClassUID, const OFString &imageSOPInstanceUID, const OFString &pstateSOPClassUID, const OFString &pstateSOPInstanceUID)
 constructor.
 DSRImageReferenceValue (const DSRImageReferenceValue &referenceValue)
 copy constructor
 DSRImageReferenceValue (const DSRCompositeReferenceValue &imageReferenceValue, const DSRCompositeReferenceValue &pstateReferenceValue)
 copy constructor
virtual ~DSRImageReferenceValue ()
 destructor
DSRImageReferenceValueoperator= (const DSRImageReferenceValue &referenceValue)
 assignment operator
virtual void clear ()
 clear all internal variables.
virtual OFBool isValid () const
 check whether the current image reference value is valid.
virtual OFBool isShort (const size_t flags) const
 check whether the content is short.
virtual OFCondition print (STD_NAMESPACE ostream &stream, const size_t flags) const
 print image reference.
virtual OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor)
 read image reference from XML document
virtual OFCondition writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const
 write image reference in XML format
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
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.
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.
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.
void deleteIconImage ()
 delete the currently stored icon image, i.e. free the associated memory and "forget" the internal reference to it
const DicomImagegetIconImage () const
 get reference to icon image associated with this image reference value (if any).
const DSRImageReferenceValuegetValue () const
 get reference to image reference value
OFCondition getValue (DSRImageReferenceValue &referenceValue) const
 get copy of image reference value
OFCondition setValue (const DSRImageReferenceValue &referenceValue)
 set image reference value.
const DSRCompositeReferenceValuegetPresentationState () const
 get reference to presentation state value
OFCondition setPresentationState (const DSRCompositeReferenceValue &referenceValue)
 set presentation state value.
DSRImageFrameListgetFrameList ()
 get reference to list of referenced frame numbers
OFBool appliesToFrame (const Sint32 frameNumber) const
 check whether the image reference applies to a specific frame.

Protected Member Functions

DSRImageReferenceValuegetValuePtr ()
 get pointer to image reference value
virtual OFCondition readItem (DcmItem &dataset)
 read image reference value from dataset
virtual OFCondition writeItem (DcmItem &dataset) const
 write image reference value to dataset
virtual OFBool checkSOPClassUID (const OFString &sopClassUID) const
 check the specified SOP class UID for validity.
OFBool checkPresentationState (const DSRCompositeReferenceValue &referenceValue) const
 check the presentation state object for validity.

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)
DicomImageIconImage
 icon image from Icon Image Sequence (optional)

Friends

class DSRContentItem

Detailed Description

Class for image reference values.


Constructor & Destructor Documentation

DSRImageReferenceValue::DSRImageReferenceValue ( const OFString sopClassUID,
const OFString sopInstanceUID 
)

constructor.

The UID pair is only set if it passed the validity check (see setValue()).

Parameters:
sopClassUIDreferenced SOP class UID of the image object. (VR=UI, mandatory)
sopInstanceUIDreferenced SOP instance UID of the image object. (VR=UI, mandatory)
DSRImageReferenceValue::DSRImageReferenceValue ( const OFString imageSOPClassUID,
const OFString imageSOPInstanceUID,
const OFString pstateSOPClassUID,
const OFString pstateSOPInstanceUID 
)

constructor.

The UID 4-tuple is only set if it passed the validity check (see setValue()).

Parameters:
imageSOPClassUIDreferenced SOP class UID of the image object. (VR=UI, mandatory)
imageSOPInstanceUIDreferenced SOP instance UID of the image object. (VR=UI, mandatory)
pstateSOPClassUIDreferenced SOP class UID of the presentation state object. (VR=UI, optional)
pstateSOPInstanceUIDreferenced SOP instance UID of the presentation state object. (VR=UI, optional)

copy constructor

Parameters:
referenceValueimage reference value to be copied (not checked !)
DSRImageReferenceValue::DSRImageReferenceValue ( const DSRCompositeReferenceValue imageReferenceValue,
const DSRCompositeReferenceValue pstateReferenceValue 
)

copy constructor

Parameters:
imageReferenceValueimagee reference value to be copied (not checked !)
pstateReferenceValuepresentation state reference value to be copied (not checked !)

Member Function Documentation

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.

Parameters:
frameNumbernumber of the frame to be checked
Returns:
OFTrue if reference applies to the specified frame, OFFalse otherwise
OFBool DSRImageReferenceValue::checkPresentationState ( const DSRCompositeReferenceValue referenceValue) const [protected]

check the 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).

Parameters:
referenceValuevalue to be checked
Returns:
OFTrue if presentation state object is valid, OFFalse otherwise
virtual OFBool DSRImageReferenceValue::checkSOPClassUID ( const OFString sopClassUID) const [protected, virtual]

check the specified SOP class UID for validity.

The only check that is currently performed is that the UID is not empty. Later on it might be checked whether the specified SOP class is really an image storage SOP class.

Parameters:
sopClassUIDSOP class UID to be checked
Returns:
OFTrue if SOP class UID is valid, OFFalse otherwise

Reimplemented from DSRCompositeReferenceValue.

virtual void DSRImageReferenceValue::clear ( ) [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.

Parameters:
filenamename of the DICOM image file to be used to create the icon image
framenumber of the frame to be used to create the icon image (0 = 1st frame)
widthwidth of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'height'.
heightheight of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'width'.
Returns:
status, EC_Normal if successful, an error code otherwise
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.

Parameters:
objectpointer to DICOM data structures (fileformat, dataset or item) that contain the DICOM image to be used to create the icon image
xfertransfer syntax of the 'object'. In case of a fileformat or dataset, the value EXS_Unknown is also allowed.
framenumber of the frame to be used to create the icon image (0 = 1st frame)
widthwidth of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'height'.
heightheight of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'width'.
Returns:
status, EC_Normal if successful, an error code otherwise
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.

Parameters:
imagepointer 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.
widthwidth of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'height'.
heightheight of the icon image (in pixels). If 0 this value will be calculated automatically based on the given 'width'.
Returns:
status, EC_Normal if successful, an error code otherwise

get reference to list of referenced frame numbers

Returns:
reference to frame list

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.

Returns:
reference to icon image or NULL if none is present

get reference to presentation state value

Returns:
reference to presentation state value (might be empty or invalid)

get reference to image reference value

Returns:
reference to image reference value

Reimplemented from DSRCompositeReferenceValue.

get copy of image reference value

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

get pointer to image reference value

Returns:
pointer to image reference value (never NULL)

Reimplemented from DSRCompositeReferenceValue.

virtual OFBool DSRImageReferenceValue::isShort ( const size_t  flags) const [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()).

Parameters:
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns:
OFTrue if the content is short, OFFalse otherwise

Reimplemented in DSRImageTreeNode.

virtual OFBool DSRImageReferenceValue::isValid ( ) const [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()).

Returns:
OFTrue if reference value is valid, OFFalse otherwise

Reimplemented from DSRCompositeReferenceValue.

Reimplemented in DSRImageTreeNode.

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

assignment operator

Parameters:
referenceValueimage reference value to be copied (not checked !)
Returns:
reference to this image reference value after 'referenceValue' has been copied
virtual OFCondition DSRImageReferenceValue::print ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const [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.

Parameters:
streamoutput stream to which the image 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 from DSRCompositeReferenceValue.

Reimplemented in DSRImageTreeNode.

virtual OFCondition DSRImageReferenceValue::readItem ( DcmItem dataset) [protected, virtual]

read image reference value from dataset

Parameters:
datasetDICOM dataset from which the value should be read
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DSRCompositeReferenceValue.

virtual OFCondition DSRImageReferenceValue::readXML ( const DSRXMLDocument doc,
DSRXMLCursor  cursor 
) [virtual]

read image reference from XML document

Parameters:
docdocument containing the XML file content
cursorcursor pointing to the starting node
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DSRCompositeReferenceValue.

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

render image 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 from DSRCompositeReferenceValue.

set presentation state value.

Before setting the reference it is checked (see checkPresentationState()). If the value is invalid the current value is not replaced and remains unchanged.

Parameters:
referenceValuevalue to be set
Returns:
status, EC_Normal if successful, an error code otherwise

set image reference value.

Before setting the reference it is checked (see checkXXX()). If the value is invalid the current value is not replaced and remains unchanged.

Parameters:
referenceValuevalue to be set
Returns:
status, EC_Normal if successful, an error code otherwise
virtual OFCondition DSRImageReferenceValue::writeItem ( DcmItem dataset) const [protected, virtual]

write image 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 from DSRCompositeReferenceValue.

virtual OFCondition DSRImageReferenceValue::writeXML ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const [virtual]

write image reference 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 from DSRCompositeReferenceValue.

Reimplemented in DSRImageTreeNode.


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