brainrat-private  5.1.2
bio::Rescaler Class Reference

A Rescaler allows one to apply a linear transformation to a value of any type. More...

#include <brainrat/utility/channelextractor.h>

Inheritance diagram for bio::Rescaler:

Classes

class  bad_options_exception
 

Public Member Functions

 Rescaler ()
 
virtual ~Rescaler ()
 
template<typename T , typename C >
rescale (T val)
 
void setRescale (bool val=true)
 
void setInputMin (double val)
 
void setInputMax (double val)
 
void setOutputMin (double val)
 
void setOutputMax (double val)
 
void resetInputMin ()
 
void resetInputMax ()
 
void resetOutputMin ()
 
void resetOutputMax ()
 
void setInputDynMinMax (bool val=true)
 
template<typename T >
void setInputDynMinMax (carto::VolumeRef< T > in)
 
void reset ()
 

Protected Member Functions

template<typename T >
void computeInputDynMin (carto::VolumeRef< T > in, int ch=0)
 
template<typename T >
void computeInputDynMax (carto::VolumeRef< T > in, int ch=0)
 
template<typename T >
void computeInputTypeMin ()
 
template<typename T >
void computeInputTypeMax ()
 
template<typename C >
void computeOutputMin ()
 
template<typename C >
void computeOutputMax ()
 
void AB ()
 
template<typename T , typename C >
void computeRuntimeMinMax (carto::VolumeRef< T > in, int ch=0)
 
template<>
void computeInputDynMin (carto::VolumeRef< AimsRGB > in, int ch)
 
template<>
void computeInputDynMax (carto::VolumeRef< AimsRGB > in, int ch)
 
template<>
void computeInputTypeMin ()
 
template<>
void computeInputTypeMax ()
 
template<>
void computeInputDynMin (carto::VolumeRef< AimsRGBA > in, int ch)
 
template<>
void computeInputDynMax (carto::VolumeRef< AimsRGBA > in, int ch)
 
template<>
void computeInputTypeMin ()
 
template<>
void computeInputTypeMax ()
 
template<>
void computeInputDynMin (carto::VolumeRef< AimsHSV > in, int ch)
 
template<>
void computeInputDynMax (carto::VolumeRef< AimsHSV > in, int ch)
 
template<>
void computeInputTypeMin ()
 
template<>
void computeInputTypeMax ()
 

Protected Attributes

bool _rescale
 
double _imin
 
double _imax
 
double _omin
 
double _omax
 
bool _iminset
 
bool _imaxset
 
bool _ominset
 
bool _omaxset
 
bool _dynlimits
 
double _a
 
double _b
 
bool _abset
 

Detailed Description

A Rescaler allows one to apply a linear transformation to a value of any type.

The linear coefficients may be computed using the extrem values of of volume (dynamic scaling), or the extrem values of input and output types.

Definition at line 42 of file channelextractor.h.

Constructor & Destructor Documentation

◆ Rescaler()

bio::Rescaler::Rescaler ( )
inline

Definition at line 48 of file channelextractor.h.

◆ ~Rescaler()

virtual bio::Rescaler::~Rescaler ( )
inlinevirtual

Definition at line 63 of file channelextractor.h.

Member Function Documentation

◆ AB()

void bio::Rescaler::AB ( )
inlineprotected

◆ computeInputDynMax() [1/4]

template<>
void bio::Rescaler::computeInputDynMax ( carto::VolumeRef< AimsHSV >  in,
int  ch 
)
protected

Definition at line 306 of file channelextractor.h.

References _imax, and min().

◆ computeInputDynMax() [2/4]

template<>
void bio::Rescaler::computeInputDynMax ( carto::VolumeRef< AimsRGB >  in,
int  ch 
)
protected

Definition at line 232 of file channelextractor.h.

References _imax, and min().

◆ computeInputDynMax() [3/4]

template<>
void bio::Rescaler::computeInputDynMax ( carto::VolumeRef< AimsRGBA >  in,
int  ch 
)
protected

Definition at line 269 of file channelextractor.h.

References _imax, and min().

