]> Creatis software - gdcm.git/blobdiff - Example/TestFromScratch.cxx
ENH: Getting toward a nice gdcmDecompressor. Now RLE and JPEG are getting similar...
[gdcm.git] / Example / TestFromScratch.cxx
index e501807d9f68b7642fd5695c32c84a186e48851e..d47f638d216bed4aa21288f9338a91507a96846f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestFromScratch.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 16:16:58 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2005/01/25 15:44:22 $
+  Version:   $Revision: 1.14 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -15,8 +15,8 @@
      PURPOSE.  See the above copyright notices for more information.
                                                                                 
 =========================================================================*/
-#include "gdcmHeader.h"
 #include "gdcmFile.h"
+#include "gdcmFileHelper.h"
 #include "gdcmDictEntry.h"
 #include "gdcmDocEntry.h"
 #include "gdcmBinEntry.h"
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
 
    std::string filename = argv[1];
    gdcm::FileHelper *f1 = new gdcm::FileHelper( filename );
-   gdcm::Header *h1 = f1->GetHeader();
+   gdcm::File *h1 = f1->GetFile();
 
    int dataSize = f1->GetImageDataSize();
    std::cout << "DataSize:      " << dataSize << std::endl;
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
    uint8_t* imageData = f1->GetImageData();
  
    // Hopefully default to something
-   gdcm::Header *h2 = new gdcm::Header();
+   gdcm::File *h2 = new gdcm::File();
 
    // Copy of the header content
    gdcm::DocEntry* d = h1->GetFirstEntry();
@@ -62,11 +62,9 @@ int main(int argc, char *argv[])
          // Do not bother with field from private dict
          if( v->GetName() != "gdcm::Unknown" )
          {  
-            h2->ReplaceOrCreate( 
-                              v->GetValue(),
-                              v->GetGroup(), 
-                              v->GetElement(),
-                              v->GetVR() ); 
+            h2->InsertValEntry( v->GetValue(),
+                                v->GetGroup(),v->GetElement(),
+                                v->GetVR() ); 
          }
       }
       //else