2 //-----------------------------------------------------------------------------
6 //#include "gdcmHeader.h"
7 #include "gdcmCommon.h"
8 #include "gdcmDocument.h"
9 #include "gdcmDicomDirPatient.h"
10 #include "gdcmDicomDirMeta.h"
11 #include "gdcmDicomDirElement.h"
16 //-----------------------------------------------------------------------------
17 typedef std::list<gdcmDicomDirPatient *> ListDicomDirPatient;
18 typedef std::vector<gdcmDocument *> VectDocument;
20 typedef GDCM_EXPORT void(gdcmMethod)(void * = NULL);
21 //-----------------------------------------------------------------------------
24 * \ingroup gdcmDicomDir
25 * \brief gdcmDicomDir defines an object representing a DICOMDIR in memory.
28 class GDCM_EXPORT gdcmDicomDir: public gdcmDocument
31 // gdcmDicomDir(ListTag *l,
32 // bool exception_on_error = false);
33 gdcmDicomDir(const char *FileName,
34 bool parseDir = false,
35 bool exception_on_error = false);
36 gdcmDicomDir(bool exception_on_error = false);
41 * \ingroup gdcmDicomDir
42 * \brief Sets the print level for the Dicom Header
43 * \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
45 void SetPrintLevel(int level)
46 { printLevel = level; };
48 * \ingroup gdcmDicomDir
49 * \brief canonical Printer
52 virtual void Print(std::ostream &os = std::cout);
54 // Informations contained in the parser
55 virtual bool IsReadable(void);
57 /// \brief returns a pointer to the gdcmDicomDirMeta for this DICOMDIR.
58 inline gdcmDicomDirMeta *GetDicomDirMeta()
61 /// \brief returns the PATIENT chained List for this DICOMDIR.
62 inline ListDicomDirPatient &GetDicomDirPatients()
66 void ParseDirectory(void);
68 void SetStartMethod(gdcmMethod *,void * =NULL,gdcmMethod * =NULL);
69 void SetStartMethodArgDelete(gdcmMethod *);
70 void SetProgressMethod(gdcmMethod *,void * =NULL,gdcmMethod * =NULL);
71 void SetProgressMethodArgDelete(gdcmMethod *);
72 void SetEndMethod(gdcmMethod *,void * =NULL,gdcmMethod * =NULL);
73 void SetEndMethodArgDelete(gdcmMethod *);
75 /// \brief GetProgress GetProgress
76 inline float GetProgress(void)
79 /// \brief AbortProgress AbortProgress
80 inline void AbortProgress(void)
83 /// \brief IsAborted IsAborted
84 inline bool IsAborted(void)
88 gdcmDicomDirMeta * NewMeta(void);
89 gdcmDicomDirPatient * NewPatient(void);
92 void WriteEntries(FILE *_fp);
93 bool Write(std::string fileName);
95 /// Types of the gdcmObject within the gdcmDicomDir
100 GDCM_DICOMDIR_PATIENT,
107 void CreateDicomDirChainedList(std::string path);
109 void CallStartMethod(void);
110 void CallProgressMethod(void);
111 void CallEndMethod(void);
114 void CreateDicomDir(void);
115 // void AddObjectToEnd(gdcmDicomDirType type, gdcmSQItem *s);
116 void AddDicomDirMeta ();
117 void AddDicomDirPatientToEnd(gdcmSQItem *s);
118 void AddDicomDirStudyToEnd (gdcmSQItem *s);
119 void AddDicomDirSerieToEnd (gdcmSQItem *s);
120 void AddDicomDirImageToEnd (gdcmSQItem *s);
122 void SetElements(std::string &path, VectDocument &list);
123 void SetElement (std::string &path,gdcmDicomDirType type,
124 gdcmDocument *header);
126 void UpdateDirectoryRecordSequenceLength(void);
128 static bool HeaderLessThan(gdcmDocument *header1,gdcmDocument *header2);
132 /// \brief pointer on *the* gdcmObject 'DicomDirMeta Elements'
133 gdcmDicomDirMeta *metaElems;
135 /// \brief chained list of DicomDirPatient (to be exploited recursively)
136 ListDicomDirPatient patients;
138 /// pointer to the initialisation method for any progress bar
139 gdcmMethod *startMethod;
140 /// pointer to the incrementation method for any progress bar
141 gdcmMethod *progressMethod;
142 /// pointer to the tremination method for any progress bar
143 gdcmMethod *endMethod;
144 /// pointer to the ??? method for any progress bar
145 gdcmMethod *startMethodArgDelete;
146 /// pointer to the ??? method for any progress bar
147 gdcmMethod *progressMethodArgDelete;
148 /// pointer to the ??? method for any progress bar
149 gdcmMethod *endMethodArgDelete;
150 /// pointer to the ??? for any progress bar
152 /// pointer to the ??? for any progress bar
154 /// pointer to the ??? for any progress bar
156 /// value of the ??? for any progress bar
158 /// value of the ??? for any progress bar
162 //-----------------------------------------------------------------------------