GooseEYE 0.9.1
Loading...
Searching...
No Matches
GooseEYE::Ensemble Class Reference

Compute ensemble averaged statistics, by repetitively calling the member-function of a certain statistical measure with different data. More...

#include <GooseEYE/GooseEYE.h>

Public Member Functions

 Ensemble ()=default
 Constructor.
 
 Ensemble (const std::vector< size_t > &roi, bool periodic=true, bool variance=true)
 Constructor.
 
array_type::array< double > result () const
 Get ensemble average.
 
array_type::array< double > variance () const
 Get ensemble variance.
 
array_type::array< double > data_first () const
 Get raw-data: ensemble sum of the first moment: x_1 + x_2 + ...
 
array_type::array< double > data_second () const
 Get raw-data: ensemble sum of the second moment: x_1^2 + x_2^2 + ...
 
array_type::array< double > norm () const
 Get raw-data: normalisation (number of measurements per pixel).
 
array_type::array< double > distance () const
 Get the relative distance of each pixel in the 'region-of-interest' to its center.
 
array_type::array< double > distance (size_t axis) const
 Get the relative distance of each pixel in the 'region-of-interest' to its center, along a specific axis (distance can now be positive and negative).
 
array_type::array< double > distance (const std::vector< double > &h) const
 Get the relative distance of each pixel in the 'region-of-interest' to its center.
 
array_type::array< double > distance (const std::vector< double > &h, size_t axis) const
 Get the relative distance of each pixel in the 'region-of-interest' to its center, along a specific axis (distance can now be positive and negative).
 
template<class T >
void mean (const T &f)
 Add realization to arithmetic mean.
 
template<class T , class M >
void mean (const T &f, const M &fmask)
 Add realization to arithmetic mean.
 
template<class T >
void S2 (const T &f, const T &g)
 Add realization to 2-point correlation: P(f(i) * g(i + di)).
 
template<class T , class M >
void S2 (const T &f, const T &g, const M &fmask, const M &gmask)
 Add realization to 2-point correlation: P(f(i) * g(i + di)).
 
template<class T >
void C2 (const T &f, const T &g)
 Add realization to 2-point cluster function: P(f(i) == g(i + di)).
 
template<class T , class M >
void C2 (const T &f, const T &g, const M &fmask, const M &gmask)
 Add realization to 2-point cluster function: P(f(i) == g(i + di)).
 
template<class T >
void W2 (const T &w, const T &f)
 Add realization to weighted 2-point correlation.
 
template<class T , class M >
void W2 (const T &w, const T &f, const M &fmask)
 Add realization to weighted 2-point correlation.
 
template<class C , class T >
void W2c (const C &clusters, const C &centers, const T &f, path_mode mode=path_mode::Bresenham)
 Add realization to collapsed weighted 2-point correlation.
 
template<class C , class T , class M >
void W2c (const C &clusters, const C &centers, const T &f, const M &fmask, path_mode mode=path_mode::Bresenham)
 Add realization to collapsed weighted 2-point correlation.
 
template<class T >
void heightheight (const T &f)
 Add realization to height-height correlation.
 
template<class T , class M >
void heightheight (const T &f, const M &fmask)
 Add realization to height-height correlation.
 
template<class T >
void L (const T &f, path_mode mode=path_mode::Bresenham)
 Add realization to lineal-path function.
 

Detailed Description

Compute ensemble averaged statistics, by repetitively calling the member-function of a certain statistical measure with different data.

Note:

  • One class instance can only be used to compute one statistical measure.
  • Simple wrapper functions are provided to compute the statistical measure on one image.
  • The normalized result can be read at any moment using 'result', without affecting the raw-data.
  • The raw-data and normalization are separately stored as class member variables.

Definition at line 1402 of file GooseEYE.h.

Constructor & Destructor Documentation

◆ Ensemble()

GooseEYE::Ensemble::Ensemble ( const std::vector< size_t > & roi,
bool periodic = true,
bool variance = true )
inline

Constructor.

Parameters
roiShape of the 'region-of-interest' on which the statistics are computed.
periodicSwitch to assume image periodic.
varianceSwitch to compute the variance together with the mean.

