X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestReadWriteReadCompare.cxx;h=3732918a9882f83d04fa065881b642834c14d030;hb=fd37aa842b5d31ca266b6bda8a77f3201d02338d;hp=5ea15b8ca7c9775cf2e0baf8dae63e6677c39a29;hpb=770d6ef4630d6243dba1813a75c3dc2f62668a8c;p=gdcm.git diff --git a/Example/TestReadWriteReadCompare.cxx b/Example/TestReadWriteReadCompare.cxx index 5ea15b8c..3732918a 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; @@ -28,16 +28,17 @@ int main(int argc, char* argv[]) << "images " << std::endl << " match (as expanded by gdcm)." << std::endl; - int i = 0; - while( gdcmDataImages[i] != 0 ) + //int 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() ) @@ -53,7 +54,7 @@ int main(int argc, char* argv[]) gdcmFile* file = new gdcmFile( header ); int dataSize = file->GetImageDataSize(); - void* imageData = file->GetImageData(); //EXTREMELY IMPORTANT + uint8_t* imageData = file->GetImageData(); //EXTREMELY IMPORTANT // Sure, it is : It's up to the user to decide if he wants to // GetImageData or if he wants to GetImageDataRaw // (even if we do it by setting a flag, he will have to decide)