Public Member Functions | Public Attributes | List of all members
Encoding Class Reference
Inheritance diagram for Encoding:
Inheritance graph
[legend]
Collaboration diagram for Encoding:
Collaboration graph
[legend]

Public Member Functions

 Encoding (const std::type_info &t=typeid(unsigned char))
 
 Encoding (const Encoding &encoding)
 
const EncodinggetEncoding () const
 Return type and scaling.
 
EncodinggetEncoding ()
 Return type and scaling.
 
void setEncoding (const Encoding &e)
 Set type and scaling.
 
Encodingoperator= (const Encoding &e)
 
const std::type_info & getType () const
 Linear scaling. More...
 
bool typeIsSet () const
 Get the storage type.
 
void setType (const std::type_info &t)
 Set storage type.
 
template<class T >
void setType ()
 Convenience.
 
template<class T >
drain::typeLimiter< T >::value_t getLimiter () const
 
size_t getElementSize () const
 Returns the size in bytes of the storage type (1 for unsigned char, 2 for 16-bit types, etc.)
 
void setPhysicalRange (const Range< double > &range, bool rescale=false)
 Sets channel specific scaling instead of shared (image-level) scaling. More...
 
void setPhysicalRange (double min, double max, bool rescale=false)
 Sets the supported range for physical values. Does not change scaling or type.
 
void setOptimalScale ()
 
void setOptimalPhysicalScale (double min, double max)
 
template<class T >
getTypeMin () const
 Returns the minimum value supported by the current storage type. More...
 
template<class T >
getTypeMax () const
 Returns the maximum value supported by the current storage type. More...
 
double requestPhysicalMax (double defaultMax=static_cast< double >(std::numeric_limits< short int >::max())) const
 Returns the actual or guessed maximum physical value,. More...
 
double requestPhysicalMin (double defaultMin=static_cast< double >(std::numeric_limits< short int >::min())) const
 Returns the actual or guessed minimum physical value,. More...
 
- Public Member Functions inherited from ValueScaling
 ValueScaling (double scale=1.0, double offset=0.0)
 
 ValueScaling (double scale, double offset, const drain::Range< double > &range)
 
 ValueScaling (const drain::ValueScaling &scaling)
 
 ValueScaling (const drain::UniTuple< double, 2 > &scaling)
 
 ValueScaling (const drain::ValueScaling &scalingIn, const drain::ValueScaling &scalingOut)
 
ValueScalingoperator= (const drain::ValueScaling &scaling)
 
virtual void setScaling (double scale, double offset)
 Set linear scaling.
 
virtual void setScaling (const ValueScaling &scaling)
 
virtual const ValueScalinggetScaling () const
 Get linear scaling.
 
virtual ValueScalinggetScaling ()
 Get linear scaling.
 
void setAbsoluteScale ()
 If the intensities of the image correspond to an absolute value (like count) then the scale should be reset to unity with this function.
 
void setNormalScale (const std::type_info &t)
 For "small integer" types, resets offset and scale such that maximum code value corresponds to 1.0 (100% intensity). More...
 
void setConversionScale (double scale, double offset=0.0, double scaleOut=1.0, double offsetOut=0.0)
 If the intensities of the image correspond to a physical value (like temperature), then the scaling coefficient should be set with this function.
 
void setConversionScale (const drain::ValueScaling &s1, const drain::ValueScaling &s2)
 Set scaling for which scaling.inv(x) = s2.inv(s1.fwd(x))
 
void setConversionScale (const Range< double > &r1, const Range< double > &r2)
 
void setOptimalScale (const std::type_info &t)
 If storage type is integer, adjust scale such that resolution is maximized.
 
void setPhysicalScale (const std::type_info &t, double min, double max)
 Sets physical range (min, max) and scales storage type accordingly.
 
void setPhysicalScale (const std::type_info &t, const drain::ValueScaling &scaling)
 Sets physical range (min, max) and scales storage type accordingly.
 
const Range< double > & getPhysicalRange () const
 Returns a typical or supported range for physical values.
 
Range< double > & getPhysicalRange ()
 Returns a typical or supported range for physical values. Modifying the range will not change scaling.
 
void setPhysicalMax (double max)
 In integer-valued images, set the physical values corresponding to [0, maxCodeValue].
 
template<class T >
void setPhysicalRange (const Range< T > &range)
 Sets the supported range for physical values. Does not change scaling or type.
 
void setPhysicalRange (double min, double max)
 Sets the supported range for physical values. Does not change scaling or type.
 
double getScale () const
 Returns the intensity scaling factor. See set setScale()
 
double getOffset () const
 Returns the intensity scaling offset, ie. b in a*x + b . See set setScale()
 
bool isScaled () const
 Returns true, if scaling has effect ie. scale!=1.0 or offset!=0.0. More...
 
double getMinPhys () const
 Returns the minimum physical value.
 
double getMaxPhys () const
 Returns the maximum physical value.
 
bool isPhysical () const
 Returns true, physical intensity range has been set.
 
void adoptScaling (const drain::ValueScaling &srcScaling, const std::type_info &srcType, const std::type_info &dstType=typeid(void))
 Sets scale and offset according to physical range and current type.
 
double fwd (double x) const
 Forward scaling: given encoded value x, returns corresponding value (possibly physically meaningful).
 
double inv (double y) const
 Inverse scaling: given physically meaningful value y, returns the corresponding code value.
 
