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

Class for SOP instance reference lists. More...

+ Inheritance diagram for DSRSOPInstanceReferenceList:

List of all members.

Classes

struct  InstanceStruct
 Internal structure defining the instance list items. More...
struct  SeriesStruct
 Internal structure defining the series list items. More...
struct  StudyStruct
 Internal structure defining the study list items. More...

Public Member Functions

 DSRSOPInstanceReferenceList (const DcmTagKey &sequence)
 constructor
 ~DSRSOPInstanceReferenceList ()
 destructor
void clear ()
 clear list of references
OFBool empty () const
 check whether list of references is empty
size_t getNumberOfInstances () const
 get number of instance stored in the list of references
OFCondition read (DcmItem &dataset)
 read list of referenced SOP instances.
OFCondition write (DcmItem &dataset) const
 write list of referenced SOP instances.
OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read list of references from XML document.
OFCondition writeXML (STD_NAMESPACE ostream &stream, const size_t flags=0) const
 write current list of references in XML format
OFCondition addItem (const OFString &studyUID, const OFString &seriesUID, const OFString &sopClassUID, const OFString &instanceUID)
 add the specified item to the list of references.
OFCondition addItem (DcmItem &dataset)
 add item from specified DICOM dataset to the list of references.
OFCondition removeItem ()
 remove the current item from the list of referenced SOP instances.
OFCondition removeItem (const OFString &sopClassUID, const OFString &instanceUID)
 remove the specified item from the list of references.
OFCondition removeItem (const OFString &studyUID, const OFString &seriesUID, const OFString &instanceUID)
 remove the specified item from the list of references.
OFCondition gotoItem (const OFString &sopClassUID, const OFString &instanceUID)
 select the specified item as the current one
OFCondition gotoItem (const OFString &studyUID, const OFString &seriesUID, const OFString &instanceUID)
 select the specified item as the current one
OFCondition gotoFirstItem ()
 select the first item in the list.
OFCondition gotoNextItem ()
 select the next item in the list.
const OFStringgetStudyInstanceUID (OFString &stringValue) const
 get the study instance UID of the currently selected entry
const OFStringgetSeriesInstanceUID (OFString &stringValue) const
 get the series instance UID of the currently selected entry
const OFStringgetSOPInstanceUID (OFString &stringValue) const
 get the SOP instance UID of the currently selected entry
const OFStringgetSOPClassUID (OFString &stringValue) const
 get the SOP class UID of the currently selected entry
const OFStringgetRetrieveAETitle (OFString &stringValue) const
 get the retrieve application entity title of the currently selected entry (optional).
const OFStringgetStorageMediaFileSetID (OFString &stringValue) const
 get the storage media file set ID of the currently selected entry (optional)
const OFStringgetStorageMediaFileSetUID (OFString &stringValue) const
 get the storage media file set UID of the currently selected entry (optional)
OFCondition getPurposeOfReference (DSRCodedEntryValue &codeValue) const
 get purpose of reference code of the currently selected entry (optional)
OFCondition setRetrieveAETitle (const OFString &value)
 set the retrieve application entity title of the currently selected entry.
OFCondition setStorageMediaFileSetID (const OFString &value)
 set the storage media file set ID of the currently selected entry
OFCondition setStorageMediaFileSetUID (const OFString &value)
 set the storage media file set UID of the currently selected entry
OFCondition setPurposeOfReference (const DSRCodedEntryValue &codeValue)
 set purpose of reference code of the currently selected entry

Protected Member Functions

StudyStructgotoStudy (const OFString &studyUID)
 set cursor to the specified study entry (if existent)
StudyStructgetCurrentStudy () const
 get pointer to currently selected study structure (if any)
SeriesStructgetCurrentSeries () const
 get pointer to currently selected series structure (if any)
InstanceStructgetCurrentInstance () const
 get pointer to currently selected instance structure (if any)
void removeIncompleteItems ()
 remove empty/incomplete items from the list.

