X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestDicomDir.cxx;h=ea6b686eeaa598395a1c46dc1ff1a424078f1887;hb=3d5f18344f54d20b3a66cce87727c7970bfdded4;hp=b3d6ad38af95b3cc40c82c1c2c5d36eb43ff48b5;hpb=4749d8cd98a478da05763e582dc68d5f501736bd;p=gdcm.git diff --git a/Testing/TestDicomDir.cxx b/Testing/TestDicomDir.cxx index b3d6ad38..ea6b686e 100644 --- a/Testing/TestDicomDir.cxx +++ b/Testing/TestDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/17 13:47:23 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/01/24 16:10:50 $ + Version: $Revision: 1.32 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -70,8 +70,7 @@ int TestDicomDir(int argc, char* argv[]) } // Test if the DicomDir contains any Patient - e1->InitTraversal(); - if( !e1->GetNextEntry() ) + if( !e1->GetFirstPatient() ) { std::cout<<" DicomDir '"<InitTraversal(); - pa = e1->GetNextEntry(); - while ( pa ) { // we process all the PATIENT of this DICOMDIR - std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name - pa->InitTraversal(); - st = pa->GetNextEntry(); - while ( st ) { // we process all the STUDY of this patient - std::cout << "--- "<< st->GetEntry(0x0008, 0x1030) << std::endl; // Study Description - std::cout << " Stud.ID:[" << st->GetEntry(0x0020, 0x0010); // Study ID - st->InitTraversal(); - se = st->GetNextEntry(); - while ( se ) { // we process all the SERIES of this study - std::cout << "--- --- "<< se->GetEntry(0x0008, 0x103e) << std::endl; // Serie Description - std::cout << " Ser.nb:[" << se->GetEntry(0x0020, 0x0011); // Series number - std::cout << "] Mod.:[" << se->GetEntry(0x0008, 0x0060) << "]"; // Modality - se->InitTraversal(); - im = se->GetNextEntry(); + pa = e1->GetFirstPatient(); + while ( pa ) + { // we process all the PATIENT of this DICOMDIR + std::cout << pa->GetEntryValue(0x0010, 0x0010) << std::endl; // Patient's Name + + st = pa->GetFirstStudy(); + while ( st ) + { // we process all the STUDY of this patient + std::cout << "--- "<< st->GetEntryValue(0x0008, 0x1030) << std::endl; // Study Description + std::cout << " Stud.ID:[" << st->GetEntryValue(0x0020, 0x0010); // Study ID + + se = st->GetFirstSerie(); + while ( se ) + { // we process all the SERIES of this study + std::cout << "--- --- "<< se->GetEntryValue(0x0008, 0x103e) << std::endl; // Serie Description + std::cout << " Ser.nb:[" << se->GetEntryValue(0x0020, 0x0011); // Series number + std::cout << "] Mod.:[" << se->GetEntryValue(0x0008, 0x0060) << "]"; // Modality + + im = se->GetFirstImage(); while ( im ) { // we process all the IMAGE of this serie - std::cout << "--- --- --- "<< im->GetEntry(0x0004, 0x1500) << std::endl; // File name - im = se->GetNextEntry(); + std::cout << "--- --- --- "<< im->GetEntryValue(0x0004, 0x1500) << std::endl; // File name + im = se->GetNextImage(); } - se = st->GetNextEntry(); + se = st->GetNextSerie(); } - st = pa->GetNextEntry(); - } - pa = e1->GetNextEntry(); - } - - + st = pa->GetNextStudy(); + } + pa = e1->GetNextPatient(); + } + std::cout << std::endl << std::endl << " = DICOMDIR full content ====================================" << std::endl<< std::endl;