void toStream (std::ostream &ostr) const
 
std::string str () const
 
- Public Member Functions inherited from UniTuple< double, 2 >
 UniTuple (const TT &... args)
 
 UniTuple (const UniTuple< double, N > &t)
 Copy constructor.
 
 UniTuple (std::initializer_list< S > l)
 
tuple_toperator= (const tuple_t &t)
 
tuple_toperator= (const value_type &value)
 
tuple_toperator= (std::initializer_list< S > l)
 
virtual const_iterator begin () const override final
 
virtual iterator begin () override final
 
virtual const_iterator end () const override final
 
virtual iterator end () override final
 
tuple_ttuple ()
 
const tuple_ttuple () const
 
void debug (std::ostream &ostr) const
 
- Public Member Functions inherited from TupleBase< S, N >
const S & at (size_t i) const
 Return const reference to element i. More...
 
const S & operator[] (size_t i) const
 
S & at (size_t i)
 Return reference to element i. More...
 
S & operator[] (size_t i)
 
bool operator== (const tuplebase_t &t) const
 Equality operator.
 
bool operator!= (const tuplebase_t &t) const
 Inequality operator.
 
template<class T >
T & toSequence (T &sequence) const
 Copy elements to a Sequence, like stl::list, stl::set or stl::vector.
 
void set (const tuplebase_t &t)
 
template<class T2 , size_t N2 = 2>
void set (const TupleBase< T2, N2 > &t)
 Assign tuple of different type and/or size.
 
void set (const S &arg)
 
template<typename ... SS>
void set (const S &arg, const SS &... rest)
 Set element(s).
 
template<typename T >
void set (std::initializer_list< T > l)
 
template<class T >
tuplebase_tassignSequence (T &sequence, bool LENIENT=false)
 Proposed for tuples only; derived classes should not shadow this. More...
 
void fill (S i)
 Set all the elements to i.
 
void clear ()
 
virtual std::ostream & toStream (std::ostream &ostr, char separator=',') const
 
std::string toStr (char separator=',') const
 
virtual void updateTuple ()
 

Public Attributes

Caster caster
 In base class(es), mainly for storing storage type. In derived classes, also for value conversions.
 
size_t byteSize
 
std::string type
 Information of the current type.
 
- Public Attributes inherited from ValueScaling
double & scale
 Multiplicative coefficient \i a in: y = ax + b.
 
double & offset
 Additive coefficient \i b in: y = ax + b.
 
drain::Range< double > physRange
 Minimum and maximum physical value of the imaged quantity (not limited to corresponding to minCodeValue?).
 

Additional Inherited Members

- Public Types inherited from UniTuple< double, 2 >
typedef double value_type
 
typedef UniTuple< double, N > tuple_t
 
typedef double * iterator
 
typedef const double * const_iterator
 
- Public Types inherited from TupleBase< S, N >
typedef TupleBase< S, N > tuplebase_t
 
typedef S value_type
 
typedef S * iterator
 
typedef S const * const_iterator
 
- Static Public Member Functions inherited from TupleBase< S, N >
static size_t size ()
 Return the number of elements. More...
 
- Static Public Attributes inherited from UniTuple< double, 2 >
static const size_t tuple_size
 
- Static Public Attributes inherited from TupleBase< S, N >
static const size_t storageTypeSize = sizeof(S)
 
- Protected Member Functions inherited from UniTuple< double, 2 >
 UniTuple (UniTuple< double, N2 > &tuple, size_t i)
 
double & next ()
 
- Protected Member Functions inherited from TupleBase< S, N >
void setIndexed (size_t i)
 Argument stack endpoint function; final step of variadic argument set(arg, ...) .
 
template<typename T2 , typename ... TT>
void setIndexed (size_t i, T2 arg, const TT &... rest)
 Worker called by set(T2 arg, T2 arg2, ...)
 
- Protected Attributes inherited from UniTuple< double, 2 >
const iterator start
 

Member Function Documentation

◆ getType()

const std::type_info& getType ( ) const
inline

Linear scaling.

Get the storage type

◆ getTypeMax()

T getTypeMax ( ) const
inline

Returns the maximum value supported by the current storage type.

See also
setType() Does not check the actual image data.
getMin()
getLimiter()
setType()

◆ getTypeMin()

T getTypeMin ( ) const
inline

Returns the minimum value supported by the current storage type.

Does not check the actual image data.

See also
getMax()
getLimiter()
setType()

◆ requestPhysicalMax()

double requestPhysicalMax ( double  defaultMax = static_cast<double>(std::numeric_limits<short int>::max())) const
inline

Returns the actual or guessed maximum physical value,.

Is physical range is unset, and the storage type is a "small" integer, the value is guessed.

◆ requestPhysicalMin()

double requestPhysicalMin ( double  defaultMin = static_cast<double>(std::numeric_limits<short int>::min())) const
inline

Returns the actual or guessed minimum physical value,.

Is physical range is unset, and the storage type is a "small" integer, the value is guessed.

◆ setPhysicalRange()

void setPhysicalRange ( const Range< double > &  range,
bool  rescale = false 
)
inline

Sets channel specific scaling instead of shared (image-level) scaling.

Facilitates modifications provided directly bydrain::ValueScaling object. Requesting modifiable scaling implies providing a "safe", separate scaling. In the case of channels, this means changing from shared image-level scaling to channel specific scaling. Set linear scaling


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