| 727 | }; |
| 728 | |
| 729 | std::string |
| 730 | DICOMTagPathToPropertyName(const mitk::DICOMTagPath& tagPath) |
| 731 | { |
| 732 | std::ostringstream nameStream; |
| 733 | |
| 734 | nameStream << "DICOM"; |
| 735 | |
| 736 | for (const auto& node : tagPath.GetNodes()) |
| 737 | { |
| 738 | nameStream << "."; |
| 739 | |
| 740 | if (node.type == DICOMTagPath::NodeInfo::NodeType::AnyElement) |
| 741 | { |
| 742 | nameStream << "*"; |
| 743 | } |
| 744 | else if (node.type != DICOMTagPath::NodeInfo::NodeType::Invalid) |
| 745 | { |
| 746 | nameStream << std::setw(4) << std::setfill('0') << std::hex << std::uppercase << node.tag.GetGroup() << std::nouppercase << "." |
| 747 | << std::setw(4) << std::setfill('0') << std::hex << std::uppercase << node.tag.GetElement(); |
| 748 | |
| 749 | if (node.type == DICOMTagPath::NodeInfo::NodeType::SequenceSelection) |
| 750 | { |
| 751 | nameStream << ".[" << node.selection << "]"; |
| 752 | } |
| 753 | else if (node.type == DICOMTagPath::NodeInfo::NodeType::AnySelection) |
| 754 | { |
| 755 | nameStream << ".[*]"; |
| 756 | } |
| 757 | } |
| 758 | else |
| 759 | { |
| 760 | nameStream << "INVALID_NODE"; |
| 761 | } |
| 762 | } |
| 763 | |
| 764 | return nameStream.str(); |
| 765 | } |
| 766 | |
| 767 | std::string DICOMTagPathToReadableName(const DICOMTagPath& tagPath, bool includeTagNumbers) |
| 768 | { |