Definition at line 14 of file Ensemble.hpp.

Member Function Documentation

◆ C2() [1/2]

template<class T >
void GooseEYE::Ensemble::C2 ( const T & f,
const T & g )
inline

Add realization to 2-point cluster function: P(f(i) == g(i + di)).

Parameters
fThe image.
gThe comparison image.

Definition at line 84 of file Ensemble_C2.hpp.

◆ C2() [2/2]

template<class T , class M >
void GooseEYE::Ensemble::C2 ( const T & f,
const T & g,
const M & fmask,
const M & gmask )
inline

Add realization to 2-point cluster function: P(f(i) == g(i + di)).

Parameters
fThe image.
gThe comparison image.
fmaskMask certain pixels of f (binary, 1: masked, 0: not masked).
gmaskMask certain pixels of g (binary, 1: masked, 0: not masked).

Definition at line 15 of file Ensemble_C2.hpp.

◆ data_first()

array_type::array< double > GooseEYE::Ensemble::data_first ( ) const
inline

Get raw-data: ensemble sum of the first moment: x_1 + x_2 + ...

Returns
The sum along the 'region-of-interest' set at construction.

Definition at line 53 of file Ensemble.hpp.

◆ data_second()

array_type::array< double > GooseEYE::Ensemble::data_second ( ) const
inline

Get raw-data: ensemble sum of the second moment: x_1^2 + x_2^2 + ...

Returns
The sum along the 'region-of-interest' set at construction.

Definition at line 59 of file Ensemble.hpp.

◆ distance() [1/4]

array_type::array< double > GooseEYE::Ensemble::distance ( ) const
inline

Get the relative distance of each pixel in the 'region-of-interest' to its center.

Returns
The distances along the 'region-of-interest' set at construction.

Definition at line 103 of file Ensemble.hpp.

◆ distance() [2/4]

array_type::array< double > GooseEYE::Ensemble::distance ( const std::vector< double > & h) const
inline

Get the relative distance of each pixel in the 'region-of-interest' to its center.

Convert the distance to physical dimensions.

Parameters
hThe physical dimensions of one pixel (in each direction).
Returns
The distances along the 'region-of-interest' set at construction.

Definition at line 114 of file Ensemble.hpp.

◆ distance() [3/4]

array_type::array< double > GooseEYE::Ensemble::distance ( const std::vector< double > & h,
size_t axis ) const
inline

Get the relative distance of each pixel in the 'region-of-interest' to its center, along a specific axis (distance can now be positive and negative).

Convert the distance to physical dimensions.

Parameters
hThe physical dimensions of one pixel (in each direction).
axisSelect axis.
Returns
The distances along the 'region-of-interest' set at construction.

Definition at line 127 of file Ensemble.hpp.

◆ distance() [4/4]

array_type::array< double > GooseEYE::Ensemble::distance ( size_t axis) const
inline

Get the relative distance of each pixel in the 'region-of-interest' to its center, along a specific axis (distance can now be positive and negative).

Parameters
axisSelect axis.
Returns
The distances along the 'region-of-interest' set at construction.

Definition at line 71 of file Ensemble.hpp.

◆ heightheight() [1/2]

template<class T >
void GooseEYE::Ensemble::heightheight ( const T & f)
inline

Add realization to height-height correlation.

The height-height correlation, at position \( \Delta i \), is defined as: \( \frac{1}{N} \left( \sum_{i=1}^{N} (f_i - f_{i + \Delta i})^2 \right)^{1/2} \)

Parameters
fThe image.

Definition at line 80 of file Ensemble_heightheight.hpp.

◆ heightheight() [2/2]

template<class T , class M >
void GooseEYE::Ensemble::heightheight ( const T & f,
const M & fmask )
inline

Add realization to height-height correlation.

The height-height correlation, at position \( \Delta i \), is defined as: \( \frac{1}{N} \left( \sum_{i=1}^{N} (f_i - f_{i + \Delta i})^2 \right)^{1/2} \)

Parameters
fThe image.
fmaskMask certain pixels of f (binary, 1: masked, 0: not masked).

Definition at line 15 of file Ensemble_heightheight.hpp.

◆ L()

