1 /*=========================================================================
4 Module: $RCSfile: gdcmSQItem.h,v $
6 Date: $Date: 2004/10/07 21:01:10 $
7 Version: $Revision: 1.18 $
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 "gdcmDocEntry.h"
22 #include "gdcmDocEntrySet.h"
23 #include "gdcmDocument.h"
28 //-----------------------------------------------------------------------------
29 typedef std::list<gdcmDocEntry *> ListDocEntry;
30 //-----------------------------------------------------------------------------
31 class GDCM_EXPORT gdcmSQItem : public gdcmDocEntrySet
37 virtual void Print(std::ostream &os = std::cout);
38 virtual void Write(FILE *fp, FileType filetype);
40 /// \brief returns the DocEntry chained List for this SQ Item.
41 ListDocEntry &GetDocEntries() { return docEntries; };
43 /// \brief adds the passed DocEntry to the DocEntry chained List for
45 void AddDocEntry(gdcmDocEntry *e) { docEntries.push_back(e); };
47 virtual bool AddEntry(gdcmDocEntry *Entry); // add to the List
49 gdcmDocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element);
50 // FIXME method to write
51 //gdcmDocEntry *GetDocEntryByName (std::string Name);
53 bool SetEntryByNumber(std::string val, uint16_t group, uint16_t element);
55 virtual std::string GetEntryByNumber(uint16_t group, uint16_t element);
57 /// \brief returns the ordinal position of a given SQItem
58 int GetSQItemNumber() { return SQItemNumber; };
60 /// \brief Sets the ordinal position of a given SQItem
61 void SetSQItemNumber(int itemNumber) { SQItemNumber = itemNumber; };
63 /// Accessor on \ref SQDepthLevel.
64 int GetDepthLevel() { return SQDepthLevel; }
66 /// Accessor on \ref SQDepthLevel.
67 void SetDepthLevel(int depth) { SQDepthLevel = depth; }
69 /// Accessor on \ref BaseTagKey.
70 void SetBaseTagKey( gdcmBaseTagKey key ) { BaseTagKey = key; }
72 /// Accessor on \ref BaseTagKey.
73 gdcmBaseTagKey GetBaseTagKey( ) { return BaseTagKey; }
80 /// \brief chained list of (Elementary) Doc Entries
81 ListDocEntry docEntries;
83 /// \brief SQ Item ordinal number
86 ///\brief pointer to the HTable of the gdcmDocument,
87 /// (because we don't know it within any gdcmDicomDirObject nor any gdcmSQItem)
88 TagDocEntryHT *PtagHT;
93 /// \brief Sequences can be nested. This \ref SQDepthLevel represents
94 /// the level of the nesting of instances of this class.
95 /// \ref SQDepthLevel and its \ref gdcmSeqEntry::SQDepthLevel
96 /// counterpart are only defined on printing purposes
100 /// \brief A TagKey of a gdcmDocEntry nested in a sequence is prepended
101 /// with this BaseTagKey.
102 gdcmBaseTagKey BaseTagKey;
106 //-----------------------------------------------------------------------------