Private Member Functions

 OFListIterator (StudyStruct *) Iterator
 internal cursor to current (selected) list item
 DSRSOPInstanceReferenceList (const DSRSOPInstanceReferenceList &)
DSRSOPInstanceReferenceListoperator= (const DSRSOPInstanceReferenceList &)

Private Attributes

const DcmTagKey SequenceTag
 DICOM tag specifying the attribute (sequence) of the reference list.
OFList< StudyStruct * > StudyList
 list of studies

Detailed Description

Class for SOP instance reference lists.


Constructor & Destructor Documentation

constructor

Parameters:
sequenceDICOM tag specifying the attribute (sequence) of the reference list

Member Function Documentation

OFCondition DSRSOPInstanceReferenceList::addItem ( const OFString studyUID,
const OFString seriesUID,
const OFString sopClassUID,
const OFString instanceUID 
)

add the specified item to the list of references.

Internally the item is inserted into the hierarchical structure of studies, series and instances, if not already contained in the list. In any case the specified item is selected as the current one.

Parameters:
studyUIDstudy instance UID of the entry to be added
seriesUIDseries instance UID of the entry to be added
sopClassUIDSOP class UID of the entry to be added
instanceUIDSOP instance UID of the entry to be added
Returns:
status, EC_Normal if successful, an error code otherwise

add item from specified DICOM dataset to the list of references.

Internally an item representing the given dataset is inserted into the hierarchical structure of studies, series and instances, if not already contained in the list. In any case the specified item is selected as the current one.

Parameters:
datasetreference to DICOM dataset from which the relevant UIDs are retrieved
Returns:
status, EC_Normal if successful, an error code otherwise

check whether list of references is empty

Returns:
OFTrue if list is empty, OFFalse otherwise

get pointer to currently selected instance structure (if any)

Returns:
pointer to the instance structure if successful, NULL otherwise

get pointer to currently selected series structure (if any)

Returns:
pointer to the series structure if successful, NULL otherwise

get pointer to currently selected study structure (if any)

Returns:
pointer to the study structure if successful, NULL otherwise

get number of instance stored in the list of references

Returns:
number of instances

get purpose of reference code of the currently selected entry (optional)

Parameters:
codeValuevariable where a copy of the code should be stored
Returns:
status, EC_Normal if successful, an error code otherwise

get the retrieve application entity title of the currently selected entry (optional).

