]> Creatis software - gdcm.git/commitdiff
Remove LEGACY warnings
authorjpr <jpr>
Thu, 21 Jul 2005 04:51:26 +0000 (04:51 +0000)
committerjpr <jpr>
Thu, 21 Jul 2005 04:51:26 +0000 (04:51 +0000)
Testing/TestMakeDicomDir.cxx
Testing/TestPrintAllDocument.cxx
Testing/TestReadWriteReadCompare.cxx

index 586e8692be6f8363a1f4af32e088d7efc189bb61..3d6b1bc325decba7eccaf9b5f8ba5bdec73b9ce5 100644 (file)
@@ -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'"
index 1ef573842d12efe475b28ee2392ad6bacf7d5363..7325f9c35e98384dab432e5eff23674f82875875 100644 (file)
@@ -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
index 51007bbd89237c84f336e6fc4b153ea3548b6bec..cadead8a8986d8a576ed40a9ee380f561f5e79a7 100644 (file)
@@ -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
 //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();