]> Creatis software - gdcm.git/blob - src/gdcmDicomDirStudy.h
2005-01-15 Jean-Pierre Roux <jpr@creatis.univ-lyon1.fr>
[gdcm.git] / src / gdcmDicomDirStudy.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirStudy.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/17 10:59:52 $
7   Version:   $Revision: 1.18 $
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 //-----------------------------------------------------------------------------
28 typedef std::list<DicomDirSerie *> ListDicomDirSerie;
29
30 //-----------------------------------------------------------------------------
31 /**
32  * \brief   describes a STUDY within a within a PATIENT
33  * (DicomDirPatient) of a given DICOMDIR (DicomDir)
34  */
35 class GDCM_EXPORT DicomDirStudy : public DicomDirObject
36 {
37 public:
38    DicomDirStudy(); 
39    ~DicomDirStudy();
40
41    void Print(std::ostream &os = std::cout, std::string const & indent = "" );
42    void WriteContent(std::ofstream *fp, FileType t);
43
44     // TODO Remove GetDicomDirSeries
45     // use InitTraversal + GetNextEntry instead.
46
47     /// Returns the SERIE chained List for this STUDY.
48    ListDicomDirSerie const &GetDicomDirSeries() const { return Series; };
49
50    // should avoid exposing internal mechanism
51    void InitTraversal();
52    DicomDirSerie *GetNextEntry();
53
54    /// adds the passed SERIE to the SERIE chained List for this STUDY.
55    void AddDicomDirSerie(DicomDirSerie *obj) { Series.push_back(obj); };
56
57    DicomDirSerie* NewSerie();
58     
59 private:
60
61    /// chained list of DicomDirSeries (to be exploited recursively)
62    ListDicomDirSerie Series;
63    /// iterator on the DicomDirSeries of the current DicomDirStudy
64    ListDicomDirSerie::iterator ItDicomDirSerie;
65
66 };
67 } // end namespace gdcm
68
69 //-----------------------------------------------------------------------------
70 #endif