18 m_StatisticsCalculated(false)
39 if (pSet1.IsNotNull())
43 if (pSet2.IsNotNull())
145 itkExceptionMacro(
"Point sets specified are not valid. Please specify correct Point sets");
149 itkExceptionMacro(
"PointSets are not equal. Please make sure that your PointSets have the same size and hold corresponding points.");
153 itkExceptionMacro(
"There are no points in the PointSets. Please make sure that the PointSets contain points");
161 std::vector<double> differencesVector;
169 pointSetIterator != end; ++pointSetIterator, ++pointSetIterator2)
171 point1 = pointSetIterator.Value();
172 point2 = pointSetIterator2.Value();
174 double squaredDistance = point1.SquaredEuclideanDistanceTo(point2);
175 mean+=sqrt(squaredDistance);
176 rms+=squaredDistance;
178 differencesVector.push_back(sqrt(squaredDistance));
182 mean = mean/
static_cast<double>(numberOfPoints);
183 rms = sqrt(rms/ static_cast<double>(numberOfPoints));
184 for (std::vector<double>::size_type i=0; i<differencesVector.size(); i++)
186 sd+=(differencesVector.at(i)-mean)*(differencesVector.at(i)-mean);
188 double variance = sd/
static_cast<double>(numberOfPoints);
190 std::sort(differencesVector.begin(),differencesVector.end());
192 if (numberOfPoints%2 == 0)
194 median = (differencesVector.at(numberOfPoints/2)+differencesVector.at(numberOfPoints/2-1))/2;
198 median = differencesVector.at((numberOfPoints-1)/2+1);
DataType::PointsContainerIterator PointsIterator
static const std::string NUMBEROFVOXELS()
double GetRMS()
returns the root mean squared distance of all corresponding points of the point sets ...
static const std::string MEDIAN()
std::vector< double > m_SquaredDifferencesVector
vector holding the squared differences between the corresponding points
mitk::ImageStatisticsContainer::ImageStatisticsObject m_Statistics
struct holding the statistics
TType GetValueConverted(const std::string &name) const
Converts the requested value to the defined type.
void AddStatistic(const std::string &key, StatisticsVariantType value)
Adds a statistic to the statistics object.
double GetMax()
returns the maximal distance of all corresponding points of the point sets
mitk::PointSet::Pointer m_PointSet2
second point set used for comparison
bool m_StatisticsCalculated
flag indicating whether statistics are already calculated or not.
static const std::string VARIANCE()
static const std::string RMS()
std::vector< double > GetSquaredDifferences()
returns a vector holding the squared differences between the corresponding points of the point sets ...
double GetNumberOfPoints()
returns the total number of corresponding points of the point sets
std::vector< double > GetDifferences()
returns a vector holding the differences between the corresponding points of the point sets ...
static const std::string MINIMUM()
std::vector< double > m_DifferencesVector
vector holding the differences between the corresponding points
void SetPointSets(mitk::PointSet::Pointer pSet1, mitk::PointSet::Pointer pSet2)
set point sets to be compared
double GetSD()
returns the standard deviation of the distances between all corresponding points of the point sets ...
~PointSetDifferenceStatisticsCalculator() override
static const std::string STANDARDDEVIATION()
static const std::string MAXIMUM()
double GetVariance()
returns the variance of the distances between all corresponding points of the point sets ...
double GetMin()
returns the minimal distance of all corresponding points of the point sets
mitk::PointSet::Pointer m_PointSet1
first point set used for comparison
unsigned long VoxelCountType
static const std::string MEAN()
double GetMean()
returns the mean distance of all corresponding points of the point sets
double GetMedian()
returns the median distance of all corresponding points of the point sets
PointSetDifferenceStatisticsCalculator()
void ComputeStatistics()
Method for computing the complete statistics of the differences between the given point sets...