]> Creatis software - gdcm.git/blobdiff - src/gdcmDocument.cxx
ENH: Some cosmetic cleanup of gdcmFile, main changes are: lgrTotal -> ImageDataSize...
[gdcm.git] / src / gdcmDocument.cxx
index 5a71e670ea2c37d3ee12af5eb75f70513a85d4fa..6080c6efacdc4a04216473e9e0050088582034de 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/24 18:03:14 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2004/06/25 19:37:05 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -516,8 +516,8 @@ bool gdcmDocument::CloseFile(void) {
  *          (ACR-NEMA, ExplicitVR, ImplicitVR)
  * \return Always true.
  */
-bool gdcmDocument::WriteF(FileType filetype) {
-/// \todo
+void gdcmDocument::Write(FILE* fp,FileType filetype) {
+///
 /// ==============
 ///      The stuff is rewritten using the SeQuence based 
 ///       tree-like stucture (cf : Print )
@@ -530,8 +530,8 @@ bool gdcmDocument::WriteF(FileType filetype) {
    /// WARNING : Si on veut ecrire du DICOM V3 a partir d'un DcmHeader ACR-NEMA
    /// no way (check : FileType est un champ de gdcmDocument ...)
    /// a moins de se livrer a un tres complique ajout des champs manquants.
-   /// faire un CheckAndCorrectHeader (?)  
-
+   /// faire un CheckAndCorrectHeader (?) 
    if (filetype == gdcmImplicitVR) 
    {
       std::string implicitVRTransfertSyntax = UI1_2_840_10008_1_2;
@@ -572,9 +572,9 @@ bool gdcmDocument::WriteF(FileType filetype) {
  *    UpdateGroupLength(true,ACR);
  */
  
-   gdcmElementSet::Write(fp,filetype);
+   gdcmElementSet::Write(fp,filetype); 
 
-   return true;
+  // return true;
 }
 
 /**
@@ -656,7 +656,7 @@ gdcmBinEntry * gdcmDocument::ReplaceOrCreateByNumber(
                                          guint16 Elem)
 {
    gdcmDocEntry* a;
-   gdcmBinEntry* b;
+   gdcmBinEntry* b = 0;
    a = GetDocEntryByNumber( Group, Elem);
    if (a == NULL) {
       a =NewBinEntryByNumber(Group, Elem);
@@ -1198,7 +1198,7 @@ long gdcmDocument::ParseDES(gdcmDocEntrySet *set, long offset, long l_max, bool
    gdcmBinEntry *bn;   
    gdcmSeqEntry *sq;
    VRKey vr;
-   unsigned long l;
+   unsigned long l = 0;
    int depth; 
    
    depth = set->GetDepthLevel();     
@@ -1249,7 +1249,7 @@ long gdcmDocument::ParseDES(gdcmDocEntrySet *set, long offset, long l_max, bool
          if (NewDocEntry->GetGroup()   == 0x7fe0 && 
              NewDocEntry->GetElement() == 0x0010 )
          {
-             if (NewDocEntry->GetLength()==0xffffffff)
+             if (NewDocEntry->GetReadLength()==0xffffffff)
              {
                 // Broken US.3405.1.dcm
                 Parse7FE0(); // to skip the pixels 
@@ -1417,9 +1417,9 @@ void gdcmDocument::LoadDocEntry(gdcmDocEntry *Entry)
 
    // When we find a BinEntry not very much can be done :
    if (gdcmBinEntry* BinEntryPtr = dynamic_cast< gdcmBinEntry* >(Entry) ) {
-       
+
       LoadEntryVoidArea(BinEntryPtr);
-      s << "gdcm::Loaded (BinEntry)";          
+      s << "gdcm::Loaded (BinEntry)";
       BinEntryPtr->SetValue(s.str());
       return;
    }