13 #ifndef mitkVectorProperty_h
14 #define mitkVectorProperty_h
41 static const char *
prefix() {
return "Invalid"; }
60 template <
typename DATATYPE>
75 std::vector<std::string>
GetClassHierarchy()
const override {
return mitk::GetClassHierarchy<Self>(); }
89 return nameOfClass.c_str();
92 const char *
GetNameOfClass()
const override {
return this->GetStaticNameOfClass(); }
93 itkFactorylessNewMacro(
Self);
146 bool IsEqual(
const BaseProperty &an_other_property)
const override;
149 bool Assign(
const BaseProperty &an_other_property)
override;
156 #define MITK_DECLARE_VECTOR_PROPERTY(TYPE, PREFIX) \
158 typedef VectorProperty<TYPE> PREFIX##VectorProperty; \
162 struct VectorPropertyDataType<TYPE> \
164 static const char *prefix() { return #PREFIX; } \
168 #define MITK_DEFINE_VECTOR_PROPERTY(TYPE) template class VectorProperty<TYPE>;
Abstract base class for properties.
Property for storing a std::vector of values.
VectorProperty(const Self &other)
VectorProperty< DATATYPE > Self
std::vector< DATATYPE > VectorType
The type of the std::vector stored by this property.
virtual void SetValue(const VectorType ¶meter_vector)
Set the content vector.
std::string GetValueAsString() const override
Return the property value as a human-readable string.
static const char * GetStaticNameOfClass()
Return the static class name including the type-dependent prefix.
std::vector< std::string > GetClassHierarchy() const override
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
const char * GetNameOfClass() const override
bool FromJSON(const nlohmann::json &j) override
Deserialize the vector from a JSON array.
virtual const VectorType & GetValue() const
Get a const reference to the contained vector.
bool ToJSON(nlohmann::json &j) const override
Serialize the vector to JSON as a JSON array.
#define MITK_DECLARE_VECTOR_PROPERTY(TYPE, PREFIX)
This should be used in .h files.
Find image slices visible on a given plane.
Helper trait for VectorProperty to determine a good ITK class name prefix.
static const char * prefix()
Return the prefix string for the class name.