]> Creatis software - gdcm.git/blobdiff - Example/WriteDicom.cxx
minor updates
[gdcm.git] / Example / WriteDicom.cxx
index 905163cdf842aa3cd3a8dc56e67dd185d4d16227..10554b397504a641e0c5a763c48dd771af8c19d8 100644 (file)
@@ -1,5 +1,4 @@
-#include "gdcmDocument.h"
-#include "gdcmFile.h"
+#include "gdcm.h"
 
 // Writting of a DICOM file based on a correct dicom header
 // and data pixel of another image
@@ -11,19 +10,17 @@ int main(int argc, char* argv[])
     {
     std::cerr << "Usage :" << std::endl << argv[0] << 
       " HeaderFileName DataFileName" << std::endl;
-    return 0;  
+    return 0;
     }
 
   const char *first = argv[1];
   gdcmFile *f1 = new gdcmFile( first );
-       
+
   const char *second = argv[2];
   gdcmFile *f2 = new gdcmFile( second );
-       
-       // f1->PrintPubElVal();
-       
+
   // We assume that DICOM fields of second file actually exists :
-       
+
   std::string nbFrames = f2->GetHeader()->GetEntryByNumber(0x0028, 0x0008);
   if(nbFrames != "gdcm::Unfound") {
       f1->GetHeader()->ReplaceOrCreateByNumber( nbFrames, 0x0028, 0x0008);
@@ -35,8 +32,8 @@ int main(int argc, char* argv[])
     f2->GetHeader()->GetEntryByNumber(0x0028, 0x0011), 0x0028, 0x0011); // nbCol
 
   // Some other tags should be updated:
-       
-       // TODO : add a default value
+
+  // TODO : add a default value
   // TODO : a function which take as input a list of tuple (gr, el)
   //        and that does the job
 
@@ -44,24 +41,22 @@ int main(int argc, char* argv[])
   void *imageData = f2->GetImageData();
 
   std::cout << "dataSize :" << dataSize << std::endl;
-                       
+
   // TODO : Shouldn't we merge those two functions ?
   f1->SetImageData( imageData, dataSize);
   f1->GetHeader()->SetImageDataSize( dataSize );
-       
+
   f1->GetHeader()->Print();
-       
+
   std::string s0  = f2->GetHeader()->GetEntryByNumber(0x7fe0, 0x0000);
   std::string s10 = f2->GetHeader()->GetEntryByNumber(0x7fe0, 0x0010);
 
   std::cout << "lgr 7fe0, 0000 " << s0  << std::endl;
-  std::cout << "lgr 7fe0, 0010 " << s10 << std::endl;  
+  std::cout << "lgr 7fe0, 0010 " << s10 << std::endl;
 
   std::cout << "WriteDCM" << std::endl;
 
   f1->WriteDcmExplVR("WriteDicom.dcm");
-  //f1->WriteDcmImplVR(resultat);
-  //f1->WriteAcr(resultat);
 
   return 0;
 }