mitk.BaseProperty#
- class mitk.BaseProperty#
Bases:
pybind11_objectAbstract base class for typed property values.
Every property attached to an MITK object is a
BasePropertysubclass:StringProperty,BoolProperty,IntProperty,FloatProperty,DoubleProperty,ColorProperty,TemporoSpatialStringProperty.When you read properties through the
Image.propertiesmapping (or viaget_property()), values are auto-coerced to Python-native types. The rawBasePropertyis reachable withraw=True.- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)clone(self)Return a deep copy of this property.
from_json(json)Reconstruct a
BasePropertysubclass from JSON.to_json(self)Serialize this property to a self-contained JSON string.
Attributes
- __eq__(self: mitk.BaseProperty, arg0: mitk.BaseProperty) bool#
- clone(self: mitk.BaseProperty) mitk.BaseProperty#
Return a deep copy of this property.
- static from_json(json: str) mitk.BaseProperty#
Reconstruct a
BasePropertysubclass from JSON.- Parameters:
json – JSON string produced by
to_json().- Returns:
A new
BasePropertyof the appropriate subclass.
- to_json(self: mitk.BaseProperty) str#
Serialize this property to a self-contained JSON string.
The string carries enough type information that
from_json()can reconstruct the correct subclass.- Returns:
JSON string representation of the property.
- property value#