]> Creatis software - gdcm.git/blobdiff - Example/TestWriteSimple.cxx
Add a *very* simple test program to read the frames of a Papyrus image,
[gdcm.git] / Example / TestWriteSimple.cxx
index 0c03379cdca49e303c9f935e82eb8683490ace17..f194fe0518b6214149118913d895024c0ac8eca5 100644 (file)
@@ -1,4 +1,22 @@
-#include "gdcm.h"
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: TestWriteSimple.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/12/03 20:16:55 $
+  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
+  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[])
 {
@@ -18,7 +36,7 @@ int main(int argc, char* argv[])
 
   // 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 +48,6 @@ int main(int argc, char* argv[])
 
   f2->WriteDcmExplVR( output );
   
-  delete[] imageData;
   delete f1;
   delete f2;
   //delete PixelData; //Does GetImageData return the same pointer ?