From: jpr Date: Thu, 12 Apr 2007 13:06:02 +0000 (+0000) Subject: To allow testsuite go on. X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d9ac99c203134d9aa1ced194746748bbb1e005ac;p=gdcm.git To allow testsuite go on. --- diff --git a/Testing/TestBuildUpDicomDir.cxx b/Testing/TestBuildUpDicomDir.cxx index a30c88c5..5eafdbe8 100644 --- a/Testing/TestBuildUpDicomDir.cxx +++ b/Testing/TestBuildUpDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestBuildUpDicomDir.cxx,v $ Language: C++ - Date: $Date: 2006/04/11 16:05:03 $ - Version: $Revision: 1.9 $ + Date: $Date: 2007/04/12 13:06:02 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -40,7 +40,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) std::cerr << "Usage: " << argv[0] << " dummy " << std::endl; } - //gdcm::Debug::DebugOn(); + // gdcm::Debug::DebugOn(); bool errorFound = false; gdcm::DicomDir *dcmdir; @@ -49,6 +49,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) dcmdir = gdcm::DicomDir::New(); gdcm::DicomDirPatient *p1; + // --- Forget these 4 lines : // just to improve test coverage. p1=dcmdir->GetFirstPatient(); @@ -116,7 +117,6 @@ int TestBuildUpDicomDir(int argc, char *argv[]) // Let's create and add a Image for this Serie s1111 = s111->NewImage(); s1111->SetEntryString("imageFileName1111",0x0004,0x1500); - gdcm::DicomDirImage *s1112 = s111->NewImage(); s1112->SetEntryString("imageFileName1112",0x0004,0x1500); @@ -161,11 +161,23 @@ int TestBuildUpDicomDir(int argc, char *argv[]) // Print std::cout << "Test/BuildUpDicomDir: Test Print of patients\n"; p1->Print(); - std::cout << "Test/BuildUpDicomDir: -------------------\n"; + std::cout << "Test/BuildUpDicomDir: end of P1-------------------\n"; p2->Print(); - std::cout << "Test/BuildUpDicomDir: -------------------\n"; + std::cout << "Test/BuildUpDicomDir: end of P2-------------------\n"; p3->Print(); + std::cout << "Test/BuildUpDicomDir: end of P3-------------------\n"; std::cout << "Test/BuildUpDicomDir: Test Print of patients ended\n"; + + + // Let's loop on Patients. + gdcm::DicomDirPatient *p; + p=dcmdir->GetFirstPatient(); + while (p) { + std::cout << "one more patient\n"; + p->Print(); + p=dcmdir->GetNextPatient(); + } + if( !dcmdir->IsReadable() ) { diff --git a/Testing/TestDicomDir.cxx b/Testing/TestDicomDir.cxx index 478ed758..5690f519 100644 --- a/Testing/TestDicomDir.cxx +++ b/Testing/TestDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDicomDir.cxx,v $ Language: C++ - Date: $Date: 2007/03/23 15:03:01 $ - Version: $Revision: 1.44 $ + Date: $Date: 2007/04/12 13:06:02 $ + Version: $Revision: 1.45 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -105,6 +105,9 @@ int TestDicomDir(int argc, char *argv[]) file += "/DICOMDIR"; } + std::cout << "DicomDir we're going to deal with : ["<< file << "]" + << std::endl; + dicomdir = gdcm::DicomDir::New(); dicomdir->SetFileName(file); dicomdir->Load(); @@ -178,12 +181,22 @@ int TestDicomDir(int argc, char *argv[]) pa1 = dicomdir->GetNextPatient(); } +/* +// this one is *really* too much verbose! + std::cout << std::endl << std::endl << " = DICOMDIR full content ====================================" << std::endl<< std::endl; - // dicomdir->Print(); - + dicomdir->Print(); + std::cout << std::endl << std::endl + << " = end of DICOMDIR full content ====================================" + << std::endl<< std::endl; +*/ // ------------------------- second stage --------------------------- + + + gdcm::Debug::DebugOn(); + // Write on disc what we read dicomdir->Write("NewDICOMDIR"); diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 3bb58718..dae78e85 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2007/04/12 10:43:42 $ - Version: $Revision: 1.191 $ + Date: $Date: 2007/04/12 13:06:03 $ + Version: $Revision: 1.192 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -127,7 +127,7 @@ DicomDir::DicomDir() { Initialize(); // sets all private fields to NULL ParseDir = false; - // NewMeta(); + NewMeta(); } //#ifndef GDCM_LEGACY_REMOVE @@ -252,7 +252,6 @@ bool DicomDir::DoTheLoadingJob( ) } else { - NewMeta(); CreateDicomDir(); } }