◆ computeInputDynMax() [4/4]

template<typename T >
void bio::Rescaler::computeInputDynMax ( carto::VolumeRef< T >  in,
int  ch = 0 
)
inlineprotected

Definition at line 139 of file channelextractor.h.

References _imax.

Referenced by computeRuntimeMinMax(), and setInputDynMinMax().

◆ computeInputDynMin() [1/4]

template<>
void bio::Rescaler::computeInputDynMin ( carto::VolumeRef< AimsHSV >  in,
int  ch 
)
protected

Definition at line 294 of file channelextractor.h.

References _imin, and max().

◆ computeInputDynMin() [2/4]

template<>
void bio::Rescaler::computeInputDynMin ( carto::VolumeRef< AimsRGB >  in,
int  ch 
)
protected

Definition at line 220 of file channelextractor.h.

References _imin, and max().

◆ computeInputDynMin() [3/4]

template<>
void bio::Rescaler::computeInputDynMin ( carto::VolumeRef< AimsRGBA >  in,
int  ch 
)
protected

Definition at line 257 of file channelextractor.h.

References _imin, and max().

◆ computeInputDynMin() [4/4]

template<typename T >
void bio::Rescaler::computeInputDynMin ( carto::VolumeRef< T >  in,
int  ch = 0 
)
inlineprotected

Definition at line 134 of file channelextractor.h.

References _imin.

Referenced by setInputDynMinMax().

◆ computeInputTypeMax() [1/4]

template<typename T >
void bio::Rescaler::computeInputTypeMax ( )
inlineprotected

Definition at line 149 of file channelextractor.h.

References _imax.

◆ computeInputTypeMax() [2/4]

template<>
void bio::Rescaler::computeInputTypeMax ( )
protected

Definition at line 250 of file channelextractor.h.

References _imax, and max().

◆ computeInputTypeMax() [3/4]

template<>
void bio::Rescaler::computeInputTypeMax ( )
protected

Definition at line 287 of file channelextractor.h.

References _imax, and max().

◆ computeInputTypeMax() [4/4]

template<>
void bio::Rescaler::computeInputTypeMax ( )
protected

Definition at line 324 of file channelextractor.h.

References _imax, and max().

◆ computeInputTypeMin() [1/4]

template<typename T >
void bio::Rescaler::computeInputTypeMin ( )
inlineprotected

Definition at line 144 of file channelextractor.h.

References _imin.

◆ computeInputTypeMin() [2/4]

template<>
void bio::Rescaler::computeInputTypeMin ( )
protected

Definition at line 244 of file channelextractor.h.

References _imin, and min().

◆ computeInputTypeMin() [3/4]

template<>
void bio::Rescaler::computeInputTypeMin ( )
protected

Definition at line 281 of file channelextractor.h.

References _imin, and min().

◆ computeInputTypeMin() [4/4]

template<>
void bio::Rescaler::computeInputTypeMin ( )
protected

Definition at line 318 of file channelextractor.h.

References _imin, and min().

◆ computeOutputMax()

template<typename C >
void bio::Rescaler::computeOutputMax ( )
inlineprotected

Definition at line 159 of file channelextractor.h.

References _omax.

◆ computeOutputMin()

template<typename C >
void bio::Rescaler::computeOutputMin ( )
inlineprotected

Definition at line 154 of file channelextractor.h.

References _omin.

◆ computeRuntimeMinMax()

template<typename T , typename C >
void bio::Rescaler::computeRuntimeMinMax ( carto::VolumeRef< T >  in,
int  ch = 0 
)
inlineprotected

◆ rescale()

template<typename T , typename C >
C bio::Rescaler::rescale ( val)
inline

Definition at line 85 of file channelextractor.h.

References _a, _abset, _b, and _rescale.

◆ reset()

void bio::Rescaler::reset ( )
inline

Definition at line 118 of file channelextractor.h.

References _abset, _dynlimits, _imaxset, _iminset, _omaxset, _ominset, and _rescale.

◆ resetInputMax()

void bio::Rescaler::resetInputMax ( )
inline

Definition at line 105 of file channelextractor.h.

