]> Creatis software - gdcm.git/blobdiff - Example/exReadWriteFile.cxx
STYLE: Remove old comments
[gdcm.git] / Example / exReadWriteFile.cxx
index 8bfd830890175549d5a61d22461371f89b479e6c..757296ef740249644feabbbd1ecb71f7e6639819 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: exReadWriteFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/10 20:41:19 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2005/07/19 15:19:25 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -23,6 +23,7 @@
 #include "gdcmBinEntry.h"
 #include "gdcmSeqEntry.h"
 
+#include <stdlib.h> // for exit
  
 int main(int argc, char *argv[])
 {
@@ -57,9 +58,11 @@ std::cout << " --- WARNING --- WARNING --- WARNING --- WARNING ---" <<std::endl;
    std::string output   = argv[2];
 
    // First, let's create a gdcm::File
-   // that will contain all the Dicom Field but the Pixels Element
+   // that will contain all the Dicom fields but the Pixels Element
 
-   gdcm::File *f1= new gdcm::File( filename );
+   gdcm::File *f1= new gdcm::File( );
+   f1->SetFileName( filename );
+   f1->Load();
 
 
    // Ask content to be printed
@@ -210,6 +213,9 @@ std::cout << " --- WARNING --- WARNING --- WARNING --- WARNING ---" <<std::endl;
              << "]" << std::endl;
    std::cout << "Frame ref UID :["   << f1->GetEntryValue(0x0020,0x0052)
              << "]" << std::endl;
+   // User wants to get info about the 'real world' vs image
+
 
    // ------ User wants to load the pixels---------------------------------
    
@@ -251,7 +257,9 @@ std::cout << " --- WARNING --- WARNING --- WARNING --- WARNING ---" <<std::endl;
  
    // ------ User wants write a new image without shadow groups -------------
 
-   gdcm::FileHelper *copy = new gdcm::FileHelper( output );
+   gdcm::FileHelper *copy = new gdcm::FileHelper( );
+   copy->SetFileName( output );
+   copy->Load();
  
    d = f1->GetFirstEntry();
    while(d)