|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Property for storing string values resolved by time step and slice index. More...
#include <mitkTemporoSpatialStringProperty.h>


Public Types | |
| typedef ::itk::IndexValueType | IndexValueType |
| Index type for slice indices. More... | |
| typedef std::string | ValueType |
| The type of the string value stored per time/slice entry. More... | |
Public Member Functions | |
| mitkClassMacro (TemporoSpatialStringProperty, BaseProperty) | |
| Pointer | Clone () const |
| mitkNewMacro1Param (TemporoSpatialStringProperty, const char *) | |
| mitkNewMacro1Param (TemporoSpatialStringProperty, const std::string &) | |
| ValueType | GetValue () const |
| Get the value at the first time step and first slice. More... | |
| ValueType | GetValue (const TimeStepType &timeStep, const IndexValueType &zSlice, bool allowCloseTime=false, bool allowCloseSlice=false) const |
| Get the value for a specific time step and slice. More... | |
| ValueType | GetValueBySlice (const IndexValueType &zSlice, bool allowClose=false) const |
| Get the value for a given slice (time step defaults to 0). More... | |
| ValueType | GetValueByTimeStep (const TimeStepType &timeStep, bool allowClose=false) const |
| Get the value for a given time step (slice defaults to 0). More... | |
| bool | HasValue () const |
| Check whether any values are stored. More... | |
| bool | HasValue (const TimeStepType &timeStep, const IndexValueType &zSlice, bool allowCloseTime=false, bool allowCloseSlice=false) const |
| Check whether a value exists for the given time step and slice. More... | |
| bool | HasValueBySlice (const IndexValueType &zSlice, bool allowClose=false) const |
| Check whether a value exists for the given slice. More... | |
| bool | HasValueByTimeStep (const TimeStepType &timeStep, bool allowClose=false) const |
| Check whether a value exists for the given time step. More... | |
| std::vector< IndexValueType > | GetAvailableSlices (const TimeStepType &timeStep) const |
| Get all slice indices stored for the specified time step. More... | |
| std::vector< TimeStepType > | GetAvailableTimeSteps (const IndexValueType &slice) const |
| Get all time steps that contain a value for the specified slice. More... | |
| std::vector< TimeStepType > | GetAvailableTimeSteps () const |
| Get all time steps stored in the property. More... | |
| std::vector< IndexValueType > | GetAvailableSlices () const |
| Get all unique slice indices across all time steps. More... | |
| void | SetValue (const TimeStepType &timeStep, const IndexValueType &zSlice, const ValueType &value) |
| Set a value for a specific time step and slice. More... | |
| void | SetValue (const ValueType &value) |
| Set a uniform value (stored at time step 0, slice 0). More... | |
| std::string | GetValueAsString () const override |
| Return the value at the first time step and slice as a string. More... | |
| bool | IsUniform () const |
| Check whether all stored values are identical. More... | |
| bool | ToJSON (nlohmann::json &j) const override |
| Serialize the property to JSON. More... | |
| bool | FromJSON (const nlohmann::json &j) override |
| Deserialize the property from JSON. More... | |
| BaseProperty & | operator= (const BaseProperty &property) |
| Assign a property value to this instance. More... | |
Public Member Functions inherited from mitk::BaseProperty | |
| mitkClassMacroItkParent (BaseProperty, itk::Object) | |
| Pointer | Clone () const |
| bool | operator== (const BaseProperty &property) const |
| Compare two properties for equality. More... | |
| BaseProperty & | operator= (const BaseProperty &property) |
| Assign a property value to this instance. More... | |
| bool | AssignProperty (const BaseProperty &property) |
| Assign a property value to this instance and report success. More... | |
Static Public Member Functions | |
| static Pointer | New () |
Protected Types | |
| typedef std::map< IndexValueType, std::string > | SliceMapType |
| typedef std::map< TimeStepType, SliceMapType > | TimeMapType |
Protected Member Functions | |
| TemporoSpatialStringProperty (const char *string=nullptr) | |
| TemporoSpatialStringProperty (const std::string &s) | |
| TemporoSpatialStringProperty (const TemporoSpatialStringProperty &) | |
| std::pair< bool, ValueType > | CheckValue (const TimeStepType &timeStep, const IndexValueType &zSlice, bool allowCloseTime=false, bool allowCloseSlice=false) const |
| mitkCloneMacro (TemporoSpatialStringProperty) | |
Protected Member Functions inherited from mitk::BaseProperty | |
| BaseProperty () | |
| BaseProperty (const BaseProperty &other) | |
| ~BaseProperty () override | |
Protected Attributes | |
| TimeMapType | m_Values |
Additional Inherited Members | |
Static Public Attributes inherited from mitk::BaseProperty | |
| static const std::string | VALUE_CANNOT_BE_CONVERTED_TO_STRING |
| Default return value for properties that cannot be converted to a string. More... | |
Property for storing string values resolved by time step and slice index.
This property can hold different string values for each combination of time step and z-slice index, making it suitable for DICOM metadata that varies across slices or time points (e.g., per-slice acquisition parameters). When constructed with a single string, the value is stored at time step 0, slice 0.
Definition at line 38 of file mitkTemporoSpatialStringProperty.h.
| typedef ::itk::IndexValueType mitk::TemporoSpatialStringProperty::IndexValueType |
Index type for slice indices.
Definition at line 42 of file mitkTemporoSpatialStringProperty.h.
|
protected |
Definition at line 228 of file mitkTemporoSpatialStringProperty.h.
|
protected |
Definition at line 229 of file mitkTemporoSpatialStringProperty.h.
| typedef std::string mitk::TemporoSpatialStringProperty::ValueType |
The type of the string value stored per time/slice entry.
Definition at line 45 of file mitkTemporoSpatialStringProperty.h.
|
protected |
|
protected |
|
protected |
|
protected |
| Pointer mitk::TemporoSpatialStringProperty::Clone | ( | ) | const |
|
overridevirtual |
Deserialize the property from JSON.
Reads the condensed JSON representation and expands time step/slice ranges into individual value entries.
| [in] | j | The JSON object containing the serialized data. |
true. Implements mitk::BaseProperty.
| std::vector<IndexValueType> mitk::TemporoSpatialStringProperty::GetAvailableSlices | ( | ) | const |
Get all unique slice indices across all time steps.
| std::vector<IndexValueType> mitk::TemporoSpatialStringProperty::GetAvailableSlices | ( | const TimeStepType & | timeStep | ) | const |
Get all slice indices stored for the specified time step.
| [in] | timeStep | The time step to query. |
| std::vector<TimeStepType> mitk::TemporoSpatialStringProperty::GetAvailableTimeSteps | ( | ) | const |
Get all time steps stored in the property.
| std::vector<TimeStepType> mitk::TemporoSpatialStringProperty::GetAvailableTimeSteps | ( | const IndexValueType & | slice | ) | const |
Get all time steps that contain a value for the specified slice.
| [in] | slice | The z-slice index to query. |
| ValueType mitk::TemporoSpatialStringProperty::GetValue | ( | ) | const |
Get the value at the first time step and first slice.
| ValueType mitk::TemporoSpatialStringProperty::GetValue | ( | const TimeStepType & | timeStep, |
| const IndexValueType & | zSlice, | ||
| bool | allowCloseTime = false, |
||
| bool | allowCloseSlice = false |
||
| ) | const |
Get the value for a specific time step and slice.
| [in] | timeStep | The time step to query. |
| [in] | zSlice | The z-slice index to query. |
| [in] | allowCloseTime | If true, the closest earlier time step is used when the exact time step is not found. |
| [in] | allowCloseSlice | If true, the closest earlier slice is used when the exact slice is not found. |
|
overridevirtual |
Return the value at the first time step and slice as a string.
Reimplemented from mitk::BaseProperty.
| ValueType mitk::TemporoSpatialStringProperty::GetValueBySlice | ( | const IndexValueType & | zSlice, |
| bool | allowClose = false |
||
| ) | const |
Get the value for a given slice (time step defaults to 0).
| [in] | zSlice | The z-slice index to query. |
| [in] | allowClose | If true, allows finding the closest slice. |
| ValueType mitk::TemporoSpatialStringProperty::GetValueByTimeStep | ( | const TimeStepType & | timeStep, |
| bool | allowClose = false |
||
| ) | const |
Get the value for a given time step (slice defaults to 0).
| [in] | timeStep | The time step to query. |
| [in] | allowClose | If true, allows finding the closest time step. |
| bool mitk::TemporoSpatialStringProperty::HasValue | ( | ) | const |
Check whether any values are stored.
true if at least one value exists, false otherwise. | bool mitk::TemporoSpatialStringProperty::HasValue | ( | const TimeStepType & | timeStep, |
| const IndexValueType & | zSlice, | ||
| bool | allowCloseTime = false, |
||
| bool | allowCloseSlice = false |
||
| ) | const |
Check whether a value exists for the given time step and slice.
| [in] | timeStep | The time step to check. |
| [in] | zSlice | The z-slice index to check. |
| [in] | allowCloseTime | If true, allows finding the closest time step. |
| [in] | allowCloseSlice | If true, allows finding the closest slice. |
true if a matching value exists, false otherwise. | bool mitk::TemporoSpatialStringProperty::HasValueBySlice | ( | const IndexValueType & | zSlice, |
| bool | allowClose = false |
||
| ) | const |
Check whether a value exists for the given slice.
| [in] | zSlice | The z-slice index to check. |
| [in] | allowClose | If true, allows finding the closest slice. |
true if a matching value exists, false otherwise. | bool mitk::TemporoSpatialStringProperty::HasValueByTimeStep | ( | const TimeStepType & | timeStep, |
| bool | allowClose = false |
||
| ) | const |
Check whether a value exists for the given time step.
| [in] | timeStep | The time step to check. |
| [in] | allowClose | If true, allows finding the closest time step. |
true if a matching value exists, false otherwise. | bool mitk::TemporoSpatialStringProperty::IsUniform | ( | ) | const |
Check whether all stored values are identical.
If true, GetValueAsString() returns the complete information without loss.
true if all values across all time steps and slices are equal, false if at least one value differs. | mitk::TemporoSpatialStringProperty::mitkClassMacro | ( | TemporoSpatialStringProperty | , |
| BaseProperty | |||
| ) |
|
protected |
| mitk::TemporoSpatialStringProperty::mitkNewMacro1Param | ( | TemporoSpatialStringProperty | , |
| const char * | |||
| ) |
| mitk::TemporoSpatialStringProperty::mitkNewMacro1Param | ( | TemporoSpatialStringProperty | , |
| const std::string & | |||
| ) |
|
static |
Referenced by mitk::python::tryDictToTemporoSpatialString().
| BaseProperty& mitk::BaseProperty::operator= |
Assign a property value to this instance.
Performs a polymorphic assignment from the given property. The assignment succeeds only if the source and target properties are of the same type. The subclass-specific Assign() method is called to perform the actual value copy.
Subclasses must implement Assign(const BaseProperty&) and call the superclass Assign method for proper handling. The copy assignment operator of the subclass should be disabled and the base class operator should be made visible using "using" statements.
| [in] | property | The property whose value should be assigned to this instance. |
| void mitk::TemporoSpatialStringProperty::SetValue | ( | const TimeStepType & | timeStep, |
| const IndexValueType & | zSlice, | ||
| const ValueType & | value | ||
| ) |
Set a value for a specific time step and slice.
If the time step or slice does not exist yet, it is created.
| [in] | timeStep | The time step to set. |
| [in] | zSlice | The z-slice index to set. |
| [in] | value | The string value to store. |
| void mitk::TemporoSpatialStringProperty::SetValue | ( | const ValueType & | value | ) |
Set a uniform value (stored at time step 0, slice 0).
Clears all existing values and stores the given value at time step 0, slice 0.
| [in] | value | The string value to store. |
|
overridevirtual |
Serialize the property to JSON.
Serializes the values as a condensed JSON representation, grouping consecutive time steps and slices with identical values.
| [out] | j | The JSON object to write the value into. |
true. Implements mitk::BaseProperty.
|
protected |
Definition at line 231 of file mitkTemporoSpatialStringProperty.h.