34#include <drain/UniTuple.h>
39#include "ImpulseResponseOp.h"
54 Decay2(
double decay = 1.0) : forward(this->next()), backward(this->next()) {
70 Decay4(T decay=0.5) : horz(this->tuple(), 0), vert(this->tuple(), 2) {
75 Decay4(
const Decay4 & r) : horz(this->tuple(), 0), vert(this->tuple(), 2){
80 this->set(decay.tuple());
97 this->parameters.link(
"decay", decays.tuple());
104 BeanLike(__FUNCTION__,
"Infinite-impulse response type spreading"), decays(0.75){
105 this->parameters.link(
"decay", decays.tuple());
152 decays = conf.decays;
163 void addLeft(
int i,
double value,
double weight);
167 void addRight(
int i,
double value,
double weight);
171 void addDown(
int i,
double value,
double weight);
175 void addUp(
int i,
double value,
double weight);
197 inline void set(
double value,
double weight){
199 this->weight = weight;
209 void mix(entry & prev,
const entry & e,
double decay){
211 double w1 = decay*e.weight;
212 double w2 = (1.0-decay);
215 prev.x =(w1*e.x + w2*prev.x) / (w1 + w2);
219 prev.weight = w1 + w2*prev.weight;
223 typedef std::pair<entry,entry> entryPair;
224 typedef std::vector<entryPair> container;
Something which has a name, a description and possibly some parameters of varying type.
Definition BeanLike.h:58
void fill(T i)
Set all the elements to i.
Definition TupleBase.h:315
Tuple of N elements of type T.
Definition UniTuple.h:65
Linear scaling and physical range for image intensities.
Definition ValueScaling.h:63
Image with static geometry.
Definition ImageChannel.h:58
Definition ImpulseAvgOp.h:47
Averaging operator. A simple example implementation of ImpulseBucket.
Definition ImpulseAvgOp.h:135
virtual void addUp(int i, double value, double weight)
Accumulate encoded value.
Definition ImpulseAvgOp.cpp:86
virtual void init(const Channel &src, bool horizontal)
Adapt to input geometry, type, and scaling.
Definition ImpulseAvgOp.cpp:41
virtual double getWeight(int i)
Return weight at position i.
Definition ImpulseAvgOp.cpp:93
virtual void addRight(int i, double value, double weight)
Accumulate encoded value.
Definition ImpulseAvgOp.cpp:74
virtual double get(int i)
Return natural (not encoded) value at position i.
Definition ImpulseAvgOp.cpp:98
virtual void addLeft(int i, double value, double weight)
Accumulate encoded value.
Definition ImpulseAvgOp.cpp:68
virtual void addDown(int i, double value, double weight)
Accumulate encoded value.
Definition ImpulseAvgOp.cpp:80
virtual void reset()
Clear statistics before traversing each row or column.
Definition ImpulseAvgOp.cpp:55
Definition ImpulseResponseOp.h:54
Definition DataSelector.cpp:1277
Definition ImpulseAvgOp.h:65
Definition ImpulseAvgOp.h:90