1 /*=========================================================================
4 Module: $RCSfile: gdcmSQItem.h,v $
6 Date: $Date: 2004/10/28 03:10:58 $
7 Version: $Revision: 1.22 $
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 =========================================================================*/
21 #include "gdcmDocEntrySet.h"
22 #include "gdcmElementSet.h"
30 //-----------------------------------------------------------------------------
31 typedef std::list<DocEntry *> ListDocEntry;
32 //-----------------------------------------------------------------------------
33 class GDCM_EXPORT SQItem : public DocEntrySet
36 SQItem(int depthLevel);
39 void Print(std::ostream &os = std::cout);
40 void Write(std::ofstream *fp, FileType filetype);
42 /// \brief returns the DocEntry chained List for this SQ Item.
43 ListDocEntry const & GetDocEntries() const { return DocEntries; };
45 /// \brief adds the passed DocEntry to the DocEntry chained List for
47 void AddDocEntry(DocEntry *e) { DocEntries.push_back(e); };
49 virtual bool AddEntry(DocEntry *Entry); // add to the List
51 DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element);
52 // FIXME method to write
53 //DocEntry *GetDocEntryByName (std::string Name);
55 bool SetEntryByNumber(std::string const & val, uint16_t group,
58 std::string GetEntryByNumber(uint16_t group, uint16_t element);
60 /// \brief returns the ordinal position of a given SQItem
61 int GetSQItemNumber() { return SQItemNumber; };
63 /// \brief Sets the ordinal position of a given SQItem
64 void SetSQItemNumber(int itemNumber) { SQItemNumber = itemNumber; };
66 /// Accessor on \ref SQDepthLevel.
67 int GetDepthLevel() { return SQDepthLevel; }
69 /// Accessor on \ref SQDepthLevel.
70 void SetDepthLevel(int depth) { SQDepthLevel = depth; }
72 /// Accessor on \ref BaseTagKey.
73 void SetBaseTagKey( BaseTagKey const & key ) { BaseTagKeyNested = key; }
75 /// Accessor on \ref BaseTagKey.
76 BaseTagKey const & GetBaseTagKey() const { return BaseTagKeyNested; }
80 // Variables that need to be access in subclasses
82 /// \brief chained list of (Elementary) Doc Entries
83 ListDocEntry DocEntries;
85 ///\brief pointer to the HTable of the Document,
86 /// (because we don't know it within any DicomDirObject nor any SQItem)
87 TagDocEntryHT *PtagHT;
91 /// \brief Sequences can be nested. This \ref SQDepthLevel represents
92 /// the level of the nesting of instances of this class.
93 /// \ref SQDepthLevel and its \ref SeqEntry::SQDepthLevel
94 /// counterpart are only defined on printing purposes
98 /// \brief A TagKey of a DocEntry nested in a sequence is prepended
99 /// with this BaseTagKey.
100 BaseTagKey BaseTagKeyNested;
103 /// \brief SQ Item ordinal number
107 } // end namespace gdcm
108 //-----------------------------------------------------------------------------