Medical Imaging Interaction Toolkit  2024.06.99-bf8fb9c0
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 <MitkDICOMExports.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 existent 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 
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:
151 
152  static bool DICOMTagPathesMatch(const DICOMTagPath& left, const DICOMTagPath& right);
153  };
154 
155  typedef std::vector<DICOMTagPath> DICOMTagPathList;
156 
157  MITKDICOM_EXPORT std::ostream& operator<<(std::ostream& os, const DICOMTagPath& path);
158 
159  MITKDICOM_EXPORT std::string DICOMTagPathToPropertyRegEx(const DICOMTagPath& tagPath);
163 
167  MITKDICOM_EXPORT std::string DICOMTagPathToDCMTKSearchPath(const DICOMTagPath& tagPath);
168 
171  MITKDICOM_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string& propertyName);
173  MITKDICOM_EXPORT std::string DICOMTagPathToPropertyName(const DICOMTagPath& tagPath);
174 }
175 
176 #endif
mitk::DICOMTagPathToDCMTKSearchPath
MITKDICOM_EXPORT std::string DICOMTagPathToDCMTKSearchPath(const DICOMTagPath &tagPath)
mitk::DICOMTagPathList
std::vector< DICOMTagPath > DICOMTagPathList
Definition: mitkDICOMTagPath.h:155
mitk::DICOMTagPathToPersistenceKeyRegEx
MITKDICOM_EXPORT std::string DICOMTagPathToPersistenceKeyRegEx(const DICOMTagPath &tagPath)
mitk::DICOMTagPath::NodeInfo::NodeType
NodeType
Definition: mitkDICOMTagPath.h:41
mitk::DICOMTagPath::PathIndexType
NodeInfoVectorType::size_type PathIndexType
Definition: mitkDICOMTagPath.h:62
mitk::modelFit::operator<
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list's first item is lower than the second one's...
Definition: mitkModelFitStaticParameterMap.h:139
mitk::DICOMTagPath::NodeInfoVectorType
std::vector< NodeInfo > NodeInfoVectorType
Definition: mitkDICOMTagPath.h:61
MitkDICOMExports.h
mitk::operator<<
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
mitk::DICOMTagPathToPersistenceNameTemplate
MITKDICOM_EXPORT std::string DICOMTagPathToPersistenceNameTemplate(const DICOMTagPath &tagPath)
mitk::DICOMTag
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:32
mitk::DICOMTagPath::m_NodeInfos
NodeInfoVectorType m_NodeInfos
Definition: mitkDICOMTagPath.h:150
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PropertyNameToDICOMTagPath
MITKDICOM_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string &propertyName)
mitk::DICOMTagPath::NodeInfo
Definition: mitkDICOMTagPath.h:39
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
mitk::DICOMTagPathToPersistenceKeyTemplate
MITKDICOM_EXPORT std::string DICOMTagPathToPersistenceKeyTemplate(const DICOMTagPath &tagPath)
mitkDICOMTag.h
mitk::DICOMTagPath::NodeInfo::type
NodeType type
Definition: mitkDICOMTagPath.h:50
mitk::DICOMTagPath::NodeInfo::tag
DICOMTag tag
Definition: mitkDICOMTagPath.h:51
mitk::DICOMTagPath::ItemSelectionIndex
int ItemSelectionIndex
Definition: mitkDICOMTagPath.h:37
MITKDICOM_EXPORT
#define MITKDICOM_EXPORT
Definition: MitkDICOMExports.h:15
mitk::DICOMTagPathToPropertyRegEx
MITKDICOM_EXPORT std::string DICOMTagPathToPropertyRegEx(const DICOMTagPath &tagPath)
mitk::DICOMTagPath
Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag,...
Definition: mitkDICOMTagPath.h:34
mitk::DICOMTagPathToPropertyName
MITKDICOM_EXPORT std::string DICOMTagPathToPropertyName(const DICOMTagPath &tagPath)
mitk::DICOMTagPath::NodeInfo::selection
ItemSelectionIndex selection
Definition: mitkDICOMTagPath.h:52