]> Creatis software - gdcm.git/blob - src/gdcmDicomDirStudy.h
* Some classes inherit now from gdcm::RefCounter
[gdcm.git] / src / gdcmDicomDirStudy.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirStudy.h,v $
5   Language:  C++
6   Date:      $Date: 2005/10/25 14:52:33 $
7   Version:   $Revision: 1.30 $
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 
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    static DicomDirStudy *New(bool empty=false) {return new DicomDirStudy(empty);}
49
50    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
51    void WriteContent(std::ofstream *fp, FileType t);
52
53    // 'Serie' methods
54    DicomDirSerie *NewSerie();
55    /// Adds a gdcm::DicomDirSerie to a gdcm::DicomDirStudy
56    void AddSerie(DicomDirSerie *obj) { Series.push_back(obj); }
57    void ClearSerie();
58    DicomDirSerie *GetFirstSerie();
59    DicomDirSerie *GetNextSerie();
60    DicomDirSerie *GetLastSerie();
61
62    // 'Visit' methods
63    DicomDirVisit *NewVisit();
64    /// Adds a gdcm::DicomDirVisit to a gdcm::DicomDirStudy
65    void AddVisit(DicomDirVisit *obj) { Visits.push_back(obj); }
66    void ClearVisit();
67    DicomDirVisit *GetFirstVisit();
68    DicomDirVisit *GetNextVisit();
69    DicomDirVisit *GetLastVisit();
70    
71    // for future use (Full DICOMDIR)
72 /*
73    DicomDirResult *GetFirstResult();
74    DicomDirResult *GetNextResult();
75    DicomDirResult *GetLastResult();
76
77    DicomDirStudyComponent *GetFirstStudyComponent();
78    DicomDirStudyComponent *GetNextStudyComponent();
79    DicomDirStudyComponent *GetLastStudyComponent();
80 */    
81
82 protected:
83    DicomDirStudy(bool empty=false); 
84    ~DicomDirStudy();
85
86 private:
87    /// chained list of DicomDirSeries (to be exploited hierarchicaly)
88    ListDicomDirSerie Series;
89    /// iterator on the DicomDirSeries of the current DicomDirStudy
90    ListDicomDirSerie::iterator ItSerie;
91
92    /// chained list of DicomDirVisits(single level)
93    ListDicomDirVisit Visits;
94    /// iterator on the DicomDirVisits of the current DicomDirStudy
95    ListDicomDirVisit::iterator ItVisit;
96    
97
98    // for future use (Full DICOMDIR)
99 /*
100    /// chained list of DicomDirResults(single level)
101    ListDicomDirResult Results;
102    /// iterator on the DicomDirResults of the current DicomDirStudy
103    ListDicomDirResult::iterator ItResult;
104
105    /// chained list of DicomDirStudyComponents(single level)
106    ListDicomDirStudyComponent StudyComponents;
107    /// iterator on the DicomDirStudyComponents of the current DicomDirStudy
108    ListDicomDirStudyComponent::iterator ItStudyComponents;
109 */
110 };
111 } // end namespace gdcm
112
113 //-----------------------------------------------------------------------------
114 #endif