+ return 0;
+}
+
+int TestReadWriteReadCompare(int argc, char* argv[])
+{
+ int result = 0;
+ if (argc == 3)
+ {
+ const std::string input = argv[1];
+ const std::string output = argv[2];
+ result += CompareInternal(input, output);
+ }
+ else if( argc > 3 || argc == 2 )
+ {
+ std::cerr << "Please read the manual" << std::endl;
+ }
+ else
+ {
+ std::cout<< "Test::TestReadWriteReadCompare: description " << std::endl;
+ std::cout << " For all images in gdcmData (and not blacklisted in "
+ "Test/CMakeLists.txt)" << std::endl;
+ std::cout << " apply the following multistep test: " << std::endl;
+ std::cout << " step 1: parse the image (as gdcmHeader) and call"
+ << " IsReadable(). " << std::endl;
+ std::cout << " step 2: write the corresponding image in DICOM V3 "
+ << "with explicit" << std::endl
+ << " Value Representation in temporary file "
+ << "TestReadWriteReadCompare.dcm." << std::endl;
+ std::cout << " step 3: read the image written on step2 and call "
+ << " IsReadable(). " << std::endl;
+ std::cout << " step 4: compare (in memory with memcmp) that the two "
+ << "images " << std::endl
+ << " match (as expanded by gdcm)." << std::endl;
+
+ int i = 0;
+ while( gdcmDataImages[i] != 0 )
+ {
+ std::string filename = GDCM_DATA_ROOT;
+ filename += "/";
+ filename += gdcmDataImages[i++];
+ result += CompareInternal(filename, "TestReadWriteReadCompare.dcm");
+ }
+ }
+ return result;