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