ANIMA  4.0
animaDistributionSampling.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <random>
4 #include <vnl/vnl_matrix.h>
5 #include <vnl/vnl_vector_fixed.h>
6 
7 #include <itkPoint.h>
8 #include <itkVector.h>
9 
10 namespace anima
11 {
12 
13 template <class T>
14 double SampleFromUniformDistribution(const T &a, const T &b, std::mt19937 &generator);
15 
16 template <class VectorType>
17 void SampleFromUniformDistributionOn2Sphere(std::mt19937 &generator, VectorType &resVec);
18 
19 template <class T>
20 unsigned int SampleFromBernoulliDistribution(const T &p, std::mt19937 &generator);
21 
22 template <class T>
23 double SampleFromGaussianDistribution(const T &mean, const T &std, std::mt19937 &generator);
24 
25 template <class VectorType, class ScalarType>
26 void SampleFromMultivariateGaussianDistribution(const VectorType &mean, const vnl_matrix <ScalarType> &mat, VectorType &resVec,
27  std::mt19937 &generator, bool isMatCovariance = true);
28 
29 // From Ulrich 1984
30 template <class VectorType, class ScalarType>
31 void SampleFromVMFDistribution(const ScalarType &kappa, const VectorType &meanDirection, VectorType &resVec, std::mt19937 &generator);
32 
33 // From Wenzel 2012
34 template <class VectorType, class ScalarType>
35 void SampleFromVMFDistributionNumericallyStable(const ScalarType &kappa, const VectorType &meanDirection, VectorType &resVec, std::mt19937 &generator);
36 
37 template <class ScalarType, class VectorType>
38 void
39 SampleFromWatsonDistribution(const ScalarType &kappa, const VectorType &meanDirection, VectorType &resVec, unsigned int DataDimension, std::mt19937 &generator);
40 
41 template <class ScalarType, unsigned int DataDimension>
42 void
43 SampleFromWatsonDistribution(const ScalarType &kappa, const vnl_vector_fixed < ScalarType, DataDimension > &meanDirection, vnl_vector_fixed < ScalarType, DataDimension > &resVec, std::mt19937 &generator);
44 
45 template <class ScalarType, unsigned int DataDimension>
46 void
47 SampleFromWatsonDistribution(const ScalarType &kappa, const itk::Point < ScalarType, DataDimension > &meanDirection, itk::Point < ScalarType, DataDimension > &resVec, std::mt19937 &generator);
48 
49 template <class ScalarType, unsigned int DataDimension>
50 void
51 SampleFromWatsonDistribution(const ScalarType &kappa, const itk::Vector < ScalarType, DataDimension > &meanDirection, itk::Vector < ScalarType, DataDimension > &resVec, std::mt19937 &generator);
52 
53 } // end of namespace anima
54 
void SampleFromUniformDistributionOn2Sphere(std::mt19937 &generator, VectorType &resVec)
STL namespace.
void SampleFromVMFDistribution(const ScalarType &kappa, const VectorType &meanDirection, VectorType &resVec, std::mt19937 &generator)
void SampleFromVMFDistributionNumericallyStable(const ScalarType &kappa, const VectorType &meanDirection, VectorType &resVec, std::mt19937 &generator)
unsigned int SampleFromBernoulliDistribution(const T &p, std::mt19937 &generator)
double SampleFromGaussianDistribution(const T &mean, const T &std, std::mt19937 &generator)
void SampleFromMultivariateGaussianDistribution(const VectorType &mean, const vnl_matrix< ScalarType > &mat, VectorType &resVec, std::mt19937 &generator, bool isMatCovariance=true)
void SampleFromWatsonDistribution(const ScalarType &kappa, const VectorType &meanDirection, VectorType &resVec, unsigned int DataDimension, std::mt19937 &generator)
double SampleFromUniformDistribution(const T &a, const T &b, std::mt19937 &generator)