]> Creatis software - gdcm.git/commitdiff
Jpeg writter is no longer confused by DataElements 7fe0|0010 inside a Sequence
authorjpr <jpr>
Wed, 29 Aug 2007 15:30:48 +0000 (15:30 +0000)
committerjpr <jpr>
Wed, 29 Aug 2007 15:30:48 +0000 (15:30 +0000)
(e.g. : an icon inside Icom Image Sequence)
Hope there is no compressed icons !

21 files changed:
src/gdcmDataEntry.cxx
src/gdcmDataEntry.h
src/gdcmDicomDir.cxx
src/gdcmDicomDirMeta.cxx
src/gdcmDicomDirMeta.h
src/gdcmDicomDirPatient.cxx
src/gdcmDicomDirPatient.h
src/gdcmDicomDirSerie.cxx
src/gdcmDicomDirSerie.h
src/gdcmDicomDirStudy.cxx
src/gdcmDicomDirStudy.h
src/gdcmDocEntry.cxx
src/gdcmDocEntry.h
src/gdcmDocEntrySet.h
src/gdcmDocument.cxx
src/gdcmElementSet.cxx
src/gdcmElementSet.h
src/gdcmSQItem.cxx
src/gdcmSQItem.h
src/gdcmSeqEntry.cxx
src/gdcmSeqEntry.h

index 9e35cc5..3504fee 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDataEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/08/27 16:14:47 $
-  Version:   $Revision: 1.46 $
+  Date:      $Date: 2007/08/29 15:30:48 $
+  Version:   $Revision: 1.47 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -550,10 +550,10 @@ void DataEntry::Copy(DocEntry *doc)
  * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
  */
 void DataEntry::WriteContent(std::ofstream *fp, FileType filetype, 
-                                                      bool insideMetaElements)
+                                                      bool insideMetaElements, bool insideSequence)
 { 
    // writes the 'common part'
-   DocEntry::WriteContent(fp, filetype, insideMetaElements);
+   DocEntry::WriteContent(fp, filetype, insideMetaElements, insideSequence);
 
    if ( GetGroup() == 0xfffe )
    {
index 0fde3e6..d043126 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDataEntry.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:03 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2007/08/29 15:30:48 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -52,7 +52,7 @@ public:
 
 // Write
    virtual void WriteContent(std::ofstream *fp, FileType filetype,
-                                                   bool insideMetaElements );
+                               bool insideMetaElements, bool insideSequence);
    uint32_t ComputeFullLength();
    
 // Set/Get data
index a6aa0ad..1979421 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.194 $
+  Date:      $Date: 2007/08/29 15:30:48 $
+  Version:   $Revision: 1.195 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -492,7 +492,7 @@ bool DicomDir::Write(std::string const &fileName)
    binary_write( *fp, "DICM");
  
    DicomDirMeta *ptrMeta = GetMeta();
-   ptrMeta->WriteContent(fp, ExplicitVR, true);
+   ptrMeta->WriteContent(fp, ExplicitVR, true, false);
    
    // force writing 0004|1220 [SQ ], that CANNOT exist within DicomDirMeta
    for(i=0;i<6;++i)
@@ -504,7 +504,7 @@ bool DicomDir::Write(std::string const &fileName)
                                      cc != Patients.end();
                                    ++cc )
    {
-      (*cc)->WriteContent( fp, ExplicitVR, false );
+      (*cc)->WriteContent( fp, ExplicitVR, false, true );
    }
    
    // force writing Sequence Delimitation Item
index 37c6605..0c98a59 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirMeta.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2007/08/29 15:30:48 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -53,11 +53,11 @@ DicomDirMeta::~DicomDirMeta()
 /**
  * \brief   Writes the Meta Elements
  * @param fp ofstream to write to
- * @param filetype type of the file (ImplicitVR, ExplicitVR, ...)
+ * @param filetype type of the file (ImplicitVR, ExplicitVR, JPEG, JPEG2000 ...)
  * @return
  */ 
 void DicomDirMeta::WriteContent(std::ofstream *fp, FileType filetype,
-                                                     bool insideMetaElements)
+                                 bool dummy, bool dummy2)
 {
    // 'File Meta Information Version'
    
@@ -86,7 +86,7 @@ void DicomDirMeta::WriteContent(std::ofstream *fp, FileType filetype,
                              ++i)
    {   
    // true : we are in MetaElements
-      (*i)->WriteContent(fp, filetype, true);
+      (*i)->WriteContent(fp, filetype, true, false);
    }
 }
 
