Odil
A C++11 library for the DICOM standard
ElementsDictionary.h
Go to the documentation of this file.
1/*************************************************************************
2 * odil - Copyright (C) Universite de Strasbourg
3 * Distributed under the terms of the CeCILL-B license, as published by
4 * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6 * for details.
7 ************************************************************************/
8
9#ifndef _f4b88e07_d515_41be_ad1b_37899ec6451e
10#define _f4b88e07_d515_41be_ad1b_37899ec6451e
11
12#include <map>
13#include <string>
14
15#include "odil/odil.h"
16#include "odil/Tag.h"
17
18namespace odil
19{
20
23{
24public:
26 enum class Type
27 {
28 Tag,
29 String,
30 None
31 };
32
35
37 ElementsDictionaryKey(Tag const & value);
38
40 ElementsDictionaryKey(std::string const & value);
41
43 Type const & get_type() const;
44
46 Tag const & get_tag() const;
47
49 std::string const & get_string() const;
50
52 void set(Tag const value);
53
55 void set(std::string const & value);
56
58 bool operator<(ElementsDictionaryKey const & other) const;
59
61 bool operator==(ElementsDictionaryKey const & other) const;
62
63private:
64 Type _type;
65 Tag _tag;
66 std::string _string;
67};
68
73{
75 std::string name;
76
78 std::string keyword;
79
81 std::string vr;
82
84 std::string vm;
85
88 std::string const & name="", std::string const & keyword="",
89 std::string const & vr="", std::string const & vm="");
90};
91
92typedef
93 std::map<ElementsDictionaryKey, ElementsDictionaryEntry> ElementsDictionary;
94
96ElementsDictionary::const_iterator
97find(ElementsDictionary const & dictionary, Tag const & tag);
98
99}
100
101#endif // _f4b88e07_d515_41be_ad1b_37899ec6451e
Key of a dictionary of DICOM elements.
Definition: ElementsDictionary.h:23
Type
Type of the key.
Definition: ElementsDictionary.h:27
void set(std::string const &value)
Set the type to String.
ElementsDictionaryKey()
Create a key with type equal to None.
ElementsDictionaryKey(Tag const &value)
Create a key with type equal to Tag.
std::string const & get_string() const
Return the string value or raise an exception if type is not String.
void set(Tag const value)
Set the type to Tag.
Tag const & get_tag() const
Return the tag value or raise an exception if type is not Tag.
bool operator==(ElementsDictionaryKey const &other) const
Comparator.
bool operator<(ElementsDictionaryKey const &other) const
Comparator.
ElementsDictionaryKey(std::string const &value)
Create a key with type equal to String.
Type const & get_type() const
Return the type.
A DICOM element tag.
Definition: Tag.h:26
Definition: Association.h:25
std::map< ElementsDictionaryKey, ElementsDictionaryEntry > ElementsDictionary
Definition: ElementsDictionary.h:93
ElementsDictionary::const_iterator find(ElementsDictionary const &dictionary, Tag const &tag)
#define ODIL_API
Definition: odil.h:28
Entry in a dictionary of DICOM elements.
Definition: ElementsDictionary.h:73
std::string vm
Multiplicity.
Definition: ElementsDictionary.h:84
std::string keyword
Brief name.
Definition: ElementsDictionary.h:78
ElementsDictionaryEntry(std::string const &name="", std::string const &keyword="", std::string const &vr="", std::string const &vm="")
Constructor.
std::string vr
Type.
Definition: ElementsDictionary.h:81
std::string name
Full name.
Definition: ElementsDictionary.h:75