template<class T >
void GooseEYE::Ensemble::L ( const T & f,
path_mode mode = path_mode::Bresenham )
inline

Add realization to lineal-path function.

Parameters
fThe image.
modeMethod to use (see "path_mode").

Definition at line 15 of file Ensemble_L.hpp.

◆ mean() [1/2]

template<class T >
void GooseEYE::Ensemble::mean ( const T & f)

Add realization to arithmetic mean.

Parameters
fThe image.

Definition at line 15 of file Ensemble_mean.hpp.

◆ mean() [2/2]

template<class T , class M >
void GooseEYE::Ensemble::mean ( const T & f,
const M & fmask )

Add realization to arithmetic mean.

Parameters
fThe image.
fmaskMask certain pixels (binary, 1: masked, 0: not masked).

Definition at line 28 of file Ensemble_mean.hpp.

◆ norm()

array_type::array< double > GooseEYE::Ensemble::norm ( ) const
inline

Get raw-data: normalisation (number of measurements per pixel).

Returns
The norm along the 'region-of-interest' set at construction.

Definition at line 65 of file Ensemble.hpp.

◆ result()

array_type::array< double > GooseEYE::Ensemble::result ( ) const
inline

Get ensemble average.

Returns
The average along the 'region-of-interest' set at construction.

Definition at line 26 of file Ensemble.hpp.

◆ S2() [1/2]

template<class T >
void GooseEYE::Ensemble::S2 ( const T & f,
const T & g )
inline

Add realization to 2-point correlation: P(f(i) * g(i + di)).

Parameters
fThe image.
gThe comparison image.

Definition at line 84 of file Ensemble_S2.hpp.

◆ S2() [2/2]

template<class T , class M >
void GooseEYE::Ensemble::S2 ( const T & f,
const T & g,
const M & fmask,
const M & gmask )
inline

Add realization to 2-point correlation: P(f(i) * g(i + di)).

Parameters
fThe image.
gThe comparison image.
fmaskMask certain pixels of f (binary, 1: masked, 0: not masked).
gmaskMask certain pixels of g (binary, 1: masked, 0: not masked).

Definition at line 15 of file Ensemble_S2.hpp.

◆ variance()

array_type::array< double > GooseEYE::Ensemble::variance ( ) const
inline

Get ensemble variance.

Returns
The variance along the 'region-of-interest' set at construction.

Definition at line 37 of file Ensemble.hpp.

◆ W2() [1/2]

template<class T >
void GooseEYE::Ensemble::W2 ( const T & w,
const T & f )
inline

Add realization to weighted 2-point correlation.

Parameters
wThe weights.
fThe image.

Definition at line 76 of file Ensemble_W2.hpp.

◆ W2() [2/2]

template<class T , class M >
void GooseEYE::Ensemble::W2 ( const T & w,
const T & f,
const M & fmask )
inline

Add realization to weighted 2-point correlation.

Parameters
wThe weights.
fThe image.
fmaskMask certain pixels of f (binary, 1: masked, 0: not masked).

Definition at line 15 of file Ensemble_W2.hpp.

◆ W2c() [1/2]

template<class C , class T , class M >
void GooseEYE::Ensemble::W2c ( const C & clusters,
const C & centers,
const T & f,
const M & fmask,
path_mode mode = path_mode::Bresenham )
inline

Add realization to collapsed weighted 2-point correlation.

Parameters
clustersThe clusters.
centersThe cluster-centers: label only at the center.
fThe image.
modeMethod to use (see "path_mode").
fmaskMask certain pixels of f (binary, 1: masked, 0: not masked).

Definition at line 16 of file Ensemble_W2c.hpp.

◆ W2c() [2/2]

template<class C , class T >
void GooseEYE::Ensemble::W2c ( const C & clusters,
const C & centers,
const T & f,
path_mode mode = path_mode::Bresenham )
inline

Add realization to collapsed weighted 2-point correlation.

Parameters
clustersThe clusters.
centersThe cluster-centers: label only at the center.
fThe image.
modeMethod to use (see "path_mode").

Definition at line 123 of file Ensemble_W2c.hpp.


The documentation for this class was generated from the following files: