]> Creatis software - gdcm.git/blobdiff - Example/TestReadWriteReadCompare.cxx
* src/*.cxx *.h Reference to License.htm fixed to License.html.
[gdcm.git] / Example / TestReadWriteReadCompare.cxx
index 5ea15b8ca7c9775cf2e0baf8dae63e6677c39a29..3732918a9882f83d04fa065881b642834c14d030 100644 (file)
@@ -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)