MeVisLab Toolbox Reference
DCMTree_Dict.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef DCM_TREE_DICT_H
14#define DCM_TREE_DICT_H
15
16#include "DCMTree_Lib.h"
17#include "DCMTree_TagInfo.h"
18#include "DCMTree_Defines.h"
19
20#ifdef _MSC_VER
21 #pragma warning (push)
22 #pragma warning (disable : 4251 4350)
23#endif
24
25#include <string>
26
32namespace DCMTree_Utils
33{
34 class LoadLibraryDelegate;
35}
36
37namespace DCMTree
38{
39 class Dict;
40 typedef boost::shared_ptr<Dict> DictPtr;
41 typedef boost::shared_ptr<const Dict> Const_DictPtr;
42
44 {
45 public:
46
51
53 virtual ~Dict();
54
59 virtual void postInitialize() const;
60
65 virtual std::string transferSyntaxUID (TransferSyntax transfersyntax) const = 0;
66
71 virtual Vr vr(const TagId &tagid) const;
72
78
83 virtual std::string name (const TagId &tagid) const = 0;
84
89 virtual TagId tagId(const std::string &name) const;
90
96 virtual TagInfo info(const TagId &tagid) const = 0;
97
103 virtual TagInfo info(const std::string &name) const = 0;
104
109 virtual bool hasInfoForTagId(const TagId &tagId) const = 0;
110
115 virtual bool hasInfoForTagName(const std::string &tagName) const = 0;
116
121 inline bool isTagIdKnown (const TagId &tagIdParam) const { return hasInfoForTagId(tagIdParam); }
122 inline bool isTagNameKnown(const std::string &tagName) const { return hasInfoForTagName(tagName); }
124
127 virtual std::vector<std::string> allNormalTagNames() const { return std::vector<std::string>(); }
128
129 protected:
131 static void setSingleton(Const_DictPtr singleton);
132
133 private:
134 static Const_DictPtr _singleton;
135 };
136}
137
138#ifdef _MSC_VER
139 #pragma warning (pop)
140#endif
141
142#endif
143
#define DCMTREE_EXPORT
static void setSingleton(Const_DictPtr singleton)
The concrete singleton is set by the implementing DLL.
virtual void postInitialize() const
Performs some initialization after the implementing DLL has been loaded.
bool isTagIdKnown(const TagId &tagIdParam) const
Convenience methods that call hasInfoForTagId() or hasInfoForTagName().
virtual std::string transferSyntaxUID(TransferSyntax transfersyntax) const =0
Converts the enum to its UID.
virtual TagId tagId(const std::string &name) const
Returns the tag ID for the given name.
virtual TagInfo info(const std::string &name) const =0
Method to be implemented by child classes to provide information about a tag with the given name.
bool isTagNameKnown(const std::string &tagName) const
virtual Vr vr(const TagId &tagid) const
Returns the DICOM VR of the given tag.
virtual TagValueMultiplicity multiplicity(const TagId &tagid) const
Returns the multiplicity (min/max) of values of the given tag.
virtual TagInfo info(const TagId &tagid) const =0
Method to be implemented by child classes to provide information about a given tag.
static Const_DictPtr singleton(DCMTree_Utils::LoadLibraryDelegate *delegate=nullptr)
Returns the singleton.
virtual std::vector< std::string > allNormalTagNames() const
Returns a list of all known normal (i.e., non-repeating) tag names, e.g., for completion in tools.
virtual ~Dict()
Destructor.
virtual bool hasInfoForTagId(const TagId &tagId) const =0
Method to check whether a TagInfo exists for the given tag ID.
virtual std::string name(const TagId &tagid) const =0
Returns the name of the given tag.
virtual bool hasInfoForTagName(const std::string &tagName) const =0
Method to check whether a TagInfo exists for the given tag name.
Class to wrap a tag ID.
Class to carry meta information about a specific tag.
The delegate that is responsible for loading the specific DICOM library.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Dictionary class to provide DICOM meta information.
Class to dump a DCMTree DICOM message into a human-readable file.
Vr
DICOM VR.
TransferSyntax
DICOM transfer syntaxes.
boost::shared_ptr< const Dict > Const_DictPtr
std::pair< unsigned, unsigned > TagValueMultiplicity
The multiplicity of a tag, first=min second=max.
boost::shared_ptr< Dict > DictPtr
Shared pointer to a DCMTree::Dict.