OFFIS DCMTK  Version 3.6.0
dsrsoprf.h
1 /*
2  *
3  * Copyright (C) 2002-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmsr
15  *
16  * Author: Joerg Riesmeier
17  *
18  * Purpose:
19  * classes: DSRSOPInstanceReferenceList
20  * - InstanceStruct, SeriesStruct, StudyStruct
21  *
22  * Last Update: $Author: joergr $
23  * Update Date: $Date: 2010-10-14 13:16:33 $
24  * CVS/RCS Revision: $Revision: 1.15 $
25  * Status: $State: Exp $
26  *
27  * CVS/RCS Log at end of file
28  *
29  */
30 
31 
32 #ifndef DSRSOPRF_H
33 #define DSRSOPRF_H
34 
35 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
36 
37 #include "dcmtk/ofstd/oflist.h"
38 #include "dcmtk/ofstd/ofstring.h"
39 #include "dcmtk/ofstd/ofcond.h"
40 
41 #include "dcmtk/dcmdata/dcitem.h"
42 #include "dcmtk/dcmdata/dctagkey.h"
43 
44 #include "dcmtk/dcmsr/dsrtypes.h"
45 
46 
47 /*---------------------*
48  * class declaration *
49  *---------------------*/
50 
54  : public DSRTypes
55 {
56 
57  public:
58 
62  {
67  InstanceStruct(const OFString &sopClassUID,
68  const OFString &instanceUID);
69 
74  };
75 
78  struct SeriesStruct
79  {
83  SeriesStruct(const OFString &seriesUID);
84 
87  ~SeriesStruct();
88 
92  size_t getNumberOfInstances() const;
93 
98  OFCondition read(DcmItem &dataset);
99 
104  OFCondition write(DcmItem &dataset) const;
105 
112  DSRXMLCursor cursor);
113 
119  OFCondition writeXML(STD_NAMESPACE ostream &stream,
120  const size_t flags = 0) const;
121 
126  InstanceStruct *gotoInstance(const OFString &instanceUID);
127 
133 
139 
146  OFCondition addItem(const OFString &sopClassUID,
147  const OFString &instanceUID);
148 
154 
163 
167  OFListIterator(InstanceStruct *) Iterator;
168  };
169 
172  struct StudyStruct
173  {
177  StudyStruct(const OFString &studyUID);
178 
181  ~StudyStruct();
182 
186  size_t getNumberOfInstances() const;
187 
192  OFCondition read(DcmItem &dataset);
193 
198  OFCondition write(DcmItem &dataset) const;
199 
206  DSRXMLCursor cursor);
207 
213  OFCondition writeXML(STD_NAMESPACE ostream &stream,
214  const size_t flags = 0) const;
215 
220  SeriesStruct *gotoSeries(const OFString &seriesUID);
221 
226  InstanceStruct *gotoInstance(const OFString &instanceUID);
227 
233 
240 
248  OFCondition addItem(const OFString &seriesUID,
249  const OFString &sopClassUID,
250  const OFString &instanceUID);
251 
257 
262  void removeIncompleteItems();
263 
266 
270  OFListIterator(SeriesStruct *) Iterator;
271  };
272 
273 
277  DSRSOPInstanceReferenceList(const DcmTagKey &sequence);
278 
282 
285  void clear();
286 
290  OFBool empty() const;
291 
295  size_t getNumberOfInstances() const;
296 
305  OFCondition read(DcmItem &dataset);
306 
312  OFCondition write(DcmItem &dataset) const;
313 
324  OFCondition readXML(const DSRXMLDocument &doc,
325  DSRXMLCursor cursor,
326  const size_t flags);
327 
333  OFCondition writeXML(STD_NAMESPACE ostream &stream,
334  const size_t flags = 0) const;
335 
346  OFCondition addItem(const OFString &studyUID,
347  const OFString &seriesUID,
348  const OFString &sopClassUID,
349  const OFString &instanceUID);
350 
358  OFCondition addItem(DcmItem &dataset);
359 
364  OFCondition removeItem();
365 
372  OFCondition removeItem(const OFString &sopClassUID,
373  const OFString &instanceUID);
374 
382  OFCondition removeItem(const OFString &studyUID,
383  const OFString &seriesUID,
384  const OFString &instanceUID);
385 
391  OFCondition gotoItem(const OFString &sopClassUID,
392  const OFString &instanceUID);
393 
400  OFCondition gotoItem(const OFString &studyUID,
401  const OFString &seriesUID,
402  const OFString &instanceUID);
403 
410  OFCondition gotoFirstItem();
411 
420  OFCondition gotoNextItem();
421 
426  const OFString &getStudyInstanceUID(OFString &stringValue) const;
427 
432  const OFString &getSeriesInstanceUID(OFString &stringValue) const;
433 
438  const OFString &getSOPInstanceUID(OFString &stringValue) const;
439 
444  const OFString &getSOPClassUID(OFString &stringValue) const;
445 
451  const OFString &getRetrieveAETitle(OFString &stringValue) const;
452 
457  const OFString &getStorageMediaFileSetID(OFString &stringValue) const;
458 
463  const OFString &getStorageMediaFileSetUID(OFString &stringValue) const;
464 
471 
477 
483 
484 
485  protected:
486 
491  StudyStruct *gotoStudy(const OFString &studyUID);
492 
496  StudyStruct *getCurrentStudy() const;
497 
502 
507 
512  void removeIncompleteItems();
513 
514 
515  private:
516 
519 
521  OFList<StudyStruct *> StudyList;
523  OFListIterator(StudyStruct *) Iterator;
524 
525  // default constructor - not implemented!
527  // copy constructor - not implemented!
529  // assignment operator - not implemented!
530  DSRSOPInstanceReferenceList &operator=(const DSRSOPInstanceReferenceList &);
531 };
532 
533 
534 #endif
535 
536 
537 /*
538  * CVS/RCS Log:
539  * $Log: dsrsoprf.h,v $
540  * Revision 1.15 2010-10-14 13:16:33 joergr
541  * Updated copyright header. Added reference to COPYRIGHT file.
542  *
543  * Revision 1.14 2010-02-22 11:39:55 uli
544  * Remove some unneeded includes.
545  *
546  * Revision 1.13 2009-10-13 14:57:50 uli
547  * Switched to logging mechanism provided by the "new" oflog module.
548  *
549  * Revision 1.12 2007-11-15 16:33:19 joergr
550  * Fixed coding style to be more consistent.
551  *
552  * Revision 1.11 2006/08/15 16:40:03 meichel
553  * Updated the code in module dcmsr to correctly compile when
554  * all standard C++ classes remain in namespace std.
555  *
556  * Revision 1.10 2006/05/11 09:18:21 joergr
557  * Moved containsExtendedCharacters() from dcmsr to dcmdata module.
558  *
559  * Revision 1.9 2005/12/08 16:05:18 meichel
560  * Changed include path schema for all DCMTK header files
561  *
562  * Revision 1.8 2005/07/27 16:33:39 joergr
563  * Added method that allows to add a DICOM dataset to the list of references.
564  *
565  * Revision 1.7 2004/11/22 16:39:09 meichel
566  * Added method that checks if the SR document contains non-ASCII characters
567  * in any of the strings affected by SpecificCharacterSet.
568  *
569  * Revision 1.6 2003/08/07 18:01:42 joergr
570  * Removed libxml dependency from header files.
571  *
572  * Revision 1.5 2003/08/07 12:50:12 joergr
573  * Added readXML functionality.
574  * Renamed parameters/variables "string" to avoid name clash with STL class.
575  * Enhanced class DSRSOPInstanceReferenceList: empty/incomplete items (e.g.
576  * series with no instances or studies with no series) are automatically
577  * removed from the list.
578  *
579  * Revision 1.4 2002/08/30 14:16:59 joergr
580  * Removed "friend" statements from class declaration and moved sub-classes to
581  * the "public" section (required for Sun CC 6).
582  *
583  * Revision 1.3 2002/05/14 08:16:07 joergr
584  * Added removeItem() methods.
585  *
586  * Revision 1.2 2002/05/07 14:04:44 joergr
587  * Added "friend" statements to class declaration (required for MSVC).
588  *
589  * Revision 1.1 2002/05/07 12:49:31 joergr
590  * Added support for the Current Requested Procedure Evidence Sequence and the
591  * Pertinent Other Evidence Sequence to the dcmsr module.
592  *
593  *
594  */
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
class maintaining a attribute tag (group and element number)
Definition: dctagkey.h:46
OFCondition setStorageMediaFileSetUID(const OFString &value)
set the storage media file set UID of the currently selected entry
Class for XML documents.
Definition: dsrxmld.h:63
OFCondition read(DcmItem &dataset)
read instance level attributes from dataset
OFString StorageMediaFileSetID
optional: storage media file set ID (VR=SH, VM=1)
Definition: dsrsoprf.h:160
InstanceStruct * getCurrentInstance() const
get pointer to currently selected instance structure (if any)
StudyStruct * gotoStudy(const OFString &studyUID)
set cursor to the specified study entry (if existent)
OFString RetrieveAETitle
optional: retrieve application entity title (VR=AE, VM=1-n)
Definition: dsrsoprf.h:158
const OFString InstanceUID
SOP instance UID (VR=UI, VM=1)
Definition: dsrsoprf.h:73
OFCondition gotoItem(const OFString &sopClassUID, const OFString &instanceUID)
select the specified item as the current one
OFString StorageMediaFileSetUID
optional: storage media file set UID (VR=UI, VM=1)
Definition: dsrsoprf.h:162
const OFString & getSOPClassUID(OFString &stringValue) const
get the SOP class UID of the currently selected entry
InstanceStruct(const OFString &sopClassUID, const OFString &instanceUID)
constructor
OFCondition gotoNextItem()
select the next item in the list.
OFList< SeriesStruct * > SeriesList
list of referenced series
Definition: dsrsoprf.h:268
const OFString SeriesUID
series instance UID (VR=UI, VM=1)
Definition: dsrsoprf.h:156
OFCondition gotoFirstItem()
select the first item in the list.
SeriesStruct * getCurrentSeries() const
get pointer to currently selected series structure (if any)
InstanceStruct * gotoInstance(const OFString &instanceUID)
set cursor to the specified instance (if existent)
OFBool empty() const
check whether list of references is empty
OFCondition writeXML(STD_NAMESPACE ostream &stream, const size_t flags=0) const
write series and instance level attributes in XML format
Internal structure defining the series list items.
Definition: dsrsoprf.h:78
SeriesStruct(const OFString &seriesUID)
constructor
OFCondition addItem(const OFString &sopClassUID, const OFString &instanceUID)
add new entry to the list of instances (if not already existent).
Internal structure defining the study list items.
Definition: dsrsoprf.h:172
OFListIterator(InstanceStruct *) Iterator
currently selected instance (cursor)
const OFString & getStorageMediaFileSetID(OFString &stringValue) const
get the storage media file set ID of the currently selected entry (optional)
Internal structure defining the instance list items.
Definition: dsrsoprf.h:61
const OFString & getStudyInstanceUID(OFString &stringValue) const
get the study instance UID of the currently selected entry
double linked list template class.
Definition: oflist.h:161
const OFString SOPClassUID
SOP class UID (VR=UI, VM=1)
Definition: dsrsoprf.h:71
const DcmTagKey SequenceTag
DICOM tag specifying the attribute (sequence) of the reference list.
Definition: dsrsoprf.h:518
void removeIncompleteItems()
remove empty/incomplete items from the list.
const OFString & getSOPInstanceUID(OFString &stringValue) const
get the SOP instance UID of the currently selected entry
size_t getNumberOfInstances() const
get number of instance stored in the list of instances
void clear()
clear list of references
const OFString & getSeriesInstanceUID(OFString &stringValue) const
get the series instance UID of the currently selected entry
OFList< InstanceStruct * > InstanceList
list of referenced instances
Definition: dsrsoprf.h:165
Class for SOP instance reference lists.
Definition: dsrsoprf.h:53
OFCondition setStorageMediaFileSetID(const OFString &value)
set the storage media file set ID of the currently selected entry
const OFString StudyUID
study instance UID (VR=UI, VM=1)
Definition: dsrsoprf.h:265
OFCondition removeItem()
remove the current item from the list of instances.
OFList< StudyStruct * > StudyList
list of studies
Definition: dsrsoprf.h:521
const OFString & getStorageMediaFileSetUID(OFString &stringValue) const
get the storage media file set UID of the currently selected entry (optional)
OFCondition write(DcmItem &dataset) const
write series and instance level attributes to dataset
General purpose class hiding global functions, constants and types from the global namespace...
Definition: dsrtypes.h:150
OFCondition readXML(const DSRXMLDocument &doc, DSRXMLCursor cursor)
read series and instance level attributes from XML document
OFCondition setRetrieveAETitle(const OFString &value)
set the retrieve application entity title of the currently selected entry.
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
const OFString & getRetrieveAETitle(OFString &stringValue) const
get the retrieve application entity title of the currently selected entry (optional).
Class for XML document cursors.
Definition: dsrxmlc.h:73
StudyStruct * getCurrentStudy() const
get pointer to currently selected study structure (if any)
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Wed Jan 4 2017 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.6