aimsdata 6.0.0
Neuroimaging data handling
aims::Replacer< T > Class Template Reference

Replacement of (label) values in a volume. More...

#include <aims/utility/linearcomb.h>

Public Types

typedef std::map< T, T, carto::KeyComparatorLess< T > > MapType
 

Public Member Functions

 Replacer ()
 
 ~Replacer ()
 

Static Public Member Functions

static void replace (const carto::Volume< T > &ivol, carto::Volume< T > &ovol, const aims::Replacer< T >::MapType &repl)
 Replace values from "repl" keys, from the input volume ivol, to the correspodinf repl values in the output volume ovol.
 

Detailed Description

template<class T>
class aims::Replacer< T >

Replacement of (label) values in a volume.

Values are replaced at once, thus it does not suffer from overlapping values if ivol is ovol (which would happen for instance in a loop replacing one value after another).

Definition at line 100 of file linearcomb.h.

Member Typedef Documentation

◆ MapType

template<class T>
typedef std::map<T, T, carto::KeyComparatorLess<T> > aims::Replacer< T >::MapType

Definition at line 108 of file linearcomb.h.

Constructor & Destructor Documentation

◆ Replacer()

template<class T>
aims::Replacer< T >::Replacer ( )
inline

Definition at line 110 of file linearcomb.h.

◆ ~Replacer()

template<class T>
aims::Replacer< T >::~Replacer ( )
inline

Definition at line 111 of file linearcomb.h.

Member Function Documentation

◆ replace()

template<typename T>
void aims::Replacer< T >::replace ( const carto::Volume< T > & ivol,
carto::Volume< T > & ovol,
const aims::Replacer< T >::MapType & repl )
inlinestatic

Replace values from "repl" keys, from the input volume ivol, to the correspodinf repl values in the output volume ovol.

Only actually replaced values will be written in ovol, other will be left untouched.

It is OK to specify the same volume as ivol and ovol, then it will be replaced in-place.

Definition at line 166 of file linearcomb.h.

References carto::Volume< typename T >::at(), carto::NDIterator_base::ended(), carto::VolumeProxy< typename T >::getSize(), carto::Volume< typename T >::getStrides(), carto::const_line_NDIterator< typename T >::inc_line_ptr(), carto::line_NDIterator_base::line_direction(), carto::const_line_NDIterator< typename T >::line_length(), and carto::NDIterator_base::position().


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