53 assert( DictInternal.empty() );
59 friend std::ostream&
operator<<(std::ostream& _os,
const Dict &_val);
64 bool IsEmpty()
const {
return DictInternal.empty(); }
68 MapDictEntry::size_type s = DictInternal.size();
71 MapDictEntry::value_type(tag, de));
72 assert( s < DictInternal.size() );
77 MapDictEntry::const_iterator it =
78 DictInternal.find(tag);
79 if (it == DictInternal.end())
81#ifdef UNKNOWNPUBLICTAG
83 if( tag !=
Tag(0x28,0x15)
84 && tag !=
Tag(0x28,0x16)
85 && tag !=
Tag(0x28,0x199)
87 && tag !=
Tag(0x20,0x1)
89 && tag !=
Tag(0x8348,0x339)
90 && tag !=
Tag(0xb5e8,0x338)
92 && tag !=
Tag(0x40,0xa125)
95 assert( 0 &&
"Impossible" );
98 it = DictInternal.find(
Tag(0xffff,0xffff) );
101 assert( DictInternal.count(tag) == 1 );
108 MapDictEntry::const_iterator it =
109 DictInternal.find(tag);
110 if (it == DictInternal.end())
114 assert( DictInternal.count(tag) == 1 );
115 return it->second.GetKeyword();
124 MapDictEntry::const_iterator it =
125 DictInternal.begin();
128 for(; it != DictInternal.end(); ++it)
130 if( strcmp( keyword, it->second.GetKeyword() ) == 0 )
140 it = DictInternal.end();
142 if (it == DictInternal.end())
144 tag =
Tag(0xffff,0xffff);
145 it = DictInternal.find( tag );
148 assert( DictInternal.count(tag) == 1 );
157 MapDictEntry::const_iterator it =
158 DictInternal.begin();
161 for(; it != DictInternal.end(); ++it)
163 if( strcmp( name, it->second.GetName() ) == 0 )
173 it = DictInternal.end();
175 if (it == DictInternal.end())
177 tag =
Tag(0xffff,0xffff);
178 it = DictInternal.find( tag );
181 assert( DictInternal.count(tag) == 1 );
195 Dict::MapDictEntry::const_iterator it = val.DictInternal.begin();
196 for(;it != val.DictInternal.end(); ++it)
198 const Tag &t = it->first;
200 os << t <<
" " << de <<
'\n';
218 typedef std::map<PrivateTag, DictEntry> MapDictEntry;
226 MapDictEntry::size_type s = DictInternal.size();
229 MapDictEntry::value_type(tag, de));
232#if defined(NDEBUG) && 0
233 if( s == DictInternal.size() )
235 MapDictEntry::iterator it =
236 DictInternal.find(tag);
237 assert( it != DictInternal.end() );
239 assert( de.
GetVR() == VR::UN || duplicate.
GetVR() == VR::UN );
241 if( duplicate.
GetVR() == VR::UN )
243 assert( de.
GetVR() != VR::UN );
246 assert( GetDictEntry(tag).GetVR() != VR::UN );
247 assert( GetDictEntry(tag).GetVR() == de.
GetVR() );
248 assert( GetDictEntry(tag).GetVM() == de.
GetVM() );
253 assert( s < DictInternal.size() );
259 MapDictEntry::size_type s =
260 DictInternal.erase(tag);
261 assert( s == 1 || s == 0 );
266 MapDictEntry::const_iterator it =
267 DictInternal.find(tag);
268 if (it == DictInternal.end())
277 MapDictEntry::const_iterator it =
278 DictInternal.find(tag);
279 if (it == DictInternal.end())
282 it = DictInternal.find(
PrivateTag(0xffff,0xffff,
"GDCM Private Sentinel" ) );
283 assert (it != DictInternal.end());
286 assert( DictInternal.count(tag) == 1 );
293 MapDictEntry::const_iterator it = DictInternal.begin();
294 std::cout <<
"<dict edition=\"2008\">\n";
295 for(;it != DictInternal.end(); ++it)
299 std::cout <<
" <entry group=\"" << std::hex << std::setw(4)
300 << std::setfill(
'0') << t.
GetGroup() <<
"\"" <<
301 " element=\"xx" << std::setw(2) << std::setfill(
'0')<< t.
GetElement() <<
"\"" <<
" vr=\""
302 << de.
GetVR() <<
"\" vm=\"" << de.
GetVM() <<
"\" owner=\""
304 const char *name = de.
GetName();
307 std::cout <<
"\"/>\n";
311 std::cout <<
"\" name=\"" << de.
GetName() <<
"\"/>\n";
314 std::cout <<
"</dict>\n";
317 bool IsEmpty()
const {
return DictInternal.empty(); }
326 MapDictEntry DictInternal;
331 PrivateDict::MapDictEntry::const_iterator it = val.DictInternal.begin();
332 for(;it != val.DictInternal.end(); ++it)
336 os << t <<
" " << de <<
'\n';
Class to represent an Entry in the Dict.
Definition gdcmDictEntry.h:37
void SetVR(const VR &vr)
Definition gdcmDictEntry.h:54
const VR & GetVR() const
Set/Get VR.
Definition gdcmDictEntry.h:53
void SetVM(VM const &vm)
Definition gdcmDictEntry.h:60
const char * GetName() const
Set/Get Name.
Definition gdcmDictEntry.h:63
const VM & GetVM() const
Set/Get VM.
Definition gdcmDictEntry.h:59
Class to represent a map of DictEntry.
Definition gdcmDict.h:45
Dict(const Dict &_val)=delete
ConstIterator End() const
Definition gdcmDict.h:62
const DictEntry & GetDictEntry(const Tag &tag) const
Definition gdcmDict.h:75
Dict & operator=(const Dict &_val)=delete
bool IsEmpty() const
Definition gdcmDict.h:64
MapDictEntry::iterator Iterator
Definition gdcmDict.h:48
const char * GetKeywordFromTag(Tag const &tag) const
Function to return the Keyword from a Tag.
Definition gdcmDict.h:106
Dict()
Definition gdcmDict.h:52
const DictEntry & GetDictEntryByName(const char *name, Tag &tag) const
Definition gdcmDict.h:155
MapDictEntry::const_iterator ConstIterator
Definition gdcmDict.h:49
ConstIterator Begin() const
Definition gdcmDict.h:61
void AddDictEntry(const Tag &tag, const DictEntry &de)
Definition gdcmDict.h:65
const DictEntry & GetDictEntryByKeyword(const char *keyword, Tag &tag) const
Definition gdcmDict.h:122
std::map< Tag, DictEntry > MapDictEntry
Definition gdcmDict.h:47
Class to manipulate the sum of knowledge (all the dict user load)
Definition gdcmDicts.h:29
Private Dict.
Definition gdcmDict.h:217
bool IsEmpty() const
Definition gdcmDict.h:317
void PrintXML() const
Definition gdcmDict.h:291
const DictEntry & GetDictEntry(const PrivateTag &tag) const
Definition gdcmDict.h:274
bool FindDictEntry(const PrivateTag &tag) const
Definition gdcmDict.h:264
void AddDictEntry(const PrivateTag &tag, const DictEntry &de)
Definition gdcmDict.h:223
bool RemoveDictEntry(const PrivateTag &tag)
Definition gdcmDict.h:257
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner)
Definition gdcmPrivateTag.h:39
const char * GetOwner() const
Definition gdcmPrivateTag.h:51
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
uint16_t GetGroup() const
Returns the 'Group number' of the given Tag.
Definition gdcmTag.h:55
uint16_t GetElement() const
Returns the 'Element number' of the given Tag.
Definition gdcmTag.h:57
#define GDCM_EXPORT
Definition gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88