]> Creatis software - gdcm.git/commitdiff
* Amelioration of TestAllReadCompareDicom
authorregrain <regrain>
Wed, 27 Apr 2005 09:14:06 +0000 (09:14 +0000)
committerregrain <regrain>
Wed, 27 Apr 2005 09:14:06 +0000 (09:14 +0000)
   -- BeNours

ChangeLog
Testing/TestAllReadCompareDicom.cxx

index 3ab26bed85070a319ba17dc7088350f5c4a92ee6..782fc07203a0ab0293ae7da2d0ab12b740e028c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,14 @@
+2005-04-26 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+   * Testing/TestAllReadCompareDicom.cxx : update the test printed results and
+     description.
+
 2005-04-20 Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
    * FIX : Numerical exception on borland (cannot divide by 0, doh !)
                 But this is a case where we should really signify the user there is
                                         few chance the serie is really a serie...
 
 2005-04-20 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
-   * FIX : on X, the python part is correctly installed. All files are 
+   * FIX : on X, the python part is correctly installed. All files are
      installed in gdcm sub-directory
 
 2005-04-19 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
index 56f5646b85814d3ae0bbb79aa6b1cabc31154077..e3212a8500d8e324459ea0b9014bfd7683a51334 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestAllReadCompareDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/19 10:05:36 $
-  Version:   $Revision: 1.39 $
+  Date:      $Date: 2005/04/27 09:14:06 $
+  Version:   $Revision: 1.40 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -18,6 +18,8 @@
 #include "gdcmDirList.h"
 #include "gdcmFile.h"
 #include "gdcmFileHelper.h"
+#include "gdcmGlobal.h"
+#include "gdcmTS.h"
 
 #include <iostream>
 
@@ -502,11 +504,28 @@ int InternalTest(std::string const &filename,
                            testedDataSize) != 0 )
       {
          (void)res;
+         std::string ts  = tested->GetFile()->GetTransferSyntax();
+
          std::cout << " Failed" << std::endl
                    << "        pixel (" 
                    << PixelType
                    << ") differ (as expanded in memory)."
+                   << std::endl
+                   << "        compression : " 
+                   << gdcm::Global::GetTS()->GetValue(ts) << std::endl;
+
+         std::cout << "        list of pixels differing (pos : test - ref) :" 
                    << std::endl;
+         for(int i=0;i<testedDataSize;i++)
+         {
+            if(testedImageData[i]!=referenceImageData[i])
+               std::cout << std::hex << "(" << i << " : " 
+                         << std::hex << (int)(testedImageData[i]) << " - "
+                         << std::hex << (int)(referenceImageData[i]) << ") "
+                         << std::dec;
+         }
+         std::cout << std::endl;
+
          delete tested;
          delete reference;
          return 1;
@@ -551,23 +570,18 @@ int TestAllReadCompareDicom(int argc, char *argv[])
    std::cout << "   step 1: parse the image (as gdcmFile) and call"
              << " IsReadable(). "
              << std::endl;
-   std::cout << "   step 2: find in GDCM_DATA_ROOT/BaselineDicom/filename.dcm"
-             << std::endl
-             << "           (with format DICOM V3, explicit Value"
-             << "Representation)"
-             << std::endl;
-   std::cout << "   step 3a: when image NOT found on step 2, write "
+   std::cout << "   step 2: find in GDCM_DATA_ROOT/BaselineDicom/filename.tst"
              << std::endl
-             << "            GDCM_DATA_ROOT/BaselineDicom/filename.dcm"
+             << "           special internal file format containing the"
              << std::endl
-             << "           (with format DICOM V3, explicit Value"
-             << "Representation)"
+             << "           caracteristic of the image and the pixel datas "
+             << "(uncompressed). This file is written if it's not found."
              << std::endl;
-   std::cout << "   step 3b: when image found on step 2, and when IsReadable()"
+   std::cout << "   step 3: compare the DICOM image with the reference image"
              << std::endl
-             << "            compare it (in memory with memcmp) with the"
+             << "           (.tst file). The test is made on the caracteristics"
              << std::endl
-             << "            image we are testing (the one of step 1). "
+             << "           of the image and the pixel datas"
              << std::endl << std::endl;
 
    int i = 0;