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

Function DICOMTagPathToPropertyRegEx

Modules/DICOM/src/mitkDICOMTagPath.cpp:460–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 };
459
460 std::string DICOMTagPathToPropertyRegEx(const DICOMTagPath& tagPath)
461 {
462 std::ostringstream nameStream;
463
464 nameStream << "DICOM";
465
466 for (const auto& node : tagPath.GetNodes())
467 {
468 nameStream << "\\.";
469
470 if (node.type == DICOMTagPath::NodeInfo::NodeType::AnyElement)
471 {
472 nameStream << "([A-Fa-f\\d]{4})\\.([A-Fa-f\\d]{4})";
473 }
474 else if (node.type != DICOMTagPath::NodeInfo::NodeType::Invalid)
475 {
476 nameStream << GenerateRegExForNumber(node.tag.GetGroup())
477 << "\\."
478 << GenerateRegExForNumber(node.tag.GetElement());
479
480 if (node.type == DICOMTagPath::NodeInfo::NodeType::SequenceSelection)
481 {
482 nameStream << "\\.\\[" << node.selection << "\\]";
483 }
484 else if (node.type == DICOMTagPath::NodeInfo::NodeType::AnySelection)
485 {
486 nameStream << "\\.\\[(\\d*)\\]";
487 }
488 }
489 else
490 {
491 nameStream << "INVALIDNODE";
492 }
493 }
494
495 return nameStream.str();
496 };
497
498 std::string DICOMTagPathToPersistenceKeyRegEx(const DICOMTagPath& tagPath)
499 {

Callers 6

AddTagOfInterestMethod · 0.85
RemoveTagMethod · 0.85
RemoveAllTagsMethod · 0.85
ExecutePropertyRegExMethod · 0.85

Calls 4

GenerateRegExForNumberFunction · 0.85
GetNodesMethod · 0.45
GetGroupMethod · 0.45
GetElementMethod · 0.45