36 if (pSet.IsNull())
return;
42 std::vector<mitk::Point3D> returnValue = std::vector<mitk::Point3D>();
43 for (
int i=0; i<pSet->GetSize(); i++) returnValue.push_back(pSet->GetPoint(i));
49 if (list.empty())
return 0;
50 std::sort(list.begin(), list.end());
51 return list.at(list.size()-1);
56 if (list.empty())
return 0;
57 std::sort(list.begin(), list.end());
63 if (list.empty())
return 0;
64 double returnValue = 0;
65 double mean = GetMean(list);
66 for(std::vector<double>::size_type i=0; i<list.size(); i++)
68 returnValue += pow((list.at(i)-mean),2);
71 returnValue /= list.size();
72 returnValue = sqrt(returnValue);
78 if (list.empty())
return 0;
79 double returnValue = 0;
80 double mean = GetMean(list);
81 for(std::vector<double>::size_type i=0; i<list.size(); i++)
83 returnValue += pow((list.at(i)-mean),2);
86 returnValue /= (list.size()-1);
87 returnValue = sqrt(returnValue);
93 if (list.empty())
return 0;
95 for(std::vector<double>::size_type i=0; i<list.size(); i++)
105 if (list.empty())
return 0;
106 std::sort(list.begin(), list.end());
107 if (list.size() % 2 == 0.)
109 double element1 = list.at(list.size()/2);
110 double element2 = list.at(list.size()/2);
111 return ((element1+element2)/2.0);
115 return list.at((list.size())/2);
132 for (std::vector<mitk::Point3D>::size_type i=0; i<list.size(); i++)
134 mean[0] += list.at(i)[0];
135 mean[1] += list.at(i)[1];
136 mean[2] += list.at(i)[2];
139 mean[0] /= list.size();
140 mean[1] /= list.size();
141 mean[2] /= list.size();
148 double returnValue = 0.0;
150 if (CheckIfAllPositionsAreEqual())
return returnValue;
154 if (pSet.empty())
return 0;
158 for(std::vector<mitk::Point3D>::size_type i=0; i<pSet.size(); i++)
160 returnValue += mean.EuclideanDistanceTo(pSet.at(i));
162 returnValue /= pSet.size();
180 double returnValue = 0.0;
182 if (CheckIfAllPositionsAreEqual())
return returnValue;
186 if(pSet.empty())
return 0;
190 for(std::vector<mitk::Point3D>::size_type i=0; i<pSet.size(); i++)
192 returnValue += pow(mean.EuclideanDistanceTo(pSet.at(i)),2);
194 returnValue /= pSet.size();
195 returnValue = sqrt(returnValue);
217 std::vector<double> errorList = std::vector<double>();
219 if (CheckIfAllPositionsAreEqual())
for(std::vector<mitk::Point3D>::size_type i=0; i<list.size(); i++) {errorList.push_back(0.0);}
220 else for(std::vector<mitk::Point3D>::size_type i=0; i<list.size(); i++) {errorList.push_back(mean.EuclideanDistanceTo(list.at(i)));}
228 if (CheckIfAllPositionsAreEqual())
237 std::vector<double> listX = std::vector<double>();
238 std::vector<double> listY = std::vector<double>();
239 std::vector<double> listZ = std::vector<double>();
240 for (std::vector<mitk::Point3D>::size_type i=0; i<pSet.size(); i++)
242 listX.push_back(pSet.at(i)[0]);
243 listY.push_back(pSet.at(i)[1]);
244 listZ.push_back(pSet.at(i)[2]);
246 returnValue[0] = GetStabw(listX);
247 returnValue[1] = GetStabw(listY);
248 returnValue[2] = GetStabw(listZ);
256 if (CheckIfAllPositionsAreEqual())
265 std::vector<double> listX = std::vector<double>();
266 std::vector<double> listY = std::vector<double>();
267 std::vector<double> listZ = std::vector<double>();
268 for (std::vector<mitk::Point3D>::size_type i=0; i<pSet.size(); i++)
270 listX.push_back(pSet.at(i)[0]);
271 listY.push_back(pSet.at(i)[1]);
272 listZ.push_back(pSet.at(i)[2]);
274 returnValue[0] = GetSampleStabw(listX);
275 returnValue[1] = GetSampleStabw(listY);
276 returnValue[2] = GetSampleStabw(listZ);
287 if (m_PointSet->GetSize()==0)
return false;
288 if (m_PointSet->GetSize()==1)
return true;
291 for(
int i=1; i<m_PointSet->GetSize(); i++)
293 if((m_PointSet->GetPoint(i)[0]!=lastPoint[0])||(m_PointSet->GetPoint(i)[1]!=lastPoint[1])||(m_PointSet->GetPoint(i)[2]!=lastPoint[2]))
return false;
294 lastPoint = m_PointSet->GetPoint(i);
double GetMin(std::vector< double > list)
double GetMax(std::vector< double > list)
mitk::Vector3D GetPositionStandardDeviation()
double GetPositionErrorMedian()
double GetPositionErrorMax()
std::vector< mitk::Point3D > PointSetToVector(mitk::PointSet::Pointer pSet)
Converts a point set to a vector of Point3D.
std::vector< mitk::Point3D > PointSetToVector(const mitk::PointSet::Pointer &mps)
bool CheckIfAllPositionsAreEqual()
double GetPositionErrorStandardDeviation()
double GetPositionErrorSampleStandardDeviation()
PointSetStatisticsCalculator()
double GetPositionErrorRMS()
double GetMedian(std::vector< double > list)
mitk::Point3D GetPositionMean()
mitk::PointSet::Pointer m_PointSet
mitk::Vector3D GetPositionSampleStandardDeviation()
double GetPositionErrorMin()
mitk::Point3D GetMean(std::vector< mitk::Point3D > list)
virtual ~PointSetStatisticsCalculator()
double GetStabw(std::vector< double > list)
double GetPositionErrorMean()
std::vector< double > GetErrorList(std::vector< mitk::Point3D > list)
void SetPointSet(mitk::PointSet::Pointer pSet)
Sets the point set which will be analysed.
double GetSampleStabw(std::vector< double > list)