aimsdata  5.0.5
Neuroimaging data handling
aims::MathUtil< T > Class Template Reference

Defines basic math functions that run on iterators. More...

#include <aims/math/mathelem.h>

Static Public Member Functions

template<typename Iterator >
static T max (Iterator b, Iterator e, T default_value=carto::min_limit< T >())
 
template<typename Iterator >
static T min (Iterator b, Iterator e, T default_value=std::numeric_limits< T >::max())
 
template<typename Iterator >
static T median (Iterator b, Iterator e, T default_value=(T) 0)
 
template<typename Iterator >
static T notnull_median (Iterator b, Iterator e, T default_value=(T) 0)
 
template<typename Iterator >
static T mean (Iterator b, Iterator e)
 
template<typename Iterator >
static T notnull_mean (Iterator b, Iterator e)
 
template<typename Iterator >
static T majority (Iterator b, Iterator e, T default_value=(T) 0)
 
template<typename Iterator >
static T extrema_difference (Iterator b, Iterator e)
 
template<typename Iterator >
static T sum (Iterator b, Iterator e)
 
template<typename Iterator >
static T variance (Iterator b, Iterator e)
 
template<typename Iterator >
static T stdev (Iterator b, Iterator e)
 

Detailed Description

template<typename T>
class aims::MathUtil< T >

Defines basic math functions that run on iterators.

They can be used with any iterators pointing to numeric values

#include <aims/math/matheleme.h>
using namespace aims;
using namespace carto;
int main()
{
int16_t med = MathUtil<int16_t>::median( image.begin(), image.end() );
}

Definition at line 117 of file mathelem.h.

Member Function Documentation

◆ extrema_difference()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::extrema_difference ( Iterator  b,
Iterator  e 
)
inlinestatic

Definition at line 238 of file mathelem.h.

References max(), and min().

◆ majority()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::majority ( Iterator  b,
Iterator  e,
default_value = (T)0 
)
inlinestatic

Definition at line 203 of file mathelem.h.

◆ max()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::max ( Iterator  b,
Iterator  e,
default_value = carto::min_limit<T>() 
)
inlinestatic

Definition at line 121 of file mathelem.h.

◆ mean()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::mean ( Iterator  b,
Iterator  e 
)
inlinestatic

Definition at line 172 of file mathelem.h.

References sum().

◆ median()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::median ( Iterator  b,
Iterator  e,
default_value = (T)0 
)
inlinestatic

Definition at line 143 of file mathelem.h.

Referenced by aims::BorderFiller< T >::fillMedian().

◆ min()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::min ( Iterator  b,
Iterator  e,
default_value = std::numeric_limits<T>::max() 
)
inlinestatic

Definition at line 132 of file mathelem.h.

◆ notnull_mean()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::notnull_mean ( Iterator  b,
Iterator  e 
)
inlinestatic

Definition at line 187 of file mathelem.h.

References sum().

◆ notnull_median()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::notnull_median ( Iterator  b,
Iterator  e,
default_value = (T)0 
)
inlinestatic

Definition at line 157 of file mathelem.h.

◆ stdev()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::stdev ( Iterator  b,
Iterator  e 
)
inlinestatic

Definition at line 279 of file mathelem.h.

References accumulate(), and AimsArgument().

◆ sum()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::sum ( Iterator  b,
Iterator  e 
)
inlinestatic

Definition at line 247 of file mathelem.h.

References accumulate().

◆ variance()

template<typename T>
template<typename Iterator >
static T aims::MathUtil< T >::variance ( Iterator  b,
Iterator  e 
)
inlinestatic

Definition at line 259 of file mathelem.h.

References accumulate().


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