Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::DataMapper Class Reference

Map values into data or value ranges. Data range refers to the range of the data type, i.e. [0 4095] for 12-bit unsigned integer data. Value range refers to the physical meaning of the value, i.e. Hounsfield value range is from [-1000 3000]. It is important that the data range is specified for data types with a large range (for example 32/64-bit float and integer) since the data is often normalized to [0 1], when for example performing color mapping, i.e. applying a transfer function. More...

#include <datamapper.h>

Public Member Functions

 DataMapper (const DataFormatBase *format, Axis valueAxis={})
 
 DataMapper (dvec2 dataRange, Axis valueAxis={})
 
 DataMapper (dvec2 dataRange, dvec2 valueRange, Axis valueAxis={})
 
 DataMapper (const DataMapper &rhs)
 
DataMapperoperator= (const DataMapper &that)
 
void initWithFormat (const DataFormatBase *format)
 
template<typename T >
util::same_extent_t< T, double > mapFromDataToValue (T val) const
 
template<typename T >
util::same_extent_t< T, double > mapFromValueToData (T val) const
 
template<typename T >
util::same_extent_t< T, double > mapFromDataToNormalized (T val) const
 
template<typename T >
util::same_extent_t< T, double > mapFromNormalizedToData (T val) const
 
template<typename T >
util::same_extent_t< T, double > mapFromValueToNormalized (T val) const
 
template<typename T >
util::same_extent_t< T, double > mapFromNormalizedToValue (T val) const
 

Static Public Member Functions

static dvec2 defaultDataRangeFor (const DataFormatBase *format)
 

Public Attributes

dvec2 dataRange
 
dvec2 valueRange
 
Axis valueAxis
 Name and Unit, i.e. "absorption", "Hounsfield".
 

Detailed Description

Map values into data or value ranges. Data range refers to the range of the data type, i.e. [0 4095] for 12-bit unsigned integer data. Value range refers to the physical meaning of the value, i.e. Hounsfield value range is from [-1000 3000]. It is important that the data range is specified for data types with a large range (for example 32/64-bit float and integer) since the data is often normalized to [0 1], when for example performing color mapping, i.e. applying a transfer function.

Member Function Documentation

◆ mapFromDataToNormalized()

template<typename T >
util::same_extent_t< T, double > inviwo::DataMapper::mapFromDataToNormalized ( T val) const
inline

Map from dataRange to the Normalized range [0,1]

◆ mapFromDataToValue()

template<typename T >
util::same_extent_t< T, double > inviwo::DataMapper::mapFromDataToValue ( T val) const
inline

Map from dataRange to the valueRange

◆ mapFromNormalizedToData()

template<typename T >
util::same_extent_t< T, double > inviwo::DataMapper::mapFromNormalizedToData ( T val) const
inline

Map from Normalized range [0,1] to the dataRange

◆ mapFromNormalizedToValue()

template<typename T >
util::same_extent_t< T, double > inviwo::DataMapper::mapFromNormalizedToValue ( T val) const
inline

Map from Normalized range [0,1] to the valueRange

◆ mapFromValueToData()

template<typename T >
util::same_extent_t< T, double > inviwo::DataMapper::mapFromValueToData ( T val) const
inline

Map from valueRange to the dataRange

◆ mapFromValueToNormalized()

template<typename T >
util::same_extent_t< T, double > inviwo::DataMapper::mapFromValueToNormalized ( T val) const
inline

Map from valueRange to the Normalized range [0,1]

Member Data Documentation

◆ dataRange

dvec2 inviwo::DataMapper::dataRange

The ´dataRange´ is used to normalize the "raw" values to [0,1] Typically the minimum and maximum of the "raw" data is used. For 8 and 16 integer data that is often the same or close to the same as the minimum and maximum of the data type. For data where the minimum and maximum is far from the minimum and maximum of the data type, the minimum and maximum has to either be calculated from the data, read from the input, or entered by the user.

◆ valueAxis

Axis inviwo::DataMapper::valueAxis

Name and Unit, i.e. "absorption", "Hounsfield".

The valueAxis holds the name and unit of the quantity. Following the example above the name would be "water temperature" and unit "°C".

◆ valueRange

dvec2 inviwo::DataMapper::valueRange

The valueRange corresponds to the "true" values in the "raw" data. The "raw" data will first be normalized to [0,1] using the dataRange and mapped to the "true" range using the valueRange. An example might be helpful: if water temperature values in the range of [0.0, 30.0] °C are stored as 8 bit unsigned int, using the full data range from [0,255]. Then the dataRange would be [0, 255] and the valueRange [0.0, 30.0]. Using the same values for dataRange and valueRange means that the original "raw" values will be used.


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