]> Creatis software - gdcm.git/commitdiff
ENH: strstream were deprecated around 1998. Need to use stringstream instead. Add...
authormalaterre <malaterre>
Tue, 18 Sep 2007 07:58:38 +0000 (07:58 +0000)
committermalaterre <malaterre>
Tue, 18 Sep 2007 07:58:38 +0000 (07:58 +0000)
Testing/CMakeLists.txt
Testing/VTKTestRead.cxx
Testing/VTKTestReadSeq.cxx
Testing/VTKTestWrite.cxx
Testing/VTKTestWriteSeq.cxx

index aa226784474ee193e8e85f77cec992ebb9a58aba..a6c7b961c0b387be3fb824e4d49adc702facfd97 100644 (file)
@@ -127,6 +127,11 @@ FILE(GLOB GDCM_DATA_IMAGES_GLOB
   "${GDCM_DATA_ROOT}/*.ima"
   )
 
+FILE(GLOB GDCM_DATA_EXTRA_IMAGES_GLOB
+  "${GDCM_DATA_EXTRA_ROOT}/gdcmSampleData/images_of_interest/*.dcm"
+  )
+#MESSAGE(${GDCM_DATA_EXTRA_IMAGES_GLOB})
+
 # Black list of images known to break lots of readers (efilm, xmedcon ...):
 SET(BLACK_LIST
   # Multiframe Papyrus format image
@@ -171,7 +176,7 @@ SET(BLACK_LIST
   "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm"
   
   # Seems this one hangs on 64 bits processors ?!?
-  # I blacklist it untill the pb is solved.
+  # I blacklist it until the pb is solved.
   # (to get some more green on the Dasboards)
   "MR_Philips-Intera_BreaksNOSHADOW.dcm"
   )
@@ -190,8 +195,8 @@ SET(GDCM_DATA_SEQ_IMAGES)
 FOREACH(filename ${GDCM_DATA_IMAGES_GLOB})
   GET_FILENAME_COMPONENT(filename_temp ${filename} NAME)
   IF(DCIODVFY_FOUND)
-    ADD_TEST("DCIODVFY-INPUT-${filename_temp}" "${DCIODVFY_EXECUTABLE}" "${filename}")
-    ADD_TEST("DCIODVFY-OUTPUT-${filename_temp}" "${DCIODVFY_EXECUTABLE}" "${GDCM_DATA_ROOT}/BaselineDicom/${filename_temp}")
+    #ADD_TEST("DCIODVFY-INPUT-${filename_temp}" "${DCIODVFY_EXECUTABLE}" "${filename}")
+    #ADD_TEST("DCIODVFY-OUTPUT-${filename_temp}" "${DCIODVFY_EXECUTABLE}" "${GDCM_DATA_ROOT}/BaselineDicom/${filename_temp}")
   ENDIF(DCIODVFY_FOUND)
   STRING(REGEX MATCH ${filename_temp} bad_dicom ${BLACK_LIST})
   IF(NOT bad_dicom)
@@ -204,6 +209,26 @@ FOREACH(filename ${GDCM_DATA_IMAGES_GLOB})
   ENDIF(NOT bad_dicom)
 ENDFOREACH(filename)
 
+# Paranoid / dcmdump
+IF(GDCM_DCMTK_CHECK)
+FOREACH(filename ${GDCM_DATA_IMAGES_GLOB} ${GDCM_DATA_EXTRA_IMAGES_GLOB})
+  GET_FILENAME_COMPONENT(filename_temp ${filename} NAME)
+  STRING(REGEX MATCH ${filename_temp} bad_dicom ${BLACK_LIST})
+  IF(NOT bad_dicom)
+    IF(BUILD_EXAMPLES)
+      FOREACH(mode a d x) #r
+        FOREACH(opt "" monochrome1 noshadowseq noshadow noseq rgb)
+          ADD_TEST(ReWrite-${mode}-${opt}-${filename_temp} ${EXECUTABLE_OUTPUT_PATH}/ReWrite filein=${filename} fileout=${GDCM_BINARY_DIR}/${mode}-${opt}-${filename_temp} mode=${mode} ${opt})
+          ADD_TEST(dcmdump-${mode}-${opt}-${filename_temp} /usr/bin/dcmdump -E -dc +ae ${GDCM_BINARY_DIR}/${mode}-${opt}-${filename_temp})
+          #ADD_TEST(ReWrite-${mode}-${opt}-${filename_temp}-bis ${EXECUTABLE_OUTPUT_PATH}/ReWrite filein=${GDCM_BINARY_DIR}/${mode}-${opt}-${filename_temp} fileout=${GDCM_BINARY_DIR}/reference.dcm mode=${mode} ${opt})
+          #ADD_TEST(diff-${mode}-${opt}-${filename_temp} /usr/bin/diff ${GDCM_BINARY_DIR}/${mode}-${opt}-${filename_temp} ${GDCM_BINARY_DIR}/reference.dcm)
+        ENDFOREACH(opt)
+      ENDFOREACH(mode)
+    ENDIF(BUILD_EXAMPLES)
+  ENDIF(NOT bad_dicom)
+ENDFOREACH(filename)
+ENDIF(GDCM_DCMTK_CHECK)
+
 # Populate GDCM_DATA_IMAGES:
 FILE(WRITE "${GDCM_BINARY_DIR}/gdcmDataImages.h"
   "const char * const gdcmDataImages[] = { ${GDCM_DATA_IMAGES}\n0 };\n" 
index e1c0b977196d413c29cc1f15cff04779945ad9ed..90f677b61774c8f4194e06768cf018cc7bb046d8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: VTKTestRead.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/02/16 17:02:38 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2007/09/18 07:58:38 $
+  Version:   $Revision: 1.15 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -27,6 +27,7 @@
 #include "vtkPNGWriter.h"
 
 #include <iostream>
+#include <sstream>
 
 //Generated file:
 #include "gdcmDataImages.h"
@@ -147,7 +148,7 @@ int VTKReadTest(vtkTesting *t,vtkImageViewer *viewer,
    //----------------------------------------------------------------------
 
    // make test
-   ostrstream str;
+   std::ostringstream str;
    retVal = t->RegressionTest(image,0.0,str);
    image->UnRegister(NULL);
 
@@ -155,7 +156,6 @@ int VTKReadTest(vtkTesting *t,vtkImageViewer *viewer,
    {
       std::cerr << str.str();
    }
-   str.rdbuf()->freeze(1);
 
    if( retVal == vtkTesting::PASSED )
    {
index 56d3d24c1b72c7ec48a228826d9e4fa278b82613..3a7d262615f8ddae7246cdf41f407609b777b53b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: VTKTestReadSeq.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/09/16 17:19:25 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2007/09/18 07:58:38 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -25,6 +25,7 @@
 #include "vtkImageShiftScale.h"
 
 #include <iostream>
+#include <sstream>
 
 //Generated file:
 #include "gdcmDataSeqImages.h"
@@ -84,7 +85,7 @@ int VTKReadSeqTest(vtkTesting *t, vtkImageViewer *viewer,
 
    // make test
    int ret = 0;
-   ostrstream str;
+   std::ostringstream str;
    char *newFilePng = new char[referenceFileName.size()+1];
    for(int j=0;j<fileCount;j++)
    {
@@ -166,7 +167,6 @@ int VTKReadSeqTest(vtkTesting *t, vtkImageViewer *viewer,
       {
          std::cerr << str.str();
       }
-      str.rdbuf()->freeze(1);
 
       if( retVal == vtkTesting::PASSED )
       {
index 34bfd060fe0a0d98f7687cab18bda8c2c971c4d9..9f2aa9beed3809b97ac16324c899a4e486bb9cbe 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: VTKTestWrite.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/09/08 14:40:15 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2007/09/18 07:58:38 $
+  Version:   $Revision: 1.12 $
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -26,6 +26,7 @@
 #include "vtkImageShiftScale.h"
 
 #include <iostream>
+#include <sstream>
 
 //Generated file:
 #include "gdcmDataImages.h"
@@ -170,7 +171,7 @@ int VTKWriteTest(vtkTesting *t,vtkImageViewer *viewer,
    //----------------------------------------------------------------------
 
    // make test
-   ostrstream str;
+   std::ostringstream str;
    retVal = t->RegressionTest(image,0.0,str);
    image->UnRegister(NULL);
 
@@ -178,7 +179,6 @@ int VTKWriteTest(vtkTesting *t,vtkImageViewer *viewer,
    {
       std::cerr << str.str();
    }
-   str.rdbuf()->freeze(1);
 
    if( retVal == vtkTesting::PASSED )
    {
index f33012eedf4053fd77ec7de208aaba0197be08ac..debaf8c427489005ce1205e79e5c5a1d436b8e1e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: VTKTestWriteSeq.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/06/21 14:59:06 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2007/09/18 07:58:39 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -26,6 +26,7 @@
 #include "vtkImageShiftScale.h"
 
 #include <iostream>
+#include <sstream>
 
 //Generated file:
 #include "gdcmDataSeqImages.h"
@@ -107,7 +108,7 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer,
 
    // make test
    int ret = 0;
-   ostrstream str;
+   std::ostringstream str;
    char *newFilePng = new char[referenceFileName.size()+1];
    for(int j=0;j<fileCount;j++)
    {
@@ -189,7 +190,6 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer,
       {
          std::cerr << str.str();
       }
-      str.rdbuf()->freeze(1);
 
       if( retVal == vtkTesting::PASSED )
       {