[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

AccumulatorChain< T, Selected, dynamic > Class Template Reference

Create an accumulator chain containing the selected statistics and their dependencies. More...

`#include <vigra/accumulator.hxx>`

Inheritance diagram for AccumulatorChain< T, Selected, dynamic >:

## Public Member Functions

void | merge (AccumulatorChainImpl const &o)
void | operator+= (AccumulatorChainImpl const &o)
unsigned int | passesRequired () const
void | reset (unsigned int reset_to_pass=0)
template<class U , int N>
void | reshape (TinyVector< U, N > const &s)
template<class SHAPE >
void | setCoordinateOffset (SHAPE const &offset)
void | setHistogramOptions (HistogramOptions const &options)
void | updatePassN (T const &t, double weight, unsigned int N)
void | updatePassN (T const &t, unsigned int N)

## Static Public Member Functions

static ArrayVector< std::string > const & | tagNames ()

## Detailed Description

template<class T, class Selected, bool dynamic = false>
class vigra::acc::AccumulatorChain< T, Selected, dynamic >

Create an accumulator chain containing the selected statistics and their dependencies.

AccumulatorChain is used to compute global statistics which have to be selected at compile time.

The template parameters are as follows:

- T: The input type
  - either element type of the data(e.g. double, int, RGBValue, ...)
  - or type of CoupledHandle (for simultaneous access to coordinates and/or weights)
- Selected: statistics to be computed and index specifier for the CoupledHandle, wrapped with Select

Usage:

typedef double DataType;
AccumulatorChain<DataType, Select<Variance, Mean, Minimum, ...> > accumulator;
vigra::RGBValue
Class for a single RGB value.
Definition rgbvalue.hxx:128
vigra::acc::AccumulatorChain
Create an accumulator chain containing the selected statistics and their dependencies.
Definition accumulator.hxx:2046
vigra::acc::Minimum
Basic statistic. Minimum value.
Definition accumulator.hxx:5129
vigra::acc::Mean
DivideByCount< Sum > Mean
Alias. Mean.
Definition accumulator-grammar.hxx:173
vigra::acc::Variance
DivideByCount< Central< PowerSum< 2 > > > Variance
Alias. Variance.
Definition accumulator-grammar.hxx:195
vigra::acc::Select
Wrapper for MakeTypeList that additionally performs tag standardization.
Definition accumulator.hxx:408

Usage, using CoupledHandle:

const int dim = 3; //dimension of MultiArray
typedef double DataType;
typedef double WeightType;
typedef vigra::CoupledIteratorType<dim, DataType, WeightType>::HandleType Handle;
AccumulatorChain<Handle, Select<DataArg<1>, WeightArg<2>, Mean,...> > a;
vigra::CoupledIteratorType::HandleType
CoupledHandleType< N, T1, T2, T3, T4, T5 >::type HandleType
Definition multi_iterator_coupled.hxx:719

See Feature Accumulators for more information and examples of use.

## Member Function Documentation

## ◆ reshape()

template<class T , class Selected , bool dynamic = false>
template<class U , int N>

void reshape | ( | TinyVector< U, N > const & | s | ) |

Before having seen data (current_pass_==0), the shape of the data can be changed... (?)

## ◆ tagNames()

template<class T , class Selected , bool dynamic = false>

static ArrayVector< std::string > const & tagNames | ( |  | ) |

static

Return the names of all tags in the accumulator chain (selected statistics and their dependencies).

## ◆ setHistogramOptions()

template<class T , class Selected , bool dynamic = false>

void setHistogramOptions | ( | HistogramOptions const & | options | ) |

Set options for all histograms in the accumulator chain. See histogram accumulators for possible options. The function is ignored if there is no histogram in the accumulator chain.

## ◆ setCoordinateOffset()

template<class T , class Selected , bool dynamic = false>
template<class SHAPE >

void setCoordinateOffset | ( | SHAPE const & | offset | ) |

Set an offset for `Coord<...>` statistics.

If the offset is non-zero, coordinate statistics such as `RegionCenter` are computed in the global coordinate system defined by the offset. Without an offset, these statistics are computed in the local coordinate system of the current region of interest.

## ◆ reset()

template<class T , class Selected , bool dynamic = false>

void reset | ( | unsigned int | reset_to_pass = `0` | ) |

Reset current_pass_ of the accumulator chain to 'reset_to_pass'.

## ◆ operator+=()

template<class T , class Selected , bool dynamic = false>

void operator+= | ( | AccumulatorChainImpl const & | o | ) |

Equivalent to merge(o) .

## ◆ merge()

template<class T , class Selected , bool dynamic = false>

void merge | ( | AccumulatorChainImpl const & | o | ) |

Merge the accumulator chain with accumulator chain 'o'. This only works if all selected statistics in the accumulator chain support the '+=' operator. See the documentations of the particular statistics for support information.

## ◆ updatePassN() [1/2]

template<class T , class Selected , bool dynamic = false>

void updatePassN | ( | T const & | t,
|  | unsigned int | N
| ) |  |

Upate all accumulators in the accumulator chain that work in pass N with data t. Requirement: 0 < N < 6 and N >= current_pass_ . If N < current_pass_ call reset first.

## ◆ updatePassN() [2/2]

template<class T , class Selected , bool dynamic = false>

void updatePassN | ( | T const & | t,
|  | double | weight,
|  | unsigned int | N
| ) |  |

Upate all accumulators in the accumulator chain that work in pass N with data t and weight. Requirement: 0 < N < 6 and N >= current_pass_ . If N < current_pass_ call reset first.

## ◆ passesRequired()

template<class T , class Selected , bool dynamic = false>

unsigned int passesRequired | ( |  | ) | const

Return the number of passes required to compute all statistics in the accumulator chain.

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

- vigra/accumulator.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.12.1