aimsdata 6.0.0
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 notnull_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() );
}
static T median(Iterator b, Iterator e, T default_value=(T) 0)
Definition mathelem.h:143
iterator begin()
iterator end()
The class for EcatSino data write operation.

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 276 of file mathelem.h.

References aims::absdiff(), max(), and min().

◆ majority()

template<typename T>
template<typename Iterator>
static T aims::MathUtil< T >::majority ( Iterator b,
Iterator e,
T 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,
T default_value = carto::min_limit<T>() )
inlinestatic

Definition at line 121 of file mathelem.h.

References aims::internal::is_min(), and carto::min_limit().

Referenced by extrema_difference().

◆ 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,
T 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,
T default_value = std::numeric_limits<T>::max() )
inlinestatic

Definition at line 132 of file mathelem.h.

References aims::internal::is_min(), and std::numeric_limits< typename _Tp >::max().

Referenced by extrema_difference().

◆ notnull_majority()

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

Definition at line 238 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,
T 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 317 of file mathelem.h.

◆ sum()

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

Definition at line 285 of file mathelem.h.

Referenced by mean(), and notnull_mean().

◆ variance()

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

Definition at line 297 of file mathelem.h.


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