]> Creatis software - gdcm.git/blob - src/gdcmDicomDir.h
some DICOMDIR writting purpose modif
[gdcm.git] / src / gdcmDicomDir.h
1 // gdcmDICOMDIR.h
2 //-----------------------------------------------------------------------------
3 #ifndef GDCMDICOMDIR_H
4 #define GDCMDICOMDIR_H
5
6 #include "gdcmHeader.h"
7 #include "gdcmCommon.h"
8 #include "gdcmPatient.h"
9
10 //-----------------------------------------------------------------------------
11 typedef std::list<gdcmPatient *> ListPatient;
12
13 //-----------------------------------------------------------------------------
14 /*
15  * \defgroup gdcmDicomDir
16  * \brief    gdcmDicomDir defines an object representing a DICOMDIR in memory.
17  *
18  */
19 class GDCM_EXPORT gdcmDicomDir: public gdcmParser 
20 {
21 public:
22    gdcmDicomDir(ListTag *l,           bool exception_on_error = false);
23    gdcmDicomDir(std::string &FileName,bool exception_on_error = false);
24    
25    ~gdcmDicomDir(void);
26
27    void SetPrintLevel(int level) { printLevel = level; };
28    virtual void Print(std::ostream &os = std::cout);
29
30    inline ListPatient &GetPatients() {return patients;};
31    bool   Write(std::string fileName);
32
33
34    typedef enum
35    {
36       GDCM_NONE,
37       GDCM_PATIENT,
38       GDCM_STUDY,
39       GDCM_SERIE,
40       GDCM_IMAGE,
41    } gdcmDicomDirType;
42    
43 private:
44    void CreateDicomDir(void);
45    void AddObjectToEnd(gdcmDicomDirType type,ListTag::iterator begin,ListTag::iterator end);
46    void AddPatientToEnd(ListTag::iterator begin,ListTag::iterator end);
47    void AddStudyToEnd(ListTag::iterator begin,ListTag::iterator end);
48    void AddSerieToEnd(ListTag::iterator begin,ListTag::iterator end);
49    void AddImageToEnd(ListTag::iterator begin,ListTag::iterator end);
50
51    ListPatient patients;
52 };
53
54 //-----------------------------------------------------------------------------
55 #endif