X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestAllReadCompareDicom.cxx;h=353c567efd6d4731eebac6c337f2a95b0ab397de;hb=da7267a79f682bd94e49e7fa3497a356dcd304e8;hp=f00906cfcfe53abca96129974ed0a4fd297c4f9b;hpb=7fe25e72be2a9851dea9a9a031369877338ede0c;p=gdcm.git diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index f00906cf..353c567e 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/05/02 17:51:57 $ - Version: $Revision: 1.41 $ + Date: $Date: 2005/07/11 08:50:48 $ + 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 @@ -20,6 +20,7 @@ #include "gdcmFileHelper.h" #include "gdcmGlobal.h" #include "gdcmTS.h" +#include "gdcmDebug.h" #include @@ -395,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 ( 0x00000000 ); // 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..."; @@ -436,6 +444,7 @@ int InternalTest(std::string const &filename, << filename << std::endl; delete reference; delete tested; + delete f; return 1; } @@ -463,6 +472,7 @@ int InternalTest(std::string const &filename, << reference->GetZSize() << std::endl; delete reference; delete tested; + delete f; return 1; } @@ -478,7 +488,7 @@ int InternalTest(std::string const &filename, << reference->GetNumberOfComponents() << std::endl; delete reference; delete tested; - return 1; + delete f; } // Test the data size @@ -497,6 +507,7 @@ int InternalTest(std::string const &filename, << std::endl; delete tested; delete reference; + delete f; return 1; } @@ -515,9 +526,11 @@ int InternalTest(std::string const &filename, << " compression : " << gdcm::Global::GetTS()->GetValue(ts) << std::endl; - std::cout << " list of pixels differing (pos : test - ref) :" + std::cout << " list of the first " << MAX_NUMBER_OF_DIFFERENCE + << " pixels differing (pos : test - ref) :" << std::endl; - int i,j; + int i; + unsigned int j; for(i=0, j=0;i= 3 ) { // The test is specified a specific filename, use it instead of looping // over all images @@ -555,7 +573,7 @@ int TestAllReadCompareDicom(int argc, char *argv[]) const std::string reference = argv[2]; return InternalTest( input, reference ); } - else if ( argc > 3 || argc == 2 ) + else if ( argc > 4 || argc == 2 ) { std::cerr << " Usage: " << argv[0] << " (no arguments needed)." << std::endl;