From: malaterre Date: Tue, 18 Sep 2007 07:58:38 +0000 (+0000) Subject: ENH: strstream were deprecated around 1998. Need to use stringstream instead. Add... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=df1a3b45849af2e3d6ee4f616e5d5b88f3b4b5a6;p=gdcm.git ENH: strstream were deprecated around 1998. Need to use stringstream instead. Add dcmdump+reWrite to check consistency --- diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index aa226784..a6c7b961 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -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" diff --git a/Testing/VTKTestRead.cxx b/Testing/VTKTestRead.cxx index e1c0b977..90f677b6 100644 --- a/Testing/VTKTestRead.cxx +++ b/Testing/VTKTestRead.cxx @@ -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 +#include //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 ) { diff --git a/Testing/VTKTestReadSeq.cxx b/Testing/VTKTestReadSeq.cxx index 56d3d24c..3a7d2626 100644 --- a/Testing/VTKTestReadSeq.cxx +++ b/Testing/VTKTestReadSeq.cxx @@ -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 +#include //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;jfreeze(1); if( retVal == vtkTesting::PASSED ) { diff --git a/Testing/VTKTestWrite.cxx b/Testing/VTKTestWrite.cxx index 34bfd060..9f2aa9be 100644 --- a/Testing/VTKTestWrite.cxx +++ b/Testing/VTKTestWrite.cxx @@ -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 +#include //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 ) { diff --git a/Testing/VTKTestWriteSeq.cxx b/Testing/VTKTestWriteSeq.cxx index f33012ee..debaf8c4 100644 --- a/Testing/VTKTestWriteSeq.cxx +++ b/Testing/VTKTestWriteSeq.cxx @@ -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 +#include //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;jfreeze(1); if( retVal == vtkTesting::PASSED ) {