1 /*=========================================================================
4 Module: $RCSfile: gdcmSeqEntry.h,v $
6 Date: $Date: 2006/04/13 08:05:52 $
7 Version: $Revision: 1.42 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef GDCMSQDOCENTRY_H
20 #define GDCMSQDOCENTRY_H
22 #include "gdcmDocEntry.h"
29 //-----------------------------------------------------------------------------
30 typedef std::list<SQItem *> ListSQItem;
32 //-----------------------------------------------------------------------------
34 * \brief a SeqEntry (as opposed to a DataEntry) is a non elementary DocEntry.
35 * It is composed by a set of SQItems.
36 * Each SQItem is composed by a set of DocEntry
37 * A DocEntry may be a SeqEntry
40 class GDCM_EXPORT SeqEntry : public DocEntry
42 gdcmTypeMacro(SeqEntry);
45 /// \brief Contructs a SeqEntry with a RefCounter from DictEntry
46 //static SeqEntry *New(DictEntry *e) {return new SeqEntry(e);}
47 /// \brief Contructs a SeqEntry with a RefCounter from DocEntry
48 static SeqEntry *New(DocEntry *d, int depth) {return new SeqEntry(d,depth);}
49 /// \brief Constructs a SeqEntry with a RefCounter from elementary values
50 static SeqEntry *New(uint16_t group,uint16_t elem/*, VRKey const &vr = GDCM_VRUNKNOWN*/)
51 {return new SeqEntry(group,elem);}
53 void Print(std::ostream &os = std::cout, std::string const &indent = "" );
54 void WriteContent(std::ofstream *fp, FileType filetype);
55 uint32_t ComputeFullLength();
57 void AddSQItem(SQItem *it, int itemNumber);
59 SQItem *GetFirstSQItem();
60 SQItem *GetNextSQItem();
61 SQItem *GetSQItem(int itemNumber);
62 unsigned int GetNumberOfSQItems();
64 /// Sets the delimitor mode
65 void SetDelimitorMode(bool dm) { DelimitorMode = dm; }
66 /// Sets the Sequence Delimitation Item
67 void SetDelimitationItem(DocEntry *e);
69 /// Gets the Sequence Delimitation Item
70 DocEntry *GetDelimitationItem() { return SeqTerm;}
72 /// Gets the depth level
73 int GetDepthLevel() const { return SQDepthLevel; }
74 /// Sets the depth level of a Sequence Entry embedded in a SeQuence
75 void SetDepthLevel(int depth) { SQDepthLevel = depth; }
77 virtual void Copy(DocEntry *doc);
82 //SeqEntry( DictEntry *e);
83 SeqEntry( DocEntry *d, int depth );
84 SeqEntry( uint16_t group, uint16_t elem );
88 /// If this Sequence is in delimitor mode (length =0xffffffff) or not
91 /// Chained list of SQ Items
93 /// iterator on the SQItems of the current SeqEntry
94 ListSQItem::iterator ItSQItem;
96 /// sequence terminator item
99 /// \brief Defines the depth level of this \ref SeqEntry inside
100 /// the (optionaly) nested sequences. \ref SQDepthLevel
101 /// and its \ref SQItem::SQDepthLevel counterpart
102 /// are only defined on printing purposes (see \ref Print).
105 } // end namespace gdcm
106 //-----------------------------------------------------------------------------