2 //-----------------------------------------------------------------------------
6 #include "gdcmHeader.h"
7 #include "gdcmCommon.h"
8 #include "gdcmPatient.h"
10 #include "gdcmDicomDirElement.h"
15 //-----------------------------------------------------------------------------
16 typedef std::list<gdcmPatient *> ListPatient;
17 typedef std::vector<gdcmHeader *> ListHeader;
19 //-----------------------------------------------------------------------------
21 * \defgroup gdcmDicomDir
22 * \brief gdcmDicomDir defines an object representing a DICOMDIR in memory.
25 class GDCM_EXPORT gdcmDicomDir: public gdcmParser
28 // gdcmDicomDir(ListTag *l, bool exception_on_error = false);
29 gdcmDicomDir(const char *FileName,
30 bool parseDir = false,
31 bool exception_on_error = false);
35 void SetPrintLevel(int level) { printLevel = level; };
36 virtual void Print(std::ostream &os = std::cout);
38 inline gdcmMeta *GetMeta() {return metaElems;};
39 inline ListPatient &GetPatients() {return patients;};
42 bool Write(std::string fileName);
43 void ParseDirectory(void);
57 void NewDicomDir(std::string path);
58 std::string GetPath(void);
61 void CreateDicomDir(void);
62 void AddObjectToEnd(gdcmDicomDirType type,
63 ListTag::iterator begin,ListTag::iterator end);
64 void AddMetaToEnd (ListTag::iterator begin,ListTag::iterator end);
65 void AddPatientToEnd(ListTag::iterator begin,ListTag::iterator end);
66 void AddStudyToEnd (ListTag::iterator begin,ListTag::iterator end);
67 void AddSerieToEnd (ListTag::iterator begin,ListTag::iterator end);
68 void AddImageToEnd (ListTag::iterator begin,ListTag::iterator end);
70 void SetElements(std::string &path,ListHeader &list);
71 void SetElement (std::string &path,gdcmDicomDirType type,gdcmHeader *header);
73 static bool HeaderLessThan(gdcmHeader *header1,gdcmHeader *header2);
79 //-----------------------------------------------------------------------------