]> Creatis software - gdcm.git/blob - src/gdcmDicomDirStudy.h
In order to allow to use current version (1.3) of gdcm *and* ITK (that includes
[gdcm.git] / src / gdcmDicomDirStudy.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirStudy.h,v $
5   Language:  C++
6   Date:      $Date: 2007/05/23 14:18:09 $
7   Version:   $Revision: 1.33 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMDICOMDIRSTUDY_H
20 #define GDCMDICOMDIRSTUDY_H
21
22 #include "gdcmDicomDirObject.h"
23
24 namespace GDCM_NAME_SPACE 
25 {
26 class DicomDirSerie;
27 class DicomDirVisit;
28 //-----------------------------------------------------------------------------
29 typedef std::list<DicomDirSerie *> ListDicomDirSerie;
30
31
32 // For future use (Full DICOMDIR)
33 typedef std::list<DicomDirVisit *> ListDicomDirVisit;
34 /*
35 typedef std::list<DicomDirResult *> ListDicomDirResult;
36 typedef std::list<DicomDirStudyComponent *> ListDicomDirStudyComponent;
37 */
38 //-----------------------------------------------------------------------------
39 /**
40  * \brief   describes a STUDY within a within a PATIENT
41  * (DicomDirPatient) of a given DICOMDIR (DicomDir)
42  */
43 class GDCM_EXPORT DicomDirStudy : public DicomDirObject
44 {
45    gdcmTypeMacro(DicomDirStudy);
46
47 public:
48 /// \brief Constructs a DicomDirStudy with a RefCounter
49    static DicomDirStudy *New(bool empty=false) {return new DicomDirStudy(empty);}
50
51    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
52    void WriteContent(std::ofstream *fp, FileType t);
53
54    // 'Serie' methods
55    DicomDirSerie *NewSerie();
56    /// Adds a gdcm::DicomDirSerie to a gdcm::DicomDirStudy
57    void AddSerie(DicomDirSerie *obj) { Series.push_back(obj); }
58    void ClearSerie();
59    DicomDirSerie *GetFirstSerie();
60    DicomDirSerie *GetNextSerie();
61    DicomDirSerie *GetLastSerie();
62
63    // 'Visit' methods
64    DicomDirVisit *NewVisit();
65    /// Adds a gdcm::DicomDirVisit to a gdcm::DicomDirStudy
66    void AddVisit(DicomDirVisit *obj) { Visits.push_back(obj); }
67    void ClearVisit();
68    DicomDirVisit *GetFirstVisit();
69    DicomDirVisit *GetNextVisit();
70    DicomDirVisit *GetLastVisit();
71    
72    // for future use (Full DICOMDIR)
73 /*
74    DicomDirResult *GetFirstResult();
75    DicomDirResult *GetNextResult();
76    DicomDirResult *GetLastResult();
77
78    DicomDirStudyComponent *GetFirstStudyComponent();
79    DicomDirStudyComponent *GetNextStudyComponent();
80    DicomDirStudyComponent *GetLastStudyComponent();
81 */    
82
83    virtual void Copy(DocEntrySet *set);
84
85 protected:
86    DicomDirStudy(bool empty=false); 
87    ~DicomDirStudy();
88
89 private:
90    /// chained list of DicomDirSeries (to be exploited hierarchicaly)
91    ListDicomDirSerie Series;
92    /// iterator on the DicomDirSeries of the current DicomDirStudy
93    ListDicomDirSerie::iterator ItSerie;
94
95    /// chained list of DicomDirVisits(single level)
96    ListDicomDirVisit Visits;
97    /// iterator on the DicomDirVisits of the current DicomDirStudy
98    ListDicomDirVisit::iterator ItVisit;
99    
100
101    // for future use (Full DICOMDIR)
102 /*
103    /// chained list of DicomDirResults(single level)
104    ListDicomDirResult Results;
105    /// iterator on the DicomDirResults of the current DicomDirStudy
106    ListDicomDirResult::iterator ItResult;
107
108    /// chained list of DicomDirStudyComponents(single level)
109    ListDicomDirStudyComponent StudyComponents;
110    /// iterator on the DicomDirStudyComponents of the current DicomDirStudy
111    ListDicomDirStudyComponent::iterator ItStudyComponents;
112 */
113 };
114 } // end namespace gdcm
115
116 //-----------------------------------------------------------------------------
117 #endif