From 577f36c1b267196a8bdaf33be0ce9a7322af2e88 Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 21 Jul 2005 04:51:26 +0000 Subject: [PATCH] Remove LEGACY warnings --- Testing/TestMakeDicomDir.cxx | 9 ++++++--- Testing/TestPrintAllDocument.cxx | 9 ++++++--- Testing/TestReadWriteReadCompare.cxx | 26 +++++++++++++++++--------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Testing/TestMakeDicomDir.cxx b/Testing/TestMakeDicomDir.cxx index 586e8692..3d6b1bc3 100644 --- a/Testing/TestMakeDicomDir.cxx +++ b/Testing/TestMakeDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestMakeDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/07/08 10:15:08 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/07/21 04:51:26 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -87,7 +87,10 @@ int TestMakeDicomDir(int argc, char *argv[]) delete dcmdir; // Read from disc the just written DicomDir - gdcm::DicomDir *newDicomDir = new gdcm::DicomDir("NewDICOMDIR"); + gdcm::DicomDir *newDicomDir = new gdcm::DicomDir(); + newDicomDir->SetFileName("NewDICOMDIR"); + newDicomDir->Load(); + if( !newDicomDir->IsReadable() ) { std::cout<<" Written DicomDir 'NewDICOMDIR'" diff --git a/Testing/TestPrintAllDocument.cxx b/Testing/TestPrintAllDocument.cxx index 1ef57384..7325f9c3 100644 --- a/Testing/TestPrintAllDocument.cxx +++ b/Testing/TestPrintAllDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestPrintAllDocument.cxx,v $ Language: C++ - Date: $Date: 2005/07/05 18:47:38 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/07/21 04:51:26 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -55,7 +55,10 @@ int TestPrintAllDocument(int, char *[]) filename += "/"; //doh! filename += gdcmDataImages[i]; - gdcm::File *e1= new gdcm::File( filename ); + gdcm::File *e1= new gdcm::File( ); + e1->SetFileName( filename ); + e1->Load(); + e1->SetPrintLevel(2); e1->Print(); // just to be able to grep the display result, for some usefull info diff --git a/Testing/TestReadWriteReadCompare.cxx b/Testing/TestReadWriteReadCompare.cxx index 51007bbd..cadead8a 100644 --- a/Testing/TestReadWriteReadCompare.cxx +++ b/Testing/TestReadWriteReadCompare.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestReadWriteReadCompare.cxx,v $ Language: C++ - Date: $Date: 2005/07/06 09:53:43 $ - Version: $Revision: 1.23 $ + Date: $Date: 2005/07/21 04:51:26 $ + Version: $Revision: 1.24 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -22,13 +22,15 @@ //Generated file: #include "gdcmDataImages.h" -int CompareInternal(std::string const & filename, std::string const & output) +int CompareInternal(std::string const &filename, std::string const &output) { std::cout << " Testing: " << filename << std::endl; //////////////// Step 1 (see above description): - gdcm::File *file = new gdcm::File( filename ); + gdcm::File *file = new gdcm::File( ); + file->SetFileName( filename ); + file->Load (); if( !file->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Image not gdcm compatible:" @@ -53,17 +55,23 @@ int CompareInternal(std::string const & filename, std::string const & output) std::cout << "2..."; //////////////// Step 3: - gdcm::FileHelper *reread = new gdcm::FileHelper( output ); - if( !reread->GetFile()->IsReadable() ) + gdcm::File *fileout = new gdcm::File(); + fileout->SetFileName( output ); + fileout->Load(); + // gdcm::FileHelper *reread = new gdcm::FileHelper( output ); // deprecated + + if( !fileout->IsReadable() ) { std::cerr << "Failed" << std::endl - << "Test::TestReadWriteReadCompare: Could not reread image " - << "written:" << filename << std::endl; + << "Test::TestReadWriteReadCompare: Could not parse the newly " + << "written image:" << filename << std::endl; delete file; delete filehelper; - delete reread; return 1; } + + gdcm::FileHelper *reread = new gdcm::FileHelper( fileout ); + std::cout << "3..."; // For the next step: int dataSizeWritten = reread->GetImageDataSize(); -- 2.48.1