[ 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>`

## 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, unsigned int N)
void | updatePassN (T const &t, double weight, 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;

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;

See Feature Accumulators for more information and examples of use.

## Member Function Documentation

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

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

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

static

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

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.

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.

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

Reset current_pass_ of the accumulator chain to 'reset_to_pass'.

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

Equivalent to merge(o) .

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.

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.

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.

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.10.0