References _imaxset.

◆ resetInputMin()

void bio::Rescaler::resetInputMin ( )
inline

Definition at line 104 of file channelextractor.h.

References _iminset.

◆ resetOutputMax()

void bio::Rescaler::resetOutputMax ( )
inline

Definition at line 107 of file channelextractor.h.

References _omaxset.

◆ resetOutputMin()

void bio::Rescaler::resetOutputMin ( )
inline

Definition at line 106 of file channelextractor.h.

References _ominset.

◆ setInputDynMinMax() [1/2]

void bio::Rescaler::setInputDynMinMax ( bool  val = true)
inline

Definition at line 108 of file channelextractor.h.

References _dynlimits.

◆ setInputDynMinMax() [2/2]

template<typename T >
void bio::Rescaler::setInputDynMinMax ( carto::VolumeRef< T >  in)
inline

Definition at line 110 of file channelextractor.h.

References _imaxset, _iminset, AB(), computeInputDynMax(), and computeInputDynMin().

◆ setInputMax()

void bio::Rescaler::setInputMax ( double  val)
inline

Definition at line 101 of file channelextractor.h.

References _imax, _imaxset, and AB().

◆ setInputMin()

void bio::Rescaler::setInputMin ( double  val)
inline

Definition at line 100 of file channelextractor.h.

References _imin, _iminset, and AB().

◆ setOutputMax()

void bio::Rescaler::setOutputMax ( double  val)
inline

Definition at line 103 of file channelextractor.h.

References _omax, _omaxset, and AB().

◆ setOutputMin()

void bio::Rescaler::setOutputMin ( double  val)
inline

Definition at line 102 of file channelextractor.h.

References _omin, _ominset, and AB().

◆ setRescale()

void bio::Rescaler::setRescale ( bool  val = true)
inline

Definition at line 99 of file channelextractor.h.

References _rescale.

Member Data Documentation

◆ _a

double bio::Rescaler::_a
protected

Definition at line 213 of file channelextractor.h.

Referenced by AB(), and rescale().

◆ _abset

bool bio::Rescaler::_abset
protected

Definition at line 215 of file channelextractor.h.

Referenced by AB(), rescale(), and reset().

◆ _b

double bio::Rescaler::_b
protected

Definition at line 214 of file channelextractor.h.

Referenced by AB(), and rescale().

◆ _dynlimits

bool bio::Rescaler::_dynlimits
protected

Definition at line 212 of file channelextractor.h.

Referenced by computeRuntimeMinMax(), reset(), and setInputDynMinMax().

◆ _imax

double bio::Rescaler::_imax
protected

Definition at line 205 of file channelextractor.h.

Referenced by AB(), computeInputDynMax(), computeInputTypeMax(), and setInputMax().

◆ _imaxset

bool bio::Rescaler::_imaxset
protected

◆ _imin

double bio::Rescaler::_imin
protected

Definition at line 204 of file channelextractor.h.

Referenced by AB(), computeInputDynMin(), computeInputTypeMin(), and setInputMin().

◆ _iminset

bool bio::Rescaler::_iminset
protected

◆ _omax

double bio::Rescaler::_omax
protected

Definition at line 207 of file channelextractor.h.

Referenced by AB(), computeOutputMax(), and setOutputMax().

◆ _omaxset

bool bio::Rescaler::_omaxset
protected

Definition at line 211 of file channelextractor.h.

Referenced by computeRuntimeMinMax(), reset(), resetOutputMax(), and setOutputMax().

◆ _omin

double bio::Rescaler::_omin
protected

Definition at line 206 of file channelextractor.h.

Referenced by AB(), computeOutputMin(), and setOutputMin().

◆ _ominset

bool bio::Rescaler::_ominset
protected

Definition at line 210 of file channelextractor.h.

Referenced by computeRuntimeMinMax(), reset(), resetOutputMin(), and setOutputMin().

◆ _rescale

bool bio::Rescaler::_rescale
protected

Definition at line 203 of file channelextractor.h.

Referenced by computeRuntimeMinMax(), rescale(), reset(), and setRescale().


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