Volume Data Histogram. More...
#include <LDM/SoVolumeHistogram.h>
Public Member Functions | |
SoVolumeHistogram (const SbDataType &dataType) | |
Constructor. | |
~SoVolumeHistogram () | |
Destructor. | |
void | setInputValueRange (double rangeMin, double rangeMax) |
For floating data type, specifies the range the histogram has to be computed in. | |
void | setUndefinedValue (const double undefinedValue) |
Setup the undefined value to ignore when computing the histogram. | |
double | getUndefinedValue () const |
return the current undefined value. | |
size_t | getHistoSize () const |
Returns the size of the histogram. | |
int64_t * | getHistogram () |
Returns a 64 bit integer pointer to the histogram data, the size of the histogram array is getHistoSize() | |
int64_t | getNumValues (size_t entry) |
Returns the histogram value corresponding to the entry. | |
int64_t | getValue (size_t entry) |
Returns the value corresponding to the entry for integer data types. | |
double | getValueD (size_t entry) |
Returns the value corresponding to the entry for floating data types. | |
int64_t | getMinValue () const |
Returns the min value of the dataset for integer data types. | |
int64_t | getMaxValue () const |
Returns the max value of the dataset for integer data types. | |
double | getMinValueD () const |
Returns the min value of the dataset for floating data types. | |
double | getMaxValueD () const |
Returns the max value of the dataset for floating data types. | |
double | getMax () const |
Returns the max value of the dataset according to the specified data type. | |
double | getMin () const |
Returns the max value of the dataset according to the specified data type. | |
int | getNumSignificantBits () const |
Returns the number of significant bits for the dataset, only relevant for integer data types. | |
void | addValues (SoBufferObject *values, const int numValues) |
Add to the histogram a 1D array of values. | |
void | addValues (SoBufferObject *values, const SbVec3i32 &arrayDim) |
Add to the histogram a 3D array of values. | |
void | addValues (SoBufferObject *values, const SbVec3i32 &arrayDim, const SbBox3i32 &range) |
Add to the histogram the values in the specified range inside the given array. | |
void | set (const std::vector< int64_t > &histo) |
Set the histogram. | |
void | set (const std::vector< int64_t > &histo, const std::vector< double > &values) |
Set the histogram. | |
template<typename T > | |
size_t | getEntry (T value) const |
Returns the histogram entry corresponding to the value. | |
Static Public Member Functions | |
static void | computeMinMax (SoBufferObject *valuesBuffer, const SbDataType &dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max) |
Compute min max. | |
static void | computeMinMaxWithUndefined (SoBufferObject *valuesBuffer, const double undefinedValue, const SbDataType &dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max) |
Compute min max. | |
static void | computeMinMax (void *valuesBuffer, const SbDataType &dataType, const SbVec3i32 &arrayDim, SbVec2d &minMax) |
Compute min max. | |
static void | computeMinMaxWithUndefined (void *valuesBuffer, const double undefinedValue, const SbDataType &dataType, const SbVec3i32 &arrayDim, SbVec2d &minMax) |
Compute min max. | |
Volume Data Histogram.
This class allows building a histogram from a dataset or a portion of a dataset.
To implement the histogram computation, follow the steps below:
SoVolumeHistogram has different behavior depending on the datatype:
Definition at line 76 of file SoVolumeHistogram.h.
SoVolumeHistogram::SoVolumeHistogram | ( | const SbDataType & | dataType | ) |
Constructor.
SoVolumeHistogram::~SoVolumeHistogram | ( | ) |
Destructor.
|
inline |
Add to the histogram a 1D array of values.
NOTES: this API is limited to INT_MAX numValues to handle.
Definition at line 328 of file SoVolumeHistogram.h.
|
inline |
Add to the histogram a 3D array of values.
Definition at line 334 of file SoVolumeHistogram.h.
void SoVolumeHistogram::addValues | ( | SoBufferObject * | values, |
const SbVec3i32 & | arrayDim, | ||
const SbBox3i32 & | range | ||
) |
Add to the histogram the values in the specified range inside the given array.
|
static |
Compute min max.
valuesBuffer | Input buffer of values. |
dataType | Type of datas stored in valuesBuffer. |
arrayDim | Dimensions of valuesBuffer. |
range | Box in which min and max values are computed. |
min | Computed minimum value. |
max | Computed maximum value. |
|
static |
Compute min max.
valuesBuffer | Input buffer of values. |
dataType | Type of datas stored in valuesBuffer. |
arrayDim | Dimensions of valuesBuffer. |
minMax | Vector of computed minimum and maximum values. |
|
static |
Compute min max.
valuesBuffer | Input buffer of values. |
undefinedValue | Discarded value in the computation of min and max. |
dataType | Type of datas stored in valuesBuffer. |
arrayDim | Dimensions of valuesBuffer. |
range | Box in which min and max values are computed. |
min | Computed minimum value. |
max | Computed maximum value. |
|
static |
Compute min max.
valuesBuffer | Input buffer of values. |
undefinedValue | Discarded value in the computation of min and max. |
dataType | Type of datas stored in valuesBuffer. |
arrayDim | Dimensions of valuesBuffer. |
minMax | Vector of computed minimum and maximum values. |
|
inline |
Returns the histogram entry corresponding to the value.
Definition at line 368 of file SoVolumeHistogram.h.
int64_t * SoVolumeHistogram::getHistogram | ( | ) |
Returns a 64 bit integer pointer to the histogram data, the size of the histogram array is getHistoSize()
size_t SoVolumeHistogram::getHistoSize | ( | ) | const |
Returns the size of the histogram.
double SoVolumeHistogram::getMax | ( | ) | const |
Returns the max value of the dataset according to the specified data type.
int64_t SoVolumeHistogram::getMaxValue | ( | ) | const |
Returns the max value of the dataset for integer data types.
double SoVolumeHistogram::getMaxValueD | ( | ) | const |
Returns the max value of the dataset for floating data types.
double SoVolumeHistogram::getMin | ( | ) | const |
Returns the max value of the dataset according to the specified data type.
int64_t SoVolumeHistogram::getMinValue | ( | ) | const |
Returns the min value of the dataset for integer data types.
double SoVolumeHistogram::getMinValueD | ( | ) | const |
Returns the min value of the dataset for floating data types.
int SoVolumeHistogram::getNumSignificantBits | ( | ) | const |
Returns the number of significant bits for the dataset, only relevant for integer data types.
int64_t SoVolumeHistogram::getNumValues | ( | size_t | entry | ) |
Returns the histogram value corresponding to the entry.
Equivalent to getHistogram()[entry]
|
inline |
return the current undefined value.
Definition at line 107 of file SoVolumeHistogram.h.
int64_t SoVolumeHistogram::getValue | ( | size_t | entry | ) |
Returns the value corresponding to the entry for integer data types.
double SoVolumeHistogram::getValueD | ( | size_t | entry | ) |
Returns the value corresponding to the entry for floating data types.
void SoVolumeHistogram::set | ( | const std::vector< int64_t > & | histo | ) |
Set the histogram.
Useful to get back scalar parameters such as min/max values and number of significant bits
void SoVolumeHistogram::set | ( | const std::vector< int64_t > & | histo, |
const std::vector< double > & | values | ||
) |
Set the histogram.
Useful to get back scalar parameters such as min/max values and number of significant bits
void SoVolumeHistogram::setInputValueRange | ( | double | rangeMin, |
double | rangeMax | ||
) |
For floating data type, specifies the range the histogram has to be computed in.
Must be called before any call to addValues(). Default values are -20000. 20000.
|
inline |
Setup the undefined value to ignore when computing the histogram.
Definition at line 100 of file SoVolumeHistogram.h.