From: jpr Date: Mon, 20 Sep 2004 18:33:32 +0000 (+0000) Subject: Example/TestReadWriteReadCompare may now be called with command line parameters X-Git-Tag: Version0.6.bp~193 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ba5743102096cf8cd08d153b78f5ed120f1dfdd3;p=gdcm.git Example/TestReadWriteReadCompare may now be called with command line parameters (I said : EXAMPLE/Test... ) --- diff --git a/Example/TestReadWriteReadCompare.cxx b/Example/TestReadWriteReadCompare.cxx index 5ea15b8c..574537e8 100644 --- a/Example/TestReadWriteReadCompare.cxx +++ b/Example/TestReadWriteReadCompare.cxx @@ -6,10 +6,10 @@ int main(int argc, char* argv[]) { - if (argc) + if (argc<2) { std::cerr << "Test::TestReadWriteReadCompare: Usage: " << argv[0] - << " (no arguments needed)." << std::endl; + << " fileToCheck.dcm " << std::endl; } std::cout<< "Test::TestReadWriteReadCompare: description " << std::endl; @@ -29,15 +29,16 @@ int main(int argc, char* argv[]) << " match (as expanded by gdcm)." << std::endl; int i = 0; - while( gdcmDataImages[i] != 0 ) + //while( gdcmDataImages[i] != 0 ) { std::string filename = GDCM_DATA_ROOT; filename += "/"; - filename += gdcmDataImages[i++]; + //filename += gdcmDataImages[i++]; + filename +=argv[1]; std::cout << " Testing: " << filename << std::endl; - //////////////// Step 1 (see above description): + //////////////// Step 1 (see above description): gdcmHeader *header = new gdcmHeader( filename ); if( !header->IsReadable() )