X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FVTKTestWriteSeq.cxx;h=debaf8c427489005ce1205e79e5c5a1d436b8e1e;hb=6278320cc85da00d2d56ffbf07806e84966892c3;hp=4d3b41ca98987491b39855ddbb8133c98c1f739e;hpb=efd3ea11eb9d6da5f3034f5e46649d250b90c75a;p=gdcm.git diff --git a/Testing/VTKTestWriteSeq.cxx b/Testing/VTKTestWriteSeq.cxx index 4d3b41ca..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: 2005/02/09 15:31:15 $ - Version: $Revision: 1.1 $ + 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,9 +26,11 @@ #include "vtkImageShiftScale.h" #include +#include //Generated file: #include "gdcmDataSeqImages.h" +#include "gdcmDebug.h" #ifndef vtkFloatingPointType #define vtkFloatingPointType float @@ -38,14 +40,14 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer, std::string const &filename, std::string const &referenceFileName) { - int retVal = 0; //by default this is an error + int retVal; // Set the reader vtkGdcmReader *reader = vtkGdcmReader::New(); char *newFileDcm = new char[filename.size()+1]; int fileCount = 0; - for(int i=0;i<9;i++) + for(int i=0;i<10;i++) { fileCount = i; sprintf(newFileDcm,filename.c_str(),i); @@ -66,7 +68,8 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer, // Write the image vtkGdcmWriter *writer = vtkGdcmWriter::New(); writer->SetFilePattern("%s%02d.dcm"); - writer->SetFilePrefix("TestWrite"); + char filePrefix[] = "TestWrite"; + writer->SetFilePrefix(filePrefix); writer->SetFileDimensionality(2); writer->SetInput(reader->GetOutput()); writer->Write(); @@ -105,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 ) { @@ -217,6 +219,8 @@ int VTKTestWriteSeq(int argc, char *argv[]) } } + GDCM_NAME_SPACE::Debug::DebugOn(); + int ret = 0; vtkTesting *t = vtkTesting::New(); vtkImageViewer *viewer;