2 //-----------------------------------------------------------------------------
6 #include "gdcmHeader.h"
7 #include "gdcmCommon.h"
8 #include "gdcmPatient.h"
9 #include "gdcmDicomDirElement.h"
14 //-----------------------------------------------------------------------------
15 typedef std::list<gdcmPatient *> ListPatient;
16 typedef std::vector<gdcmHeader *> ListHeader;
18 //-----------------------------------------------------------------------------
20 * \defgroup gdcmDicomDir
21 * \brief gdcmDicomDir defines an object representing a DICOMDIR in memory.
24 class GDCM_EXPORT gdcmDicomDir: public gdcmParser
27 // gdcmDicomDir(ListTag *l, bool exception_on_error = false);
28 gdcmDicomDir(const char *FileName, bool parseDir = false,
29 bool exception_on_error = false);
33 void SetPrintLevel(int level) { printLevel = level; };
34 virtual void Print(std::ostream &os = std::cout);
36 inline ListPatient &GetPatients() {return patients;};
39 bool Write(std::string fileName);
40 void ParseDirectory(void);
53 void NewDicomDir(std::string path);
54 std::string GetPath(void);
57 void CreateDicomDir(void);
58 void AddObjectToEnd(gdcmDicomDirType type,ListTag::iterator begin,ListTag::iterator end);
59 void AddPatientToEnd(ListTag::iterator begin,ListTag::iterator end);
60 void AddStudyToEnd(ListTag::iterator begin,ListTag::iterator end);
61 void AddSerieToEnd(ListTag::iterator begin,ListTag::iterator end);
62 void AddImageToEnd(ListTag::iterator begin,ListTag::iterator end);
64 void SetElements(std::string &path,ListHeader &list);
65 void SetElement(std::string &path,gdcmDicomDirType type,gdcmHeader *header);
67 static bool HeaderLessThan(gdcmHeader *header1,gdcmHeader *header2);
72 //-----------------------------------------------------------------------------