open_iA  2019.12
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Functions
iAMathUtility.cpp File Reference
#include "iAMathUtility.h"
#include "iAConsole.h"
#include <vtkMath.h>
#include <algorithm>
#include <numeric>
Include dependency graph for iAMathUtility.cpp:

Functions

open_iA_Core_API double covariance (FuncType const &func1, FuncType const &func2, double mean1, double mean2, bool correctDF)
 Compute covariance between two functions. More...
 
open_iA_Core_API std::vector< double > derivative (std::vector< double > const &func)
 Calculate first derivative of a given function. More...
 
double gaussian (double x, double sigma)
 Compute Gaussian function for the given value x and parameter sigma (mean = 0). More...
 
std::vector< double > gaussianKernel (double kernelSigma, size_t kernelSteps)
 Compute a gaussian kernel with the given sigma (mean = 0). More...
 
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. More...
 
open_iA_Core_API double mean (FuncType const &func)
 Compute the mean of a function. More...
 
open_iA_Core_API double pearsonsCorrelationCoefficient (FuncType const &func1, FuncType const &func2)
 Calculate the Pearson's correlation coefficient between two functions. More...
 
open_iA_Core_API double standardDeviation (FuncType const &func, double meanVal, bool correctDF)
 Compute the standard deviation of a function. mean can be given (to improve speed). More...
 
open_iA_Core_API double variance (FuncType const &func, double meanVal, bool correctDF)
 Compute the variation of a function. If known, mean can be given (to improve speed). More...
 

Function Documentation

◆ covariance()

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

Compute covariance between two functions.

◆ derivative()

open_iA_Core_API 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)

◆ mean()

open_iA_Core_API double mean ( FuncType const &  func)

Compute the mean of a function.

◆ pearsonsCorrelationCoefficient()

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

Calculate the Pearson's correlation coefficient between two functions.

◆ standardDeviation()

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

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

◆ variance()

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

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