![]() |
open_iA
2020.01
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
|
#include "open_iA_Core_export.h"#include <cassert>#include <cmath>#include <cstddef>#include <limits>#include <vector>Typedefs | |
| typedef std::vector< double > | FuncType |
Functions | |
| template<typename T > | |
| T | clamp (T const min, T const max, T const value) |
| Make sure the given value is inside the given range. More... | |
| open_iA_Core_API double | covariance (FuncType const &func1, FuncType const &func2, double mean1=std::numeric_limits< double >::infinity(), double mean2=std::numeric_limits< double >::infinity(), bool correctDF=true) |
| Compute covariance between two functions. More... | |
| template<typename RealType > | |
| bool | dblApproxEqual (RealType a, RealType b, RealType tolerance=std::numeric_limits< RealType >::epsilon()) |
| Checks whether two real values are equal, given a certain tolerance. More... | |
| open_iA_Core_API FuncType | derivative (FuncType const &func) |
| Calculate first derivative of a given function. More... | |
| open_iA_Core_API double | gaussian (double x, double sigma) |
| Compute Gaussian function for the given value x and parameter sigma (mean = 0). More... | |
| open_iA_Core_API FuncType | gaussianKernel (double kernelSigma, size_t kernelSteps) |
| Compute a gaussian kernel with the given sigma (mean = 0). More... | |
| open_iA_Core_API FuncType | gaussianSmoothing (FuncType const &data, double kernelSigma, int kernelSteps) |
| Convolutes the given function with a Gaussian kernel with the given sigma and steps. More... | |
| template<typename T > | |
| T | invertValue (T const *range, T const value) |
| Invert value in a given range. More... | |
| template<typename T > | |
| T | linterp (const T a, const T b, const T t) |
| Linear interpolation in a given range. More... | |
| template<typename DstType > | |
| DstType | mapNormTo (DstType minDstVal, DstType maxDstVal, double norm) |
| Map value from "norm" range [0..1] to the given range. More... | |
| template<typename T > | |
| T | mapToNorm (const T *range, const T value) |
| Map values from a given range to the "normalized" range [0..1]. More... | |
| template<typename SrcType > | |
| double | mapToNorm (SrcType const minSrcVal, SrcType const maxSrcVal, SrcType const value) |
| map value from given interval to "norm" interval [0..1] if min is bigger than max, a reverse mapping is applied More... | |
| template<typename SrcType , typename DstType > | |
| DstType | mapValue (SrcType minSrcVal, SrcType maxSrcVal, DstType minDstVal, DstType maxDstVal, SrcType value) |
| Map value from one range to another. More... | |
| template<typename T > | |
| T | mapValue (T const *rangeSrc, T const *rangeDst, T const value) |
| Map value from one range to another. More... | |
| open_iA_Core_API double | mean (FuncType const &func) |
| Compute the mean of a function. More... | |
| template<typename SrcType > | |
| double | minMaxNormalize (SrcType const minSrcVal, SrcType const maxSrcVal, SrcType const value) |
| apply minmax normalization if min is bigger than max, a reverse mapping is applied More... | |
| template<typename SrcType > | |
| double | normalizedToMinMax (SrcType const minSrcVal, SrcType const maxSrcVal, SrcType const value) |
| open_iA_Core_API double | pearsonsCorrelationCoefficient (FuncType const &func1, FuncType const &func2) |
| Calculate the Pearson's correlation coefficient between two functions. More... | |
| template<typename T > | |
| T | round (T const &number) |
| Round a number to the nearest integer representation (by "round half away from zero" method). More... | |
| open_iA_Core_API double | standardDeviation (FuncType const &func, double meanVal=std::numeric_limits< double >::infinity(), bool correctDF=true) |
| 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=std::numeric_limits< double >::infinity(), bool correctDF=true) |
| Compute the variation of a function. If known, mean can be given (to improve speed). More... | |
| typedef std::vector<double> FuncType |
| T clamp | ( | T const | min, |
| T const | max, | ||
| T const | value | ||
| ) |
Make sure the given value is inside the given range.
| min | the minimum value which should be returned |
| max | the maximum value which should be returned |
| value | the value to check |
| open_iA_Core_API double covariance | ( | FuncType const & | func1, |
| FuncType const & | func2, | ||
| double | mean1 = std::numeric_limits< double >::infinity(), |
||
| double | mean2 = std::numeric_limits< double >::infinity(), |
||
| bool | correctDF = true |
||
| ) |
Compute covariance between two functions.
| bool dblApproxEqual | ( | RealType | a, |
| RealType | b, | ||
| RealType | tolerance = std::numeric_limits<RealType>::epsilon() |
||
| ) |
Checks whether two real values are equal, given a certain tolerance.
inspired by https://stackoverflow.com/a/41405501/671366
Calculate first derivative of a given function.
| open_iA_Core_API double gaussian | ( | double | x, |
| double | sigma | ||
| ) |
Compute Gaussian function for the given value x and parameter sigma (mean = 0).
| open_iA_Core_API FuncType gaussianKernel | ( | double | kernelSigma, |
| size_t | kernelSteps | ||
| ) |
Compute a gaussian kernel with the given sigma (mean = 0).
| open_iA_Core_API FuncType 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)
| T invertValue | ( | T const * | range, |
| T const | value | ||
| ) |
Invert value in a given range.
Example: invertValue(range=[0, 1], value=0.2) = 0.8; invertValue(range=[1,2], value=1.3) = 1.7
| range | an array of size 2 with minimum and maximum value of the range |
| value | the value to be inverted. |
|
inline |
Linear interpolation in a given range.
| a | minimum of the interpolation range |
| b | maximum of the interpolation range |
| t | a value from the range [0..1] specifying the interpolation position |
| DstType mapNormTo | ( | DstType | minDstVal, |
| DstType | maxDstVal, | ||
| double | norm | ||
| ) |
Map value from "norm" range [0..1] to the given range.
| minDstVal | minimum value of destination range |
| maxDstVal | maximum value of destination range |
| norm | a value in range [0..1] |
|
inline |
Map values from a given range to the "normalized" range [0..1].
if min is bigger than max, a reverse mapping is applied
| range | an array of size 2 with minimum and maximum value of the source range |
| value | the value to be mapped from the source range to the destination range |
| double mapToNorm | ( | SrcType const | minSrcVal, |
| SrcType const | maxSrcVal, | ||
| SrcType const | value | ||
| ) |
map value from given interval to "norm" interval [0..1] if min is bigger than max, a reverse mapping is applied
| minSrcVal | minimum value of source interval |
| maxSrcVal | maximum value of source interval |
| value | a value in source interval |
| DstType mapValue | ( | SrcType | minSrcVal, |
| SrcType | maxSrcVal, | ||
| DstType | minDstVal, | ||
| DstType | maxDstVal, | ||
| SrcType | value | ||
| ) |
Map value from one range to another.
| minSrcVal | minimum value of source range |
| maxSrcVal | maximum value of source range |
| minDstVal | minimum value of destination range |
| maxDstVal | maximum value of destination range |
| value | the value to be mapped from the source range to the destination range |
|
inline |
Map value from one range to another.
| rangeSrc | an array of size 2 with minimum and maximum value of the source range |
| rangeDst | an array of size 2 with minimum and maximum value of the destination range |
| value | the value to be mapped from the source range to the destination range |
| open_iA_Core_API double mean | ( | FuncType const & | func | ) |
Compute the mean of a function.
| double minMaxNormalize | ( | SrcType const | minSrcVal, |
| SrcType const | maxSrcVal, | ||
| SrcType const | value | ||
| ) |
apply minmax normalization if min is bigger than max, a reverse mapping is applied
| minSrcVal | minimum value of source interval |
| maxSrcVal | maximum value of source interval |
| value | a value in source interval |
| double normalizedToMinMax | ( | SrcType const | minSrcVal, |
| SrcType const | maxSrcVal, | ||
| SrcType const | value | ||
| ) |
| open_iA_Core_API double pearsonsCorrelationCoefficient | ( | FuncType const & | func1, |
| FuncType const & | func2 | ||
| ) |
Calculate the Pearson's correlation coefficient between two functions.
| T round | ( | T const & | number | ) |
Round a number to the nearest integer representation (by "round half away from zero" method).
| number | the number to round |
| open_iA_Core_API double standardDeviation | ( | FuncType const & | func, |
| double | meanVal = std::numeric_limits< double >::infinity(), |
||
| bool | correctDF = true |
||
| ) |
Compute the standard deviation of a function. mean can be given (to improve speed).
| open_iA_Core_API double variance | ( | FuncType const & | func, |
| double | meanVal = std::numeric_limits< double >::infinity(), |
||
| bool | correctDF = true |
||
| ) |
Compute the variation of a function. If known, mean can be given (to improve speed).
1.8.16