Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPlaneFit.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 mitkPlaneFit_h
14 #define mitkPlaneFit_h
15 
17 #include <mitkGeometryDataSource.h>
18 #include <mitkPlaneGeometry.h>
19 #include <mitkPointSet.h>
20 #include <mitkTimeGeometry.h>
21 
22 namespace mitk
23 {
41  {
42  public:
44  itkNewMacro(Self);
45 
48 
50  void GenerateOutputInformation() override;
51 
53  void GenerateData() override;
54 
60 
66  using mitk::GeometryDataSource::SetInput;
67  virtual void SetInput(const mitk::PointSet *ps);
68 
74  virtual const mitk::Point3D &GetCentroid(int t = 0) const;
75 
81  virtual mitk::PlaneGeometry::Pointer GetPlaneGeometry(int t = 0);
82 
88  virtual const mitk::Vector3D &GetPlaneNormal(int t = 0) const;
89 
90  protected:
92  ~PlaneFit() override;
93 
97  void CalculateCentroid(int t = 0);
98 
106  void ProcessPointSet(int t = 0);
107 
111  void InitializePlane(int t = 0);
112 
113  private:
115  const mitk::PointSet *m_PointSet;
116 
117  /* output object - a time sliced geometry.*/
118  mitk::TimeGeometry::Pointer m_TimeGeometry;
119 
120  std::vector<mitk::PlaneGeometry::Pointer> m_Planes;
121 
123  std::vector<mitk::Point3D> m_Centroids;
124 
125  /* the normal vector to describe a plane geometry.*/
126  std::vector<mitk::Vector3D> m_PlaneVectors;
127  };
128 } // namespace mitk
129 #endif
#define MITKALGORITHMSEXT_EXPORT
Superclass of all classes generating GeometryData as output.
Fits a plane to a point set using least-squares orthogonal distance regression.
Definition: mitkPlaneFit.h:41
virtual const mitk::Vector3D & GetPlaneNormal(int t=0) const
Get the normal vector of the best-fit plane.
mitkClassMacro(PlaneFit, GeometryDataSource)
void CalculateCentroid(int t=0)
void GenerateData() override
Compute the best-fit plane for each time step.
virtual void SetInput(const mitk::PointSet *ps)
void GenerateOutputInformation() override
Initialize the output information (time geometry, plane geometries).
virtual mitk::PlaneGeometry::Pointer GetPlaneGeometry(int t=0)
Get the PlaneGeometry representing the best-fit plane.
mitk::PointSet::PointDataIterator PointDataIterator
Definition: mitkPlaneFit.h:47
const mitk::PointSet * GetInput()
Get the input point set.
virtual const mitk::Point3D & GetCentroid(int t=0) const
Get the centroid (center of gravity) of the point set.
void InitializePlane(int t=0)
mitk::PointSet::PointDataType PointDataType
Definition: mitkPlaneFit.h:44
void ProcessPointSet(int t=0)
~PlaneFit() override
Data structure which stores a set of points.
Definition: mitkPointSet.h:71
DataType::PointDataContainerIterator PointDataIterator
Definition: mitkPointSet.h:148
Find image slices visible on a given plane.
Data associated with each point in the PointSet.
Definition: mitkPointSet.h:98