index ee79359..df2f87b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirMeta.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:03 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2007/08/29 15:30:48 $
+  Version:   $Revision: 1.25 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -37,7 +37,7 @@ public:
    static DicomDirMeta *New(bool empty=false) {return new DicomDirMeta(empty);}
 
    virtual void Print(std::ostream &os = std::cout, std::string const &indent = "" );
-   virtual void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements);
+   virtual void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements, bool insideSequence);
    int ComputeGroup0002Length( );
    
 protected:
index 0e2e577..33896df 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.42 $
+  Date:      $Date: 2007/08/29 15:30:48 $
+  Version:   $Revision: 1.43 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -57,15 +57,15 @@ DicomDirPatient::~DicomDirPatient()
  * @param fp ofstream to write to
  * @param t Type of the File (explicit VR, implicitVR, ...) 
  */ 
-void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements)
+void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t, bool dummy, bool dummy2)
 {
-   DicomDirObject::WriteContent(fp, t, false);
+   DicomDirObject::WriteContent(fp, t, false, true);
 
    for(ListDicomDirStudy::iterator cc = Studies.begin();
                                    cc!= Studies.end();
                                  ++cc )
    {
-      (*cc)->WriteContent( fp, t, false );
+      (*cc)->WriteContent( fp, t, false, true );
    }
 }
 
index db8a955..dd3a4dc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:03 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2007/08/29 15:30:48 $
+  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
@@ -42,7 +42,7 @@ public:
    static DicomDirPatient *New(bool empty=false) {return new DicomDirPatient(empty);}
 
    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
-   void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements);
+   void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements, bool insideSequence );
   
    // Patient methods
    /// \brief Adds a new gdcm::DicomDirStudy to the Patient
index 1fe41dc..99a96c2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.44 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.45 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -58,21 +58,21 @@ DicomDirSerie::~DicomDirSerie()
  * @param fp ofstream to write to
  * @param t Type of the File (explicit VR, implicitVR, ...)
  */ 
-void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements)
+void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t, bool dummy, bool dummy2)
 {
-   DicomDirObject::WriteContent(fp, t, false);
+   DicomDirObject::WriteContent(fp, t, false, true);
 
    for(ListDicomDirImage::iterator cc = Images.begin();
                                    cc!= Images.end();
                                  ++cc )
    {
-      (*cc)->WriteContent( fp, t, false );
+      (*cc)->WriteContent( fp, t, false, true );
    } 
    for(ListDicomDirPrivate::iterator cc2 = Privates.begin();
                                      cc2!= Privates.end();
                                    ++cc2 )
    {
-      (*cc2)->WriteContent( fp, t, false);
+      (*cc2)->WriteContent( fp, t, false, true);
    }   
 }
 
index 199ae98..13065eb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:03 $
-  Version:   $Revision: 1.37 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.38 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -43,7 +43,8 @@ public:
    static DicomDirSerie *New(bool empty=false) {return new DicomDirSerie(empty);}
 
    void Print( std::ostream &os = std::cout, std::string const &indent = "" );
-   void WriteContent( std::ofstream *fp, FileType t, bool insideMetaElements );
+   void WriteContent( std::ofstream *fp, FileType t, bool insideMetaElements,
+                                                     bool insideSequence );
 
    // 'Image' methods
    DicomDirImage *NewImage();
index e7f5cef..5c28eec 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.44 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.45 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -58,22 +58,22 @@ DicomDirStudy::~DicomDirStudy()
  * @param t Type of the File (explicit VR, implicitVR, ...) 
  * @return
  */ 
-void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements)
+void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t, bool dummy, bool dummy2)
 {
-   DicomDirObject::WriteContent(fp, t, false);
+   DicomDirObject::WriteContent(fp, t, false, true);
 
    for(ListDicomDirSerie::iterator cc = Series.begin();
                                    cc!= Series.end();
                                  ++cc )
    {
-      (*cc)->WriteContent( fp, t, false );
+      (*cc)->WriteContent( fp, t, false, true );
    }
 
    for(ListDicomDirVisit::iterator icc = Visits.begin();
                                    icc!= Visits.end();
                                  ++icc )
    {
-      (*icc)->WriteContent( fp, t, false );
+      (*icc)->WriteContent( fp, t, false, true );
    }
 }
 
