Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkDICOMTagPath.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkDICOMTagPath_h
14 #define mitkDICOMTagPath_h
15 
16 #include <vector>
17 
18 #include <mitkDICOMTag.h>
19 
20 #include <MitkDICOMReaderExports.h>
21 
22 
23 namespace mitk
24 {
35  {
36  public:
37  typedef int ItemSelectionIndex;
38 
40  {
41  enum class NodeType
42  {
43  Invalid = 0, //*< Node is non existant or invalid.
44  Element, //*< Selects an specific element given the node name.
45  SequenceSelection, //*< Selects an specific item in a sequence of items and has a item selector ("[n]").
46  AnySelection, //*< Selects all items of a specific element ("[*]").
47  AnyElement, //*< Selects any element/item. Node name is wildcarded ("*"); item selection as well implictily.
48  };
49 
52  ItemSelectionIndex selection;
53 
54  NodeInfo();
55  NodeInfo(const DICOMTag& tag, NodeType type = NodeType::Element, ItemSelectionIndex index = 0);
56  bool Matches(const NodeInfo& right) const;
57 
58  bool operator == (const NodeInfo& right) const;
59  };
60 
61  typedef std::vector<NodeInfo> NodeInfoVectorType;
62  typedef NodeInfoVectorType::size_type PathIndexType;
63 
65  bool IsEmpty() const;
66 
68  bool IsExplicit() const;
69 
71  bool HasItemSelectionWildcardsOnly() const;
72 
74  PathIndexType Size() const;
75 
79  PathIndexType AddNode(const NodeInfo& newNode);
80 
86  const NodeInfo& GetNode(const PathIndexType& index) const;
87 
93  NodeInfo& GetNode(const PathIndexType& index);
94 
98  NodeInfo& GetFirstNode();
99 
103  const NodeInfo& GetFirstNode() const;
104 
108  NodeInfo& GetLastNode();
109 
113  const NodeInfo& GetLastNode() const;
114 
115  const NodeInfoVectorType& GetNodes() const;
116 
117  std::string ToStr() const;
118 
119  DICOMTagPath& FromStr(const std::string& pathStr);
120 
122  bool operator == (const DICOMTagPath& path) const;
123 
125  bool operator < (const DICOMTagPath& right) const;
126 
131  bool Equals(const DICOMTagPath& path) const;
132 
133  DICOMTagPath& operator = (const DICOMTagPath& path);
134 
135  DICOMTagPath& AddAnyElement();
136  DICOMTagPath& AddElement(unsigned int group, unsigned int element);
137  DICOMTagPath& AddAnySelection(unsigned int group, unsigned int element);
138  DICOMTagPath& AddSelection(unsigned int group, unsigned int element, ItemSelectionIndex index);
139 
140  DICOMTagPath();
141  DICOMTagPath(const DICOMTagPath& path);
142  DICOMTagPath(const DICOMTag& tag);
143  explicit DICOMTagPath(unsigned int group, unsigned int element);
144 
145  virtual ~DICOMTagPath();
146 
147  virtual void Reset();
148 
149  protected:
150  NodeInfoVectorType m_NodeInfos;
151 
152  static bool DICOMTagPathesMatch(const DICOMTagPath& left, const DICOMTagPath& right);
153  };
154 
155  typedef std::vector<DICOMTagPath> DICOMTagPathList;
156 
157  MITKDICOMREADER_EXPORT std::ostream& operator<<(std::ostream& os, const DICOMTagPath& path);
158 
163 
168 
171  MITKDICOMREADER_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string& propertyName);
174 }
175 
176 #endif
Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag...
NodeInfoVectorType m_NodeInfos
MITKDICOMREADER_EXPORT std::string DICOMTagPathToPersistenceKeyRegEx(const DICOMTagPath &tagPath)
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list&#39;s first item is lower than the second one&#39;s...
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:32
#define MITKDICOMREADER_EXPORT
std::vector< NodeInfo > NodeInfoVectorType
DataCollection - Class to facilitate loading/accessing structured data.
MITKCORE_EXPORT std ::ostream & operator<<(std ::ostream &o, DataNode::Pointer &dtn)
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
MITKDICOMREADER_EXPORT std::string DICOMTagPathToPersistenceNameTemplate(const DICOMTagPath &tagPath)
MITKDICOMREADER_EXPORT std::string DICOMTagPathToPropertyName(const DICOMTagPath &tagPath)
NodeInfoVectorType::size_type PathIndexType
#define AddNode(name)
MITKDICOMREADER_EXPORT std::string DICOMTagPathToPersistenceKeyTemplate(const DICOMTagPath &tagPath)
std::vector< DICOMTagPath > DICOMTagPathList
MITKDICOMREADER_EXPORT std::string DICOMTagPathToPropertyRegEx(const DICOMTagPath &tagPath)
ItemSelectionIndex selection
MITKDICOMREADER_EXPORT std::string DICOMTagPathToDCMTKSearchPath(const DICOMTagPath &tagPath)
MITKDICOMREADER_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string &propertyName)