13 #ifndef mitkTemporoSpatialStringProperty_h
14 #define mitkTemporoSpatialStringProperty_h
16 #include <itkConfigure.h>
49 itkFactorylessNewMacro(Self);
75 bool allowCloseTime =
false,
76 bool allowCloseSlice =
false)
const;
113 bool allowCloseTime =
false,
114 bool allowCloseSlice =
false)
const;
225 using BaseProperty::operator=;
240 bool allowCloseTime =
false,
241 bool allowCloseSlice =
false)
const;
249 bool IsEqual(
const BaseProperty &property)
const override;
253 namespace PropertyPersistenceSerialization
259 namespace PropertyPersistenceDeserialization
Abstract base class for properties.
Property for storing string values resolved by time step and slice index.
bool HasValue() const
Check whether any values are stored.
TemporoSpatialStringProperty(const std::string &s)
TemporoSpatialStringProperty(const TemporoSpatialStringProperty &)
std::vector< IndexValueType > GetAvailableSlices(const TimeStepType &timeStep) const
Get all slice indices stored for the specified time step.
::itk::IndexValueType IndexValueType
Index type for slice indices.
std::string GetValueAsString() const override
Return the value at the first time step and slice as a string.
void SetValue(const ValueType &value)
Set a uniform value (stored at time step 0, slice 0).
std::map< IndexValueType, std::string > SliceMapType
std::vector< TimeStepType > GetAvailableTimeSteps(const IndexValueType &slice) const
Get all time steps that contain a value for the specified slice.
void SetValue(const TimeStepType &timeStep, const IndexValueType &zSlice, const ValueType &value)
Set a value for a specific time step and slice.
bool HasValueByTimeStep(const TimeStepType &timeStep, bool allowClose=false) const
Check whether a value exists for the given time step.
std::string ValueType
The type of the string value stored per time/slice entry.
ValueType GetValueBySlice(const IndexValueType &zSlice, bool allowClose=false) const
Get the value for a given slice (time step defaults to 0).
mitkClassMacro(TemporoSpatialStringProperty, BaseProperty)
mitkNewMacro1Param(TemporoSpatialStringProperty, const char *)
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.
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.
ValueType GetValue() const
Get the value at the first time step and first slice.
bool IsUniform() const
Check whether all stored values are identical.
std::vector< TimeStepType > GetAvailableTimeSteps() const
Get all time steps stored in the property.
std::vector< IndexValueType > GetAvailableSlices() const
Get all unique slice indices across all time steps.
bool ToJSON(nlohmann::json &j) const override
Serialize the property to JSON.
bool FromJSON(const nlohmann::json &j) override
Deserialize the property from JSON.
mitkNewMacro1Param(TemporoSpatialStringProperty, const std::string &)
std::pair< bool, ValueType > CheckValue(const TimeStepType &timeStep, const IndexValueType &zSlice, bool allowCloseTime=false, bool allowCloseSlice=false) const
TemporoSpatialStringProperty(const char *string=nullptr)
bool HasValueBySlice(const IndexValueType &zSlice, bool allowClose=false) const
Check whether a value exists for the given slice.
ValueType GetValueByTimeStep(const TimeStepType &timeStep, bool allowClose=false) const
Get the value for a given time step (slice defaults to 0).
mitkCloneMacro(TemporoSpatialStringProperty)
std::map< TimeStepType, SliceMapType > TimeMapType
MITKCORE_EXPORT mitk::BaseProperty::Pointer deserializeJSONToTemporoSpatialStringProperty(const std::string &value)
MITKCORE_EXPORT std::string serializeTemporoSpatialStringPropertyToJSON(const mitk::BaseProperty *prop)
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).
TemporoSpatialStringProperty::Pointer MITKCORE_EXPORT ExtractTimeStepFromTemporoSpatialStringProperty(const TemporoSpatialStringProperty *tsProperty, TimeStepType ts)