The resulting string may contain multiple values separated by a backslash ("\").

Parameters:
stringValuereference to string variable in which the result is stored
Returns:
reference to the resulting string (might be empty)

get the series instance UID of the currently selected entry

Parameters:
stringValuereference to string variable in which the result is stored
Returns:
reference to the resulting string (might be empty)

get the SOP class UID of the currently selected entry

Parameters:
stringValuereference to string variable in which the result is stored
Returns:
reference to the resulting string (might be empty)

get the SOP instance UID of the currently selected entry

Parameters:
stringValuereference to string variable in which the result is stored
Returns:
reference to the resulting string (might be empty)

get the storage media file set ID of the currently selected entry (optional)

Parameters:
stringValuereference to string variable in which the result is stored
Returns:
reference to the resulting string (might be empty)

get the storage media file set UID of the currently selected entry (optional)

Parameters:
stringValuereference to string variable in which the result is stored
Returns:
reference to the resulting string (might be empty)

get the study instance UID of the currently selected entry

Parameters:
stringValuereference to string variable in which the result is stored
Returns:
reference to the resulting string (might be empty)

select the first item in the list.

That means the first instance in the first series of the first study is selected (if available).

Returns:
status, EC_Normal if successful, an error code otherwise. (e.g. if the list is empty)
OFCondition DSRSOPInstanceReferenceList::gotoItem ( const OFString sopClassUID,
const OFString instanceUID 
)

select the specified item as the current one

Parameters:
sopClassUIDSOP class UID of the item to be selected
instanceUIDSOP instance UID of the item to be selected
Returns:
status, EC_Normal if successful, an error code otherwise
OFCondition DSRSOPInstanceReferenceList::gotoItem ( const OFString studyUID,
const OFString seriesUID,
const OFString instanceUID 
)

select the specified item as the current one

Parameters:
studyUIDstudy instance UID of the item to be selected
seriesUIDseries instance UID of the item to be selected
instanceUIDSOP instance UID of the item to be selected
Returns:
status, EC_Normal if successful, an error code otherwise

select the next item in the list.

That means the next instance in the current series, or the first instance in the next series, or the first instance in the first series of the next study is selected (if available). The combination of this function and gotoFirstItem() allows to iterate over all referenced SOP instances.

Returns:
status, EC_Normal if successful, an error code otherwise. (e.g. if the end of the list has been reached)
StudyStruct* DSRSOPInstanceReferenceList::gotoStudy ( const OFString studyUID) [protected]

set cursor to the specified study entry (if existent)

Parameters:
studyUIDstudy instance UID of the entry to be searched for
Returns:
pointer to the study structure if successful, NULL otherwise

read list of referenced SOP instances.

The hierarchical structure is automatically reorganized in a way that each study, each series (within a study) and each instance (within a series) only exist once, i.e. the structure might look different when written back to a dataset. However, the content is identical and this way of storing information saves storage space.

Parameters:
datasetDICOM dataset from which the data should be read
Returns:
status, EC_Normal if successful, an error code otherwise
OFCondition DSRSOPInstanceReferenceList::readXML ( const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags 
)

read list of references from XML document.

The hierarchical structure is automatically reorganized in a way that each study, each series (within a study) and each instance (within a series) only exist once, i.e. the structure might look different when written back to a dataset. However, the content is identical and this way of storing information saves storage space.

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

remove empty/incomplete items from the list.

(e.g. series with no instances or studies with no series) Please note that this function modifies the value of 'Iterator'.

remove the current item from the list of referenced SOP instances.

After successful removal the cursor is set to the next valid position.

Returns:
status, EC_Normal if successful, an error code otherwise
OFCondition DSRSOPInstanceReferenceList::removeItem ( const OFString sopClassUID,
const OFString instanceUID 
)

remove the specified item from the list of references.

After successful removal the cursor is set to the next valid position.

Parameters:
sopClassUIDSOP class UID of the item to be removed
instanceUIDSOP instance UID of the item to be removed
Returns:
status, EC_Normal if successful, an error code otherwise
OFCondition DSRSOPInstanceReferenceList::removeItem ( const OFString studyUID,
const OFString seriesUID,
const OFString instanceUID 
)

remove the specified item from the list of references.

After successful removal the cursor is set to the next valid position.

Parameters:
studyUIDstudy instance UID of the item to be removed
seriesUIDseries instance UID of the item to be removed
instanceUIDSOP instance UID of the item to be removed
Returns:
status, EC_Normal if successful, an error code otherwise

set purpose of reference code of the currently selected entry

Parameters:
codeValuevalue to be set (use empty code to omit optional attribute)
Returns:
status, EC_Normal if successful, an error code otherwise

set the retrieve application entity title of the currently selected entry.

Multiple values are to be separated by a backslash ("\").

Parameters:
valuestring value to be set (use empty string to omit optional attribute)
Returns:
status, EC_Normal if successful, an error code otherwise

set the storage media file set ID of the currently selected entry

Parameters:
valuestring value to be set (use empty string to omit optional attribute)
Returns:
status, EC_Normal if successful, an error code otherwise

set the storage media file set UID of the currently selected entry

Parameters:
valuestring value to be set (use empty string to omit optional attribute)
Returns:
status, EC_Normal if successful, an error code otherwise

write list of referenced SOP instances.

Does nothing if list is empty.

Parameters:
datasetDICOM dataset to which the data should be written
Returns:
status, EC_Normal if successful, an error code otherwise
OFCondition DSRSOPInstanceReferenceList::writeXML ( STD_NAMESPACE ostream &  stream,
const size_t  flags = 0 
) const

write current list of references in XML format

Parameters:
streamoutput stream to which the XML data is written
flagsoptional flag used to customize the output (see DSRTypes::XF_xxx)
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