]> Creatis software - gdcm.git/blobdiff - Testing/TestCopyDicom.cxx
* Test/BuildUpDicomDir.cxx : bug fix for windows compilation
[gdcm.git] / Testing / TestCopyDicom.cxx
index 6d60f60994079acb17ef896b287c0e4fea81475b..8c3ad7491b056a390eadeabee24ef9b5eec5e11e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCopyDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:50 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2005/01/26 16:43:10 $
+  Version:   $Revision: 1.37 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -74,7 +74,7 @@ int CopyDicom(std::string const & filename,
       gdcm::File *originalH = new gdcm::File( filename );
       gdcm::File *copyH     = new gdcm::File( );
 
-      //First of all copy the header field by field
+      //First of all copy the file, field by field
 
       //////////////// Step 2:
       std::cout << "2...";
@@ -83,20 +83,15 @@ int CopyDicom(std::string const & filename,
       {
          if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
          {
-            copyH->ReplaceOrCreate( 
-                                 b->GetBinArea(),
-                                 b->GetLength(),
-                                 b->GetGroup(), 
-                                 b->GetElement(),
-                                 b->GetVR() );
+            copyH->InsertBinEntry( b->GetBinArea(),b->GetLength(),
+                                   b->GetGroup(),b->GetElement(),
+                                   b->GetVR() );
          }
          else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
          {   
-             copyH->ReplaceOrCreate( 
-                                 v->GetValue(),
-                                 v->GetGroup(), 
-                                 v->GetElement(),
-                                 v->GetVR() ); 
+             copyH->InsertValEntry( v->GetValue(),
+                                    v->GetGroup(),v->GetElement(),
+                                    v->GetVR() ); 
          }
          else
          {
@@ -112,8 +107,8 @@ int CopyDicom(std::string const & filename,
       size_t dataSize = original->GetImageDataSize();
       uint8_t* imageData = original->GetImageData();
 
-      // Useless to set the image datas, because it's already made when
-      // copying the corresponding BinEntry that contains the pixel datas
+      // Useless to set the image data, because it's already made when
+      // copying the corresponding BinEntry that contains the pixel data
       copy->SetImageData(imageData, dataSize);
 
       //////////////// Step 3:
@@ -225,7 +220,7 @@ int TestCopyDicom(int argc, char* argv[])
              << "GetImageDataSize() "
              << std::endl;
    std::cout << "   step 2: create a copy of the readed file and the new"
-             << " pixel datas are set to the copy"
+             << " pixel data are set to the copy"
              << std::endl;
    std::cout << "   step 3: write the copy of the image"
              << std::endl;