mitk.PropertyKeyPath#
- class mitk.PropertyKeyPath#
Bases:
pybind11_objectStructured representation of a hierarchical property key.
MITK property keys are dot-separated (e.g.
"DICOM.PatientName","sequence.[2].label").PropertyKeyPathis the typed, manipulable form: nodes carry an element name and an optional selection (a specific index,[*]wildcard, or none).Supports
pathlib.Path-style/concatenation and[]indexing for selections. Convert to/from MITK property name strings viafrom_string()andstr(path).Examples
>>> p = mitk.PropertyKeyPath("DICOM") / "PatientName" >>> str(p) 'DICOM.PatientName' >>> p = mitk.PropertyKeyPath("seq")[2] >>> str(p) 'seq.[2]'
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: mitk.PropertyKeyPath) -> None
Construct an empty path.
__init__(self: mitk.PropertyKeyPath, element: str) -> None
Create a PropertyKeyPath with a single element.
Methods
__init__(*args, **kwargs)Overloaded function.
from_string(property_name)Parse a property name string into a PropertyKeyPath.
get_nodes(self)Get detailed information about all nodes in the path.
Attributes
True if the path has no nodes.
True if the path has no wildcards.
- __eq__(self: mitk.PropertyKeyPath, other: object) bool#
Check if two paths are structurally identical.
- __getitem__(*args, **kwargs)#
Overloaded function.
__getitem__(self: mitk.PropertyKeyPath, index: typing.SupportsInt) -> mitk.PropertyKeyPath
Convert last element to indexed selection (e.g., path[5] -> path.element.[5]).
__getitem__(self: mitk.PropertyKeyPath, wildcard: str) -> mitk.PropertyKeyPath
Convert last element to wildcard selection (e.g., path[‘*’] -> path.element.[*]).
- __len__(self: mitk.PropertyKeyPath) int#
Return the number of nodes in the path.
- __ne__(self: mitk.PropertyKeyPath, other: object) bool#
- __truediv__(*args, **kwargs)#
Overloaded function.
__truediv__(self: mitk.PropertyKeyPath, element: str) -> mitk.PropertyKeyPath
Append an element or selection to the path using / operator.
__truediv__(self: mitk.PropertyKeyPath, other: mitk.PropertyKeyPath) -> mitk.PropertyKeyPath
Append another PropertyKeyPath to this one.
- static from_string(property_name: str) mitk.PropertyKeyPath#
Parse a property name string into a PropertyKeyPath.
- get_nodes(self: mitk.PropertyKeyPath) list#
Get detailed information about all nodes in the path.
- property is_empty#
True if the path has no nodes.
- property is_explicit#
True if the path has no wildcards.