3 #include "gdcmDocEntry.h"
4 #include "gdcmDicomDir.h"
5 #include "gdcmDicomDirPatient.h"
6 #include "gdcmDirList.h"
9 #ifdef GDCM_NO_ANSI_STRING_STREAM
11 # define ostringstream ostrstream
16 #define ostringstream ostrstream
18 #include <sys/types.h>
34 void StartMethod(void *toto) {
36 std::cout<<"Start parsing"<<std::endl;
39 void EndMethod(void *toto) {
41 std::cout<<"End parsing"<<std::endl;
47 * \brief Explores recursively the given directory (or GDCM_DATA_ROOT by default)
48 * orders the gdcm-readable found Files
49 * according their Patient/Study/Serie/Image characteristics
50 * makes the gdcmDicomDir
51 * and writes a file named NewDICOMDIR..
54 int main(int argc, char* argv[]) {
61 dirName = GDCM_DATA_ROOT;
63 dcmdir=new gdcmDicomDir(dirName, true); // we ask for Directory parsing
65 dcmdir->SetStartMethod(StartMethod, (void *) NULL);
66 dcmdir->SetEndMethod(EndMethod);
68 ListDicomDirPatient lp = dcmdir->GetDicomDirPatients();
71 std::cout << "makeDicomDir: no patient list present. Exiting."
76 dcmdir->WriteDicomDir("NewDICOMDIR");
77 std::cout<<std::flush;