]> Creatis software - gdcm.git/blobdiff - Example/TestWriteSimple.cxx
COMP: Fix comp on gcc295
[gdcm.git] / Example / TestWriteSimple.cxx
index 379658695c0300789dffb6a0bc666b4c86f05d77..f474e3cbe2c8d0e61b9683b80e5e4f3e772da6d5 100644 (file)
@@ -1,3 +1,20 @@
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: TestWriteSimple.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/11/16 04:26:18 $
+  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
+  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 "gdcm.h"
 
 int main(int argc, char* argv[])
@@ -13,12 +30,12 @@ int main(int argc, char* argv[])
   std::string header = argv[1];
   const char *output = argv[2];
 
-  gdcmHeader *f1 = new gdcmHeader( header );
-  gdcmFile   *f2 = new gdcmFile( f1 );
+  gdcm::Header *f1 = new gdcm::Header( header );
+  gdcm::File   *f2 = new gdcm::File( f1 );
 
   // If the following call is important, then the API sucks. Why is it
   // required to allocate PixelData when we are not using it !?
-  void* PixelData = f2->GetImageData(); //EXTREMELY IMPORTANT
+  uint8_t* PixelData = f2->GetImageData(); //EXTREMELY IMPORTANT
   //Otherwise ReadPixel == -1 -> the dicom writing fails completely
   
   int dataSize    = f2->GetImageDataSize();
@@ -30,7 +47,6 @@ int main(int argc, char* argv[])
 
   f2->WriteDcmExplVR( output );
   
-  delete[] imageData;
   delete f1;
   delete f2;
   //delete PixelData; //Does GetImageData return the same pointer ?