| 114 | } |
| 115 | |
| 116 | void mitk::PlaneFit::CalculateCentroid(int t) |
| 117 | { |
| 118 | if (m_PointSet == nullptr) |
| 119 | return; |
| 120 | |
| 121 | int ps_total = m_PointSet->GetSize(t); |
| 122 | |
| 123 | m_Centroids[t][0] = m_Centroids[t][1] = m_Centroids[t][2] = 0.0; |
| 124 | |
| 125 | for (int i = 0; i < ps_total; i++) |
| 126 | { |
| 127 | mitk::Point3D p3d = m_PointSet->GetPoint(i, t); |
| 128 | m_Centroids[t][0] += p3d[0]; |
| 129 | m_Centroids[t][1] += p3d[1]; |
| 130 | m_Centroids[t][2] += p3d[2]; |
| 131 | } |
| 132 | |
| 133 | // calculation of centroid |
| 134 | m_Centroids[t][0] /= ps_total; |
| 135 | m_Centroids[t][1] /= ps_total; |
| 136 | m_Centroids[t][2] /= ps_total; |
| 137 | } |
| 138 | |
| 139 | void mitk::PlaneFit::ProcessPointSet(int t) |
| 140 | { |
no test coverage detected