Medical Imaging Interaction Toolkit
2024.12.99-67e306ee
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkColorProperty_h
14 #define mitkColorProperty_h
19 #include <itkRGBPixel.h>
21 #include <nlohmann/json.hpp>
27 #pragma warning(disable : 4522)
38 typedef itk::RGBPixel<float>
Color;
66 ColorProperty(
const float red,
const float green,
const float blue);
74 itkFactorylessNewMacro(
Self);
83 std::string GetValueAsString()
const override;
86 void SetColor(
float red,
float green,
float blue);
91 using BaseProperty::operator=;
97 itk::LightObject::Pointer InternalClone()
const override;
99 bool IsEqual(
const BaseProperty &property)
const override;
111 template <
typename TComponent>
114 j = nlohmann::json::array();
116 for (
size_t i = 0; i < 3; ++i)
120 template <
typename TComponent>
123 for (
size_t i = 0; i < 3; ++i)
124 j.at(i).get_to(c[i]);
Abstract base class for properties.
MITKCORE_EXPORT void FromJSON(const nlohmann::json &j, AffineTransform3D::Pointer transform)
Read transform from JSON array (16 elements, resp. 4x4 matrix).
Color MakeColor(float r, float g, float b)
#define mitkNewMacro1Param(classname, type)
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Find image slices visible on a given plane.
void to_json(nlohmann::json &j, const RGBPixel< TComponent > &c)
void from_json(const nlohmann::json &j, RGBPixel< TComponent > &c)
The ColorProperty class RGB color property.
const MITKPYTHONSEGMENTATION_EXPORT Color & GetColor(PromptType promptType, ColorIntensity colorIntensity)
Returns the color associated with a specific prompt type and color intensity.
MITKCORE_EXPORT void ToJSON(nlohmann::json &j, AffineTransform3D::ConstPointer transform)
Write transform (4x4 matrix) as JSON array with 16 elements.
#define mitkClassMacro(className, SuperClassName)