]> Creatis software - gdcm.git/blob - src/gdcmDicomDirPatient.h
Fix mistypings
[gdcm.git] / src / gdcmDicomDirPatient.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirPatient.h,v $
5   Language:  C++
6   Date:      $Date: 2007/08/29 15:30:48 $
7   Version:   $Revision: 1.35 $
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 _GDCMPATIENT_H_
20 #define _GDCMPATIENT_H_
21
22 #include "gdcmDicomDirObject.h"
23
24 namespace GDCM_NAME_SPACE 
25 {
26 class DicomDirStudy;
27
28 //-----------------------------------------------------------------------------
29 typedef std::list<DicomDirStudy*> ListDicomDirStudy;
30
31 //-----------------------------------------------------------------------------
32 /**
33  * \brief   describes a PATIENT within a DICOMDIR (DicomDir)
34  */
35
36 class GDCM_EXPORT DicomDirPatient : public DicomDirObject 
37 {
38    gdcmTypeMacro(DicomDirPatient);
39
40 public:
41 /// \brief Constructs a DicomDirPatient with a RefCounter
42    static DicomDirPatient *New(bool empty=false) {return new DicomDirPatient(empty);}
43
44    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
45    void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements, bool insideSequence );
46   
47    // Patient methods
48    /// \brief Adds a new gdcm::DicomDirStudy to the Patient
49    void AddStudy(DicomDirStudy *obj) { Studies.push_back(obj); }
50    DicomDirStudy *NewStudy(); 
51    void ClearStudy();
52
53    DicomDirStudy *GetFirstStudy();
54    DicomDirStudy *GetNextStudy();
55    DicomDirStudy *GetLastStudy();
56    /// returns the number of Studies currently held in the gdcm::DicomDirPatient
57    int            GetNumberOfStudies() { return Studies.size();}
58    virtual void Copy(DocEntrySet *set);
59
60 protected:
61    DicomDirPatient(bool empty=false); 
62    ~DicomDirPatient();
63
64 private:
65    /// chained list of DicomDirStudy  (to be exploited hierarchicaly)
66    ListDicomDirStudy Studies;
67    /// iterator on the DicomDirStudies of the current DicomDirPatient
68    ListDicomDirStudy::iterator ItStudy;
69 };
70 } // end namespace gdcm
71
72 //-----------------------------------------------------------------------------
73 #endif