mitk.TemporoSpatialStringProperty#
- class mitk.TemporoSpatialStringProperty#
Bases:
BasePropertyBasePropertystoring per-(time-step, z-slice) string values.Used by MITK to attach DICOM metadata to images, where individual slices or time steps may carry different values for the same tag (for example a per-slice instance UID). When the property is uniform (all stored values identical), it behaves like a regular
StringProperty.- __init__(self: mitk.TemporoSpatialStringProperty, value: str = '') None#
Construct a uniform-valued property.
- Parameters:
value – Value shared by all (time-step, slice) entries (default empty string).
Methods
__init__(self[, value])Construct a uniform-valued property.
clone(self)Return a deep copy of this property.
from_json(json)Reconstruct a
BasePropertysubclass from JSON.get_available_slices(*args, **kwargs)Overloaded function.
get_available_time_steps(*args, **kwargs)Overloaded function.
get_value(self[, time_step, z_slice])Get value at specific time step and/or slice.
has_value(self[, time_step, z_slice])Check if a value exists at specific time step and/or slice.
set_value(self, value[, time_step, z_slice])Set value at specific time step and/or slice.
to_dict(self)Serialize this property to a Python dict.
to_json(self)Serialize this property to a self-contained JSON string.
Attributes
True if all stored values are identical.
- __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.
- get_available_slices(*args, **kwargs)#
Overloaded function.
get_available_slices(self: mitk.TemporoSpatialStringProperty) -> list[int]
Get all unique slice indices across all time steps.
get_available_slices(self: mitk.TemporoSpatialStringProperty, time_step: typing.SupportsInt) -> list[int]
Get slice indices for the specified time step.
- get_available_time_steps(*args, **kwargs)#
Overloaded function.
get_available_time_steps(self: mitk.TemporoSpatialStringProperty) -> list[int]
Get all time steps that have stored values.
get_available_time_steps(self: mitk.TemporoSpatialStringProperty, z_slice: typing.SupportsInt) -> list[int]
Get time steps that have values for the specified slice.
- get_value(self: mitk.TemporoSpatialStringProperty, time_step: SupportsInt | None = None, z_slice: SupportsInt | None = None) str#
Get value at specific time step and/or slice. If both omitted, returns uniform value.
- has_value(self: mitk.TemporoSpatialStringProperty, time_step: SupportsInt | None = None, z_slice: SupportsInt | None = None) bool#
Check if a value exists at specific time step and/or slice.
- property is_uniform#
True if all stored values are identical.
- set_value(self: mitk.TemporoSpatialStringProperty, value: str, time_step: SupportsInt | None = None, z_slice: SupportsInt | None = None) None#
Set value at specific time step and/or slice. If both omitted, sets uniform value (clears all).
- to_dict(self: mitk.TemporoSpatialStringProperty) dict#
Serialize this property to a Python dict.
- 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#