index bdcdf62..4b4d12e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:03 $
-  Version:   $Revision: 1.36 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.37 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -49,7 +49,7 @@ public:
    static DicomDirStudy *New(bool empty=false) {return new DicomDirStudy(empty);}
 
    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
-   void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements);
+   void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements,bool insideSequence );
 
    // 'Serie' methods
    DicomDirSerie *NewSerie();
index 4d7f80e..8d5f308 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/08/28 09:29:26 $
-  Version:   $Revision: 1.92 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.93 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -71,7 +71,7 @@ DocEntry::~DocEntry()
  * @param fp already open ofstream pointer
  * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, JPEG, JPEG2000...)
  */
-void DocEntry::WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements)
+void DocEntry::WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements, bool insideSequence)
 {
    uint32_t ffff  = 0xffffffff;
    uint16_t group = GetGroup();
@@ -139,9 +139,10 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype, bool insideMet
           ||  (vr == "UN") || (vr == "UT") )
          {
             binary_write(*fp, zero);
-           if ( (filetype == JPEG || filetype == JPEG2000) && group == 0x7fe0 && elem == 0x0010)
-            {
-               // gdcmAssertMacro( GetVR() == "OW" ); //?!?
+
+           if ( (filetype == JPEG || filetype == JPEG2000) && group == 0x7fe0 && elem == 0x0010 && !insideSequence)
+            { 
+              // Only the 'true' Pixel Element may be compressed (hope so!)
                binary_write(*fp, ffff);
             }  
             else if (vr == "SQ")
index 411fb10..d58b1c0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:04 $
-  Version:   $Revision: 1.69 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.70 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -42,7 +42,7 @@ class GDCM_EXPORT DocEntry : public RefCounter
 public:
    virtual void Print (std::ostream &os = std::cout, std::string const &indent = ""); 
    virtual void WriteContent(std::ofstream *fp, FileType filetype, 
-                             bool insideMetaElements);
+                             bool insideMetaElements, bool insideSequence);
 
    /// \brief  Gets the DicEntry of the current Dicom entry
    /// @return The DicEntry of the current Dicom entry
index 6f1930c..5e82772 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:04 $
-  Version:   $Revision: 1.71 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.72 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -65,7 +65,7 @@ class GDCM_EXPORT DocEntrySet : public RefCounter
 public:
    /// \brief write any type of entry to the entry set
    virtual void WriteContent (std::ofstream *fp, FileType filetype,
-                                                 bool insideMetaElements) = 0;
+                               bool insideMetaElements,bool insideSequence ) = 0;
 
    /// \brief Remove all Entry of the current set
    virtual void ClearEntry() = 0;
index 3c63f3e..72713e4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/08/21 12:51:09 $
-  Version:   $Revision: 1.367 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.368 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -721,8 +721,10 @@ void Document::WriteContent(std::ofstream *fp, FileType filetype)
     * --> was too much tricky / we were [in a hurry / too lazy]
     * --> We don't write the element 0x0000 (group length)
     */
-
-   ElementSet::WriteContent(fp, filetype, false); // This one is recursive
+ // This one is recursive
+ // false : outside MetaElements
+ // false : outside Sequence
+   ElementSet::WriteContent(fp, filetype, false, false);
 }
 
 // -----------------------------------------
index a38db03..c476b0a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.77 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.78 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -49,10 +49,11 @@ ElementSet::~ElementSet()
   * @param fp ofstream to write to  
   * @param filetype    ExplicitVR/ImplicitVR/ACR/ACR_LIBIDO/JPEG/JPEG2000/...
   */ 
-void ElementSet::WriteContent(std::ofstream *fp, FileType filetype, bool dummy)
+void ElementSet::WriteContent(std::ofstream *fp, FileType filetype, bool dummy, bool dummy2)
 {
    bool insideMetaElements     = false;
    bool yetOutsideMetaElements = false;
+   int countSQ =0;
    
    for (TagDocEntryHT::const_iterator i = TagHT.begin(); 
                                      i != TagHT.end(); 
@@ -87,9 +88,10 @@ void ElementSet::WriteContent(std::ofstream *fp, FileType filetype, bool dummy)
             (  (i->second)->GetGroup() == 0x0002 
              ||( (filetype == ACR || filetype == ACR_LIBIDO ) && (i->second)->GetGroup() == 0x0008 ) )
         )
-       {
+       {           
              // There are DocEntries, written recursively
-             i->second->WriteContent(fp, filetype, insideMetaElements );
+             // false : we are outside any Sequence
+             i->second->WriteContent(fp, filetype, insideMetaElements, false );
        }             
    } 
 }
