]> Creatis software - gdcm.git/blobdiff - src/gdcmHeader.cxx
ENH: gdcm now compiles on borland
[gdcm.git] / src / gdcmHeader.cxx
index 0b41ac10b30547898f276397987004b86e80f838..13e90a3e44e66a1e66c174e3dd529190f89fbb98 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/28 03:10:58 $
-  Version:   $Revision: 1.196 $
+  Date:      $Date: 2004/11/09 21:55:55 $
+  Version:   $Revision: 1.199 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -22,6 +22,7 @@
 #include "gdcmDebug.h"
 #include "gdcmTS.h"
 #include "gdcmValEntry.h"
+#include <stdio.h>
 
 #include <vector>
 
@@ -115,8 +116,8 @@ void Header::Write(std::ofstream* fp,FileType filetype)
    if (i_lgPix != -2)
    {
       // no (GrPixel, NumPixel) element
-      std::string s_lgPix;
-      s_lgPix = Util::Format("%d", i_lgPix+12);
+      std::string s_lgPix = Util::Format("%d", i_lgPix+12);
+      s_lgPix = Util::DicomString( s_lgPix.c_str() );
       ReplaceOrCreateByNumber(s_lgPix,GrPixel, 0x0000);
    }
 
@@ -1170,7 +1171,7 @@ std::string Header::GetTransfertSyntaxName()
  */
 void Header::SetImageDataSize(size_t ImageDataSize)
 {
-   ///FIXME I don't understand this code wh ydo we set two times 'car' ?
+   ///FIXME I don't understand this code whdo we set two times 'car' ?
    std::string car = Util::Format("%d", ImageDataSize);
  
    DocEntry *a = GetDocEntryByNumber(GrPixel, NumPixel);
@@ -1178,6 +1179,7 @@ void Header::SetImageDataSize(size_t ImageDataSize)
 
    ImageDataSize += 8;
    car = Util::Format("%d", ImageDataSize);
+   car = Util::DicomString( car.c_str() );
 
    SetEntryByNumber(car, GrPixel, NumPixel);
 }
@@ -1207,7 +1209,7 @@ bool Header::AnonymizeHeader()
       }
       else
       {
-         ReplaceOrCreateByNumber(std::string("anonymised"), 0x0010, 0x0010);
+         ReplaceOrCreateByNumber("anonymised", 0x0010, 0x0010);
       }
    }