MCPcopy Create free account
hub / github.com/MITK/MITK / ToStr

Method ToStr

Modules/DICOM/src/mitkDICOMTagPath.cpp:193–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 }
192
193 std::string
194 DICOMTagPath::
195 ToStr() const
196 {
197 std::ostringstream nameStream;
198
199 if (this->Size() == 0) return nameStream.str();
200
201 bool first = true;
202 for (const auto& node : m_NodeInfos)
203 {
204 if (!first) nameStream << ".";
205 first = false;
206
207 if (node.type == NodeInfo::NodeType::AnyElement)
208 {
209 nameStream << "*";
210 }
211 else if (node.type != NodeInfo::NodeType::Invalid)
212 {
213 nameStream << "("
214 << std::setw(4) << std::setfill('0') << std::hex << std::uppercase << node.tag.GetGroup() << std::nouppercase
215 << ","
216 << std::setw(4) << std::setfill('0') << std::hex << std::uppercase << node.tag.GetElement() << std::nouppercase
217 << ")";
218
219 if (node.type == NodeInfo::NodeType::SequenceSelection)
220 {
221 nameStream << "[" << node.selection << "]";
222 }
223 else if (node.type == NodeInfo::NodeType::AnySelection)
224 {
225 nameStream << "[*]";
226 }
227 }
228 else
229 {
230 nameStream << "INVALID_NODE";
231 }
232 }
233
234 return nameStream.str();
235 }
236
237 bool
238 DICOMTagPath::

Callers

nothing calls this directly

Calls 3

SizeMethod · 0.95
GetGroupMethod · 0.45
GetElementMethod · 0.45

Tested by

no test coverage detected