]> 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 9e35cc59477afef874e9f71c6d5b90cb2cb9c061..3504fee1ee98e9a52cf5eb43a5bab9f25151cc43 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 0fde3e63bdf639a62c0c8c10ea2ae83687f8bbfd..d043126c482780cb7c73ed0f9055b6a9e07ac4d9 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 a6aa0ad963254fe898e44a6ed0472e8ead5b14fc..197942142120ba5c50f81cfb16856959f90895bf 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 37c66051e5ea136daf2263f22e94600db4199fc7..0c98a59d551d94e1f110663e6b69c6d27985749c 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 ee793596bb76531acfe21e6218df1002943abd52..df2f87ba02f1a71a19fb57447ea963bf774b61c6 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 0e2e577a789f0b759288781381d76075ec628d57..33896dff5a6a3cb20bc4be534b7ab734d9356f0b 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 db8a955e09adb825f5fde3b8e7fb85c049d37434..dd3a4dc10eb2de16f6c339557ae6f221349f5bdb 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 1fe41dc3afec6b08784cd6140b4030676319e36b..99a96c2d61c0709d8ce4a70fad784b62cdadf3b8 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 199ae9839e12f180250bb6f5bb3a8ba848f02de6..13065eb476200cff5cf9102d692955ce62ef94e2 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 e7f5cef21d22f10df1085f04b5c8f3c8051ab228..5c28eec9cc4cef55fd5e98bc2d6cf00c71bd3bf3 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 bdcdf624232b40e686fd8292f29da23ebe15586f..4b4d12e6f9a1a993ce2eb7617ec2b8c9a912fc3e 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 4d7f80e782755d7d62849489603bf8c5383cb1ec..8d5f308b2ce1875733c6ec9c91942d20e9d8ebc7 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 411fb108570ac3e964c67f2da0e8310db6f86f3d..d58b1c0b460b9bd5cf588f1e8676f54c025774a1 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 6f1930ce2282dcceb4e236b0a24844af56a51b4d..5e82772cda9f41187052c51b605bdf6043a42a66 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 3c63f3e8feeb819a03738c2a62cd966a81690243..72713e4483292140701d7dbc21ec792ba5346fe9 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 a38db035db7714fc4e2410f55c7a5f6d29d0898c..c476b0a5395284b2c8000dc1c789fb129fa93b20 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 95550eaa362384a213e7dada33b79f1b7fd55a61..332ca84bddfc8058f16ead2cfc1df37195a6870e 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 c93e630caf991e8ef1a3a1c836b63088f960901a..8a796aac73329ef459037449b138285a16aee393 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 ba147753d0cf48bcaa75d01e61a2ac6f8c24369b..e45c252990ef6fb60612cd1c2ebf981612ac8b56 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 0e18e40c665be0733b702bf7bbd67cb45d83262c..4957fe9447d39ea42bdfbae87c849401c14f52cb 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 a0c167eba57620338d39f7af5d1f3f4fe3bf2e49..e29f3fef3d23e7adaa1e6c70e428e01eca0b4a2d 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);