53 assert( DictInternal.empty() );
56 friend std::ostream&
operator<<(std::ostream& _os,
const Dict &_val);
58 ConstIterator
Begin()
const {
return DictInternal.begin(); }
59 ConstIterator
End()
const {
return DictInternal.end(); }
61 bool IsEmpty()
const {
return DictInternal.empty(); }
65 MapDictEntry::size_type s = DictInternal.size();
68 MapDictEntry::value_type(tag, de));
69 assert( s < DictInternal.size() );
74 MapDictEntry::const_iterator it =
75 DictInternal.find(tag);
76 if (it == DictInternal.end())
78 #ifdef UNKNOWNPUBLICTAG
80 if( tag !=
Tag(0x28,0x15)
81 && tag !=
Tag(0x28,0x16)
82 && tag !=
Tag(0x28,0x199)
84 && tag !=
Tag(0x20,0x1)
86 && tag !=
Tag(0x8348,0x339)
87 && tag !=
Tag(0xb5e8,0x338)
89 && tag !=
Tag(0x40,0xa125)
92 assert( 0 &&
"Impossible" );
95 it = DictInternal.find(
Tag(0xffff,0xffff) );
98 assert( DictInternal.count(tag) == 1 );
105 MapDictEntry::const_iterator it =
106 DictInternal.find(tag);
107 if (it == DictInternal.end())
111 assert( DictInternal.count(tag) == 1 );
112 return it->second.GetKeyword();
121 MapDictEntry::const_iterator it =
122 DictInternal.begin();
125 for(; it != DictInternal.end(); ++it)
127 if( strcmp( keyword, it->second.GetKeyword() ) == 0 )
137 it = DictInternal.end();
139 if (it == DictInternal.end())
141 tag =
Tag(0xffff,0xffff);
142 it = DictInternal.find( tag );
145 assert( DictInternal.count(tag) == 1 );
154 MapDictEntry::const_iterator it =
155 DictInternal.begin();
158 for(; it != DictInternal.end(); ++it)
160 if( strcmp( name, it->second.GetName() ) == 0 )
170 it = DictInternal.end();
172 if (it == DictInternal.end())
174 tag =
Tag(0xffff,0xffff);
175 it = DictInternal.find( tag );
178 assert( DictInternal.count(tag) == 1 );
190 MapDictEntry DictInternal;
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() );
240 assert( de.
GetVR() != duplicate.GetVR() );
241 if( duplicate.GetVR() ==
VR::UN )
245 duplicate.SetVM( de.
GetVM() );
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';
~PrivateDict()
Definition: gdcmDict.h:222
const char * GetName() const
Set/Get Name.
Definition: gdcmDictEntry.h:63
const DictEntry & GetDictEntry(const Tag &tag) const
Definition: gdcmDict.h:72
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:103
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner) ...
Definition: gdcmPrivateTag.h:38
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
MapDictEntry::const_iterator ConstIterator
Definition: gdcmDict.h:49
uint16_t GetElement() const
Returns the 'Element number' of the given Tag.
Definition: gdcmTag.h:57
Dict()
Definition: gdcmDict.h:52
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
bool IsEmpty() const
Definition: gdcmDict.h:317
const DictEntry & GetDictEntryByName(const char *name, Tag &tag) const
Definition: gdcmDict.h:152
ConstIterator End() const
Definition: gdcmDict.h:59
const char * GetOwner() const
Definition: gdcmPrivateTag.h:51
Class to represent an Entry in the Dict Does not really exist within the DICOM definition, just a way to minimize storage and have a mapping from gdcm::Tag to the needed information.
Definition: gdcmDictEntry.h:36
void SetVR(const VR &vr)
Definition: gdcmDictEntry.h:54
const DictEntry & GetDictEntryByKeyword(const char *keyword, Tag &tag) const
Definition: gdcmDict.h:119
const DictEntry & GetDictEntry(const PrivateTag &tag) const
Definition: gdcmDict.h:274
Class to represent a map of DictEntry.
Definition: gdcmDict.h:44
void AddDictEntry(const Tag &tag, const DictEntry &de)
Definition: gdcmDict.h:62
void AddDictEntry(const PrivateTag &tag, const DictEntry &de)
Definition: gdcmDict.h:223
Class to manipulate the sum of knowledge (all the dict user load)
Definition: gdcmDicts.h:28
const VR & GetVR() const
Set/Get VR.
Definition: gdcmDictEntry.h:53
const VM & GetVM() const
Set/Get VM.
Definition: gdcmDictEntry.h:59
Private Dict.
Definition: gdcmDict.h:216
std::map< Tag, DictEntry > MapDictEntry
Definition: gdcmDict.h:47
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element). Basically an uint32_t which...
Definition: gdcmTag.h:38
PrivateDict()
Definition: gdcmDict.h:221
uint16_t GetGroup() const
Returns the 'Group number' of the given Tag.
Definition: gdcmTag.h:55
Definition: gdcmASN1.h:20
bool RemoveDictEntry(const PrivateTag &tag)
Definition: gdcmDict.h:257
void PrintXML() const
Definition: gdcmDict.h:291
ConstIterator Begin() const
Definition: gdcmDict.h:58
bool FindDictEntry(const PrivateTag &tag) const
Definition: gdcmDict.h:264
bool IsEmpty() const
Definition: gdcmDict.h:61