X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestAllReadCompareDicom.cxx;h=bb428fd0903b006f0668f019cf88ece83c7c53fe;hb=928d3c30e40ab7f3d12bfd038ce8a48befcddce8;hp=1ac5df48b66e32f8d898eb8e5bee8de3c814ccea;hpb=d7625b1d78115d3d2e8dc1d2dd4169820eaf2639;p=gdcm.git diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index 1ac5df48..bb428fd0 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllReadCompareDicom.cxx,v $ Language: C++ - Date: $Date: 2005/07/06 09:53:43 $ - Version: $Revision: 1.43 $ + Date: $Date: 2005/10/18 08:35:46 $ + Version: $Revision: 1.48 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -396,16 +396,23 @@ int InternalTest(std::string const &filename, ////// Step 1: std::cout << "1..."; - gdcm::FileHelper *tested = new gdcm::FileHelper( filename ); - if( !tested->GetFile()->IsReadable() ) + + // new style + gdcm::File *f = new gdcm::File(); + f->SetLoadMode ( gdcm::LD_ALL ); // Load everything + f->SetFileName( filename ); + f->Load(); + + if( !f->IsReadable() ) { std::cout << " Failed" << std::endl << " Image not gdcm compatible:" << filename << std::endl; - delete tested; + delete f; return 1; } - + gdcm::FileHelper *tested = new gdcm::FileHelper( f ); + ////// Step 2: ////// Check for existence of reference baseline dicom file: std::cout << "2..."; @@ -437,6 +444,7 @@ int InternalTest(std::string const &filename, << filename << std::endl; delete reference; delete tested; + delete f; return 1; } @@ -464,6 +472,7 @@ int InternalTest(std::string const &filename, << reference->GetZSize() << std::endl; delete reference; delete tested; + delete f; return 1; } @@ -476,9 +485,11 @@ int InternalTest(std::string const &filename, << " Scalar size: " << tested->GetFile()->GetPixelSize() << " # " << reference->GetScalarSize() << std::endl << " Number of scalar: " << tested->GetFile()->GetNumberOfScalarComponents() << " # " - << reference->GetNumberOfComponents() << std::endl; + << reference->GetNumberOfComponents() << std::endl + << " Pixel type: " << tested->GetFile()->GetPixelType() << std::endl; delete reference; delete tested; + delete f; return 1; } @@ -498,6 +509,7 @@ int InternalTest(std::string const &filename, << std::endl; delete tested; delete reference; + delete f; return 1; } @@ -536,12 +548,14 @@ int InternalTest(std::string const &filename, delete tested; delete reference; + delete f; return 1; } //////////////// Clean up: delete tested; delete reference; + delete f; std::cout << "OK." << std::endl;