📄 dsrsoprf.h
字号:
/* * * Copyright (C) 2002-2005, OFFIS * * This software and supporting documentation were developed by * * Kuratorium OFFIS e.V. * Healthcare Information and Communication Systems * Escherweg 2 * D-26121 Oldenburg, Germany * * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. * * Module: dcmsr * * Author: Joerg Riesmeier * * Purpose: * classes: DSRSOPInstanceReferenceList * - InstanceStruct, SeriesStruct, StudyStruct * * Last Update: $Author: meichel $ * Update Date: $Date: 2005/12/08 16:05:18 $ * CVS/RCS Revision: $Revision: 1.9 $ * Status: $State: Exp $ * * CVS/RCS Log at end of file * */#ifndef DSRSOPRF_H#define DSRSOPRF_H#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */#include "dcmtk/ofstd/oflist.h"#include "dcmtk/ofstd/ofstring.h"#include "dcmtk/ofstd/ofconsol.h"#include "dcmtk/ofstd/ofcond.h"#include "dcmtk/dcmdata/dcitem.h"#include "dcmtk/dcmdata/dctagkey.h"#include "dcmtk/dcmsr/dsrtypes.h"/*---------------------* * class declaration * *---------------------*//** Class for SOP instance reference lists */class DSRSOPInstanceReferenceList : public DSRTypes{ public: /** Internal structure defining the instance list items */ struct InstanceStruct { /** constructor ** @param sopClassUID SOP class UID ** @param instanceUID SOP instance UID */ InstanceStruct(const OFString &sopClassUID, const OFString &instanceUID); /// SOP class UID (VR=UI, VM=1) const OFString SOPClassUID; /// SOP instance UID (VR=UI, VM=1) const OFString InstanceUID; }; /** Internal structure defining the series list items */ struct SeriesStruct { /** constructor ** @param seriesUID series instance UID */ SeriesStruct(const OFString &seriesUID); /** destructor */ ~SeriesStruct(); /** get number of instance stored in the list of instances ** @return number of instances */ size_t getNumberOfInstances() const; /** read instance level attributes from dataset ** @param dataset DICOM dataset from which the list should be read * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition read(DcmItem &dataset, OFConsole *logStream); /** write series and instance level attributes to dataset ** @param dataset DICOM dataset to which the list should be written * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition write(DcmItem &dataset, OFConsole *logStream) const; /** read series and instance level attributes from XML document ** @param doc document containing the XML file content * @param cursor cursor pointing to the starting node ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition readXML(const DSRXMLDocument &doc, DSRXMLCursor cursor); /** write series and instance level attributes in XML format ** @param stream output stream to which the XML document is written * @param flags optional flag used to customize the output (see DSRTypes::XF_xxx) ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition writeXML(ostream &stream, const size_t flags = 0) const; /** set cursor to the specified instance (if existent) ** @param instanceUID SOP instance UID of the entry to be searched for ** @return pointer to the instance structure if successful, NULL otherwise */ InstanceStruct *gotoInstance(const OFString &instanceUID); /** select the first item in the list. * That means the first instance in the current series. ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition gotoFirstItem(); /** select the next item in the list. * That means the next instance in the current series (if available). ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition gotoNextItem(); /** add new entry to the list of instances (if not already existent). * Finally, the specified item is selected as the current one. ** @param sopClassUID SOP class UID of the entry to be added * @param instanceUID SOP instance UID of the entry to be added ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition addItem(const OFString &sopClassUID, const OFString &instanceUID); /** remove the current item from the list of instances. * After sucessful removal the cursor is set to the next valid position. ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition removeItem(); /** check if this object contains non-ASCII characters in one of the * strings affected by SpecificCharacterSet in DICOM * @return true if node contains non-ASCII characters, false otherwise */ OFBool containsExtendedCharacters(); /// series instance UID (VR=UI, VM=1) const OFString SeriesUID; /// optional: retrieve application entity title (VR=AE, VM=1-n) OFString RetrieveAETitle; /// optional: storage media file set ID (VR=SH, VM=1) OFString StorageMediaFileSetID; /// optional: storage media file set UID (VR=UI, VM=1) OFString StorageMediaFileSetUID; /// list of referenced instances OFList<InstanceStruct *> InstanceList; /// currently selected instance (cursor) OFListIterator(InstanceStruct *) Iterator; }; /** Internal structure defining the study list items */ struct StudyStruct { /** constructor ** @param studyUID study instance UID */ StudyStruct(const OFString &studyUID); /** destructor */ ~StudyStruct(); /** get number of instance stored in the list of series ** @return number of instances */ size_t getNumberOfInstances() const; /** read series and instance level from dataset ** @param dataset DICOM dataset from which the list should be read * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition read(DcmItem &dataset, OFConsole *logStream); /** write study, series and instance level attributes to dataset ** @param dataset DICOM dataset to which the list should be written * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition write(DcmItem &dataset, OFConsole *logStream) const; /** read study, series and instance level attributes from XML document ** @param doc document containing the XML file content * @param cursor cursor pointing to the starting node ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition readXML(const DSRXMLDocument &doc, DSRXMLCursor cursor); /** write study, series and instance level attributes in XML format ** @param stream output stream to which the XML document is written * @param flags optional flag used to customize the output (see DSRTypes::XF_xxx) ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition writeXML(ostream &stream, const size_t flags = 0) const; /** set cursor to the specified series entry (if existent) ** @param seriesUID series instance UID of the entry to be searched for ** @return pointer to the series structure if successful, NULL otherwise */ SeriesStruct *gotoSeries(const OFString &seriesUID); /** set cursor to the specified instance entry (if existent) ** @param instanceUID SOP instance UID of the entry to be searched for ** @return pointer to the instance structure if successful, NULL otherwise */ InstanceStruct *gotoInstance(const OFString &instanceUID); /** select the first item in the list. * That means the first instance in the first series of the current study. ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition gotoFirstItem(); /** select the next item in the list. * That means the next instance in the current series, or the first instance * in the next series (if available). ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition gotoNextItem(); /** add new entry to the list of series and instances (if not already existent). * Finally, the specified items are selected as the current one. ** @param seriesUID series instance UID of the entry to be added * @param sopClassUID SOP class UID of the entry to be added * @param instanceUID SOP instance UID of the entry to be added ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition addItem(const OFString &seriesUID, const OFString &sopClassUID, const OFString &instanceUID); /** remove the current item from the list of series and instances. * After sucessful removal the cursors are set to the next valid position. ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition removeItem(); /** remove empty/incomplete items from the list. * (e.g. series with no instances) * Please note that this function modifies the value of 'Iterator'. */ void removeIncompleteItems(); /** check if this object contains non-ASCII characters in one of the * strings affected by SpecificCharacterSet in DICOM * @return true if node contains non-ASCII characters, false otherwise */ OFBool containsExtendedCharacters(); /// study instance UID (VR=UI, VM=1) const OFString StudyUID; /// list of referenced series OFList<SeriesStruct *> SeriesList; /// currently selected series (cursor) OFListIterator(SeriesStruct *) Iterator; }; /** constructor ** @param sequence DICOM tag specifying the attribute (sequence) of the reference list */ DSRSOPInstanceReferenceList(const DcmTagKey &sequence); /** destructor */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -