open_iA 2023.02
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Loading...
Searching...
No Matches
Functions
iAMathUtility.cpp File Reference
#include "iAMathUtility.h"
#include <vtkMath.h>

Functions

double covariance (FuncType const &func1, FuncType const &func2, double mean1, double mean2, bool correctDF)
 Compute covariance between two functions.
 
std::vector< double > derivative (std::vector< double > const &func)
 Calculate first derivative of a given function.
 
double gaussian (double x, double sigma)
 Compute Gaussian function for the given value x and parameter sigma (mean = 0).
 
std::vector< double > gaussianKernel (double kernelSigma, size_t kernelSteps)
 Compute a gaussian kernel with the given sigma (mean = 0).
 
std::vector< double > gaussianSmoothing (std::vector< double > const &data, double kernelSigma, int kernelSteps)
 Convolutes the given function with a Gaussian kernel with the given sigma and steps.
 
FuncType getNormedRanks (FuncType const &func)
 Compute ranks for a given list of values.
 
double mean (FuncType const &func)
 Compute the mean of a function.
 
double pearsonsCorrelationCoefficient (FuncType const &func1, FuncType const &func2)
 Calculate the Pearson's correlation coefficient between two functions.
 
double spearmansCorrelationCoefficient (FuncType const &func1, FuncType const &func2)
 Calculate the Spearman's correlation coefficient between two functions.
 
double standardDeviation (FuncType const &func, double meanVal, bool correctDF)
 Compute the standard deviation of a function. mean can be given (to improve speed).
 
double variance (FuncType const &func, double meanVal, bool correctDF)
 Compute the variation of a function. If known, mean can be given (to improve speed).
 

Function Documentation

◆ covariance()

double covariance ( FuncType const &  func1,
FuncType const &  func2,
double  mean1,
double  mean2,
bool  correctDF 
)

Compute covariance between two functions.

◆ derivative()

std::vector< double > derivative ( std::vector< double > const &  func)

Calculate first derivative of a given function.

◆ gaussian()

double gaussian ( double  x,
double  sigma 
)

Compute Gaussian function for the given value x and parameter sigma (mean = 0).

◆ gaussianKernel()

std::vector< double > gaussianKernel ( double  kernelSigma,
size_t  kernelSteps 
)

Compute a gaussian kernel with the given sigma (mean = 0).

◆ gaussianSmoothing()

std::vector< double > gaussianSmoothing ( FuncType const &  data,
double  kernelSigma,
int  kernelSteps 
)

Convolutes the given function with a Gaussian kernel with the given sigma and steps.

TODO: number of steps could be calculated from sigma (cut off kernel when factor gets very small)

◆ getNormedRanks()

FuncType getNormedRanks ( FuncType const &  func)

Compute ranks for a given list of values.

◆ mean()

double mean ( FuncType const &  func)

Compute the mean of a function.

◆ pearsonsCorrelationCoefficient()

double pearsonsCorrelationCoefficient ( FuncType const &  func1,
FuncType const &  func2 
)

Calculate the Pearson's correlation coefficient between two functions.

◆ spearmansCorrelationCoefficient()

double spearmansCorrelationCoefficient ( FuncType const &  func1,
FuncType const &  func2 
)

Calculate the Spearman's correlation coefficient between two functions.

◆ standardDeviation()

double standardDeviation ( FuncType const &  func,
double  meanVal,
bool  correctDF 
)

Compute the standard deviation of a function. mean can be given (to improve speed).

◆ variance()

double variance ( FuncType const &  func,
double  meanVal,
bool  correctDF 
)

Compute the variation of a function. If known, mean can be given (to improve speed).