Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #if !defined(MITK_PLANEFIT_H__INCLUDED_)
18 #define MITK_PLANEFIT_H__INCLUDED_
19 
21 #include "mitkGeometryDataSource.h"
22 #include "mitkPlaneGeometry.h"
23 #include "mitkPointSet.h"
24 #include "mitkTimeGeometry.h"
25 
26 namespace mitk
27 {
29  // kind regards to dr. math!
30  // function [x0, a, d, normd] = lsplane(X)
31  // ---------------------------------------------------------------------
32  // LSPLANE.M Least-squares plane (orthogonal distance
33  // regression).
34  //
35  // Version 1.0
36  // Last amended I M Smith 27 May 2002.
37  // Created I M Smith 08 Mar 2002
38  // ---------------------------------------------------------------------
39  // Input
40  // X Array [x y z] where x = vector of x-coordinates,
41  // y = vector of y-coordinates and z = vector of
42  // z-coordinates.
43  // Dimension: m x 3.
44  //
45  // Output
46  // x0 Centroid of the data = point on the best-fit plane.
47  // Dimension: 3 x 1.
48  //
49  // a Direction cosines of the normal to the best-fit
50  // plane.
51  // Dimension: 3 x 1.
52  //
53  // <Optional...
54  // d Residuals.
55  // Dimension: m x 1.
56  //
57  // normd Norm of residual errors.
58  // Dimension: 1 x 1.
59  // ...>
60  //
61  // [x0, a <, d, normd >] = lsplane(X)
62  // ---------------------------------------------------------------------
63 
65  {
66  public:
68  itkNewMacro(Self);
69 
72 
73  virtual void GenerateOutputInformation() override;
74 
75  virtual void GenerateData() override;
76 
80  const mitk::PointSet *GetInput();
81 
85  using mitk::GeometryDataSource::SetInput;
86  virtual void SetInput(const mitk::PointSet *ps);
87 
91  virtual const mitk::Point3D &GetCentroid(int t = 0) const;
92 
96  virtual mitk::PlaneGeometry::Pointer GetPlaneGeometry(int t = 0);
97 
101  virtual const mitk::Vector3D &GetPlaneNormal(int t = 0) const;
102 
103  protected:
104  PlaneFit();
105  virtual ~PlaneFit();
106 
110  void CalculateCentroid(int t = 0);
111 
119  void ProcessPointSet(int t = 0);
120 
124  void InitializePlane(int t = 0);
125 
126  private:
128  const mitk::PointSet *m_PointSet;
129 
130  /* output object - a time sliced geometry.*/
131  mitk::TimeGeometry::Pointer m_TimeGeometry;
132 
133  std::vector<mitk::PlaneGeometry::Pointer> m_Planes;
134 
136  std::vector<mitk::Point3D> m_Centroids;
137 
138  /* the normal vector to descrie a plane gemoetry.*/
139  std::vector<mitk::Vector3D> m_PlaneVectors;
140  };
141 } // namespace mitk
142 #endif // MITK_PLANFIT_INCLUDE_
Superclass of all classes generating GeometryData (instances of class GeometryData) as output...
mitk::PointSet::PointDataType PointDataType
Definition: mitkPlaneFit.h:68
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
struct for data of a point
Definition: mitkPointSet.h:95
mitk::PointSet::PointDataIterator PointDataIterator
Definition: mitkPlaneFit.h:71
#define MITKALGORITHMSEXT_EXPORT
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:79
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
DataType::PointDataContainerIterator PointDataIterator
Definition: mitkPointSet.h:140