1 /*=========================================================================
4 Module: $RCSfile: makeDicomDir.cxx,v $
6 Date: $Date: 2004/12/03 20:16:56 $
7 Version: $Revision: 1.9 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
18 #include "gdcmDocEntry.h"
19 #include "gdcmDicomDir.h"
20 #include "gdcmDicomDirPatient.h"
21 #include "gdcmDirList.h"
26 void StartMethod(void *toto) {
28 std::cout<<"Start parsing"<<std::endl;
31 void EndMethod(void *toto) {
33 std::cout<<"End parsing"<<std::endl;
39 * \brief Explores recursively the given directory (or GDCM_DATA_ROOT by default)
40 * orders the gdcm-readable found Files
41 * according their Patient/Study/Serie/Image characteristics
42 * makes the gdcmDicomDir
43 * and writes a file named NewDICOMDIR..
46 int main(int argc, char* argv[]) {
47 gdcm::DicomDir *dcmdir;
53 dirName = GDCM_DATA_ROOT;
55 dcmdir = new gdcm::DicomDir(dirName, true); // we ask for Directory parsing
57 dcmdir->SetStartMethod(StartMethod, (void *) NULL);
58 dcmdir->SetEndMethod(EndMethod);
60 gdcm::ListDicomDirPatient lp = dcmdir->GetDicomDirPatients();
63 std::cout << "makeDicomDir: no patient list present. Exiting."
68 dcmdir->WriteDicomDir("NewDICOMDIR");
69 std::cout<<std::flush;