]> Creatis software - gdcm.git/blobdiff - Example/TestWriteSimple.cxx
First stage of name normalisation : gdcm::File replace by gdcm::FileHelper
[gdcm.git] / Example / TestWriteSimple.cxx
index 87aeeea0b2ec95604d4f4d5b934c48bf7498a61c..45b9b4eb693b138924e20c3c5d4aaac39dd3b9a1 100644 (file)
@@ -1,4 +1,22 @@
-#include "gdcm.h"
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: TestWriteSimple.cxx,v $
+  Language:  C++
+  Date:      $Date: 2005/01/20 16:16:58 $
+  Version:   $Revision: 1.7 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+#include "gdcmHeader.h"
+#include "gdcmFile.h"
 
 int main(int argc, char* argv[])
 {
@@ -13,8 +31,8 @@ int main(int argc, char* argv[])
   std::string header = argv[1];
   const char *output = argv[2];
 
-  gdcm::Header *f1 = new gdcm::Header( header );
-  gdcm::File   *f2 = new gdcm::File( f1 );
+  gdcm::Header       *f1 = new gdcm::Header( header );
+  gdcm::FileHelper   *f2 = new gdcm::FileHelper( f1 );
 
   // If the following call is important, then the API sucks. Why is it
   // required to allocate PixelData when we are not using it !?
@@ -24,9 +42,9 @@ int main(int argc, char* argv[])
   int dataSize    = f2->GetImageDataSize();
   // unsigned char cast is necessary to be able to delete the buffer
   // since deleting a void* is not allowed in c++
-  uint8_t* imageData = (uint8_t*)f2->GetImageData();
+  uint8_t *imageData = (uint8_t *)f2->GetImageData();
 
-  f2->SetImageData( imageData, dataSize);
+  f2->SetImageData( imageData, dataSize );
 
   f2->WriteDcmExplVR( output );