Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkClippingProperty.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkClippingProperty_h
14 #define mitkClippingProperty_h
15 
16 #include "mitkBaseProperty.h"
17 #include "mitkNumericTypes.h"
18 #include <MitkCoreExports.h>
19 
20 #include <itkConfigure.h>
21 
22 #include <string>
23 
24 namespace mitk
25 {
26 #ifdef _MSC_VER
27 #pragma warning(push)
28 #pragma warning(disable : 4522)
29 #endif
30 
37  {
38  public:
40 
41  typedef std::string ValueType;
42 
43  itkFactorylessNewMacro(Self);
44 
45  itkCloneMacro(Self)
47 
48  bool GetClippingEnabled() const;
49  void SetClippingEnabled(bool enabled);
50 
51  const Point3D &GetOrigin() const;
52  void SetOrigin(const Point3D &origin);
53 
54  const Vector3D &GetNormal() const;
55  void SetNormal(const Vector3D &normal);
56 
57  std::string GetValueAsString() const override;
58 
59  bool ToJSON(nlohmann::json& j) const override;
60  bool FromJSON(const nlohmann::json& j) override;
61 
62  using BaseProperty::operator=;
63 
64  protected:
65  bool m_ClippingEnabled;
66 
67  Point3D m_Origin;
68  Vector3D m_Normal;
69 
72  ClippingProperty(const Point3D &origin, const Vector3D &normal);
73 
74  private:
75  // purposely not implemented
76  ClippingProperty &operator=(const ClippingProperty &);
77 
78  bool IsEqual(const BaseProperty &property) const override;
79  bool Assign(const BaseProperty &property) override;
80 
81  itk::LightObject::Pointer InternalClone() const override;
82  };
83 
84 #ifdef _MSC_VER
85 #pragma warning(pop)
86 #endif
87 
88 } // namespace mitk
89 
90 #endif
#define MITKCORE_EXPORT
Abstract base class for properties.
Property for clipping datasets; currently only clipping planes are possible.
mitkClassMacro(ClippingProperty, BaseProperty)
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:81
nlohmann::json json
Find image slices visible on a given plane.
MITKCORE_EXPORT void ToJSON(nlohmann::json &j, AffineTransform3D::ConstPointer transform)
Write transform (4x4 matrix) as JSON array with 16 elements.
MITKCORE_EXPORT void FromJSON(const nlohmann::json &j, AffineTransform3D::Pointer transform)
Read transform from JSON array (16 elements, resp. 4x4 matrix).