index 95550ea..332ca84 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:04 $
-  Version:   $Revision: 1.57 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.58 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -46,7 +46,7 @@ public:
                       std::string const &indent = "" ); 
 
    void WriteContent(std::ofstream *fp, FileType filetype,
-                                                    bool insideMetaElements); 
+                                    bool insideMetaElements, bool insideSequence); 
 
    bool AddEntry(DocEntry *Entry);
    bool RemoveEntry(DocEntry *EntryToRemove);
index c93e630..8a796aa 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.86 $
+  Date:      $Date: 2007/08/29 15:30:49 $
+  Version:   $Revision: 1.87 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -55,7 +55,7 @@ SQItem::~SQItem()
  * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
  */
 void SQItem::WriteContent(std::ofstream *fp, FileType filetype, 
-                                                     bool insideMetaElements)
+                               bool insideMetaElements, bool dummy2)
 {
    int j;
    uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff };
@@ -89,7 +89,8 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype,
                  // contains 'impossible tag' fffe|0000 in last position !                            
       }
       // false : we are not in MetaElements
-      (*it)->WriteContent(fp, filetype, false);
+      // true  : we are inside a Sequence
+      (*it)->WriteContent(fp, filetype, false, true);
    }
       
     //we force the writting of an 'Item Delimitation' item
index ba14775..e45c252 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:04 $
-  Version:   $Revision: 1.54 $
+  Date:      $Date: 2007/08/29 15:30:50 $
+  Version:   $Revision: 1.55 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -47,7 +47,8 @@ public:
 
    virtual void Print(std::ostream &os = std::cout, 
                       std::string const &indent = "" ); 
-   void WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements);
+   void WriteContent(std::ofstream *fp, FileType filetype,
+                           bool insideMetaElements, bool insideSequence);
    uint32_t ComputeFullLength();
 
    bool AddEntry(DocEntry *Entry); // add to the List
index 0e18e40..4957fe9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/07/26 08:36:49 $
-  Version:   $Revision: 1.69 $
+  Date:      $Date: 2007/08/29 15:30:50 $
+  Version:   $Revision: 1.70 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -80,7 +80,7 @@ SeqEntry::~SeqEntry()
  * @param fp pointer to an already open file
  * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
  */
-void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype, bool dummy)
+void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype, bool dummy, bool dummy2)
 {
    uint16_t seq_term_gr = 0xfffe;
    uint16_t seq_term_el = 0xe0dd;
@@ -90,12 +90,13 @@ void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype, bool dummy)
    if ( GetReadLength() == 0 )
       return;
    // false : we are not in MetaElements
-   DocEntry::WriteContent(fp, filetype, false);
+   // true : we are inside a Sequence
+   DocEntry::WriteContent(fp, filetype, false, true);
    for(ListSQItem::iterator cc  = Items.begin();
                             cc != Items.end();
                           ++cc)
    {   
-      (*cc)->WriteContent(fp, filetype, false);
+      (*cc)->WriteContent(fp, filetype, false, true);
    }
    
    // we force the writting of a Sequence Delimitation item
index a0c167e..e29f3fe 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.h,v $
   Language:  C++
-  Date:      $Date: 2007/08/22 16:14:04 $
-  Version:   $Revision: 1.45 $
+  Date:      $Date: 2007/08/29 15:30:50 $
+  Version:   $Revision: 1.46 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -51,7 +51,8 @@ public:
                            {return new SeqEntry(group,elem);}
    
    void Print(std::ostream &os = std::cout, std::string const &indent = "" ); 
-   void WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements);
+   void WriteContent(std::ofstream *fp, FileType filetype,
+                     bool insideMetaElements, bool insideSequence);
    uint32_t ComputeFullLength();
 
    void AddSQItem(SQItem *it, int itemNumber);