Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoVolumeHistogram Class Reference

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.
 

Detailed Description

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:

  • For integer data types:
    • If sizeof(dataType) == 1, histogram will have 256 bins with a bin width of 1.
    • Else, histogram will have 65536 bins with a bin width of (Datatype_max - DataType_min) / 65536.
  • For floating types:
    The Histogram will have 65536 bins with a bin width of (rangeMax - rangeMin) / 65536, where rangeMin and rangeMax are specified with setInputValueRange.

SEE ALSO

SoDataSet

Definition at line 76 of file SoVolumeHistogram.h.

Constructor & Destructor Documentation

◆ SoVolumeHistogram()

SoVolumeHistogram::SoVolumeHistogram ( const SbDataType dataType)

Constructor.

◆ ~SoVolumeHistogram()

SoVolumeHistogram::~SoVolumeHistogram ( )

Destructor.

Member Function Documentation

◆ addValues() [1/3]

void SoVolumeHistogram::addValues ( SoBufferObject values,
const int  numValues 
)
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.

◆ addValues() [2/3]

void SoVolumeHistogram::addValues ( SoBufferObject values,
const SbVec3i32 arrayDim 
)
inline

Add to the histogram a 3D array of values.

Definition at line 334 of file SoVolumeHistogram.h.

◆ addValues() [3/3]

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.

◆ computeMinMax() [1/2]

static void SoVolumeHistogram::computeMinMax ( SoBufferObject valuesBuffer,
const SbDataType dataType,
const SbVec3i32 arrayDim,
const SbBox3i32 range,
double &  min,
double &  max 
)
static

Compute min max.

Parameters
valuesBufferInput buffer of values.
dataTypeType of datas stored in valuesBuffer.
arrayDimDimensions of valuesBuffer.
rangeBox in which min and max values are computed.
minComputed minimum value.
maxComputed maximum value.

◆ computeMinMax() [2/2]

static void SoVolumeHistogram::computeMinMax ( void *  valuesBuffer,
const SbDataType dataType,
const SbVec3i32 arrayDim,
SbVec2d minMax 
)
static

Compute min max.

Parameters
valuesBufferInput buffer of values.
dataTypeType of datas stored in valuesBuffer.
arrayDimDimensions of valuesBuffer.
minMaxVector of computed minimum and maximum values.

◆ computeMinMaxWithUndefined() [1/2]

static void SoVolumeHistogram::computeMinMaxWithUndefined ( SoBufferObject valuesBuffer,
const double  undefinedValue,
const SbDataType dataType,
const SbVec3i32 arrayDim,
const SbBox3i32 range,
double &  min,
double &  max 
)
static

Compute min max.

Parameters
valuesBufferInput buffer of values.
undefinedValueDiscarded value in the computation of min and max.
dataTypeType of datas stored in valuesBuffer.
arrayDimDimensions of valuesBuffer.
rangeBox in which min and max values are computed.
minComputed minimum value.
maxComputed maximum value.

◆ computeMinMaxWithUndefined() [2/2]

static void SoVolumeHistogram::computeMinMaxWithUndefined ( void *  valuesBuffer,
const double  undefinedValue,
const SbDataType dataType,
const SbVec3i32 arrayDim,
SbVec2d minMax 
)
static

Compute min max.

Parameters
valuesBufferInput buffer of values.
undefinedValueDiscarded value in the computation of min and max.
dataTypeType of datas stored in valuesBuffer.
arrayDimDimensions of valuesBuffer.
minMaxVector of computed minimum and maximum values.

◆ getEntry()

template<typename T >
size_t SoVolumeHistogram::getEntry ( value) const
inline

Returns the histogram entry corresponding to the value.

Definition at line 368 of file SoVolumeHistogram.h.

◆ getHistogram()

int64_t * SoVolumeHistogram::getHistogram ( )

Returns a 64 bit integer pointer to the histogram data, the size of the histogram array is getHistoSize()

◆ getHistoSize()

size_t SoVolumeHistogram::getHistoSize ( ) const

Returns the size of the histogram.

◆ getMax()

double SoVolumeHistogram::getMax ( ) const

Returns the max value of the dataset according to the specified data type.

◆ getMaxValue()

int64_t SoVolumeHistogram::getMaxValue ( ) const

Returns the max value of the dataset for integer data types.

◆ getMaxValueD()

double SoVolumeHistogram::getMaxValueD ( ) const

Returns the max value of the dataset for floating data types.

◆ getMin()

double SoVolumeHistogram::getMin ( ) const

Returns the max value of the dataset according to the specified data type.

◆ getMinValue()

int64_t SoVolumeHistogram::getMinValue ( ) const

Returns the min value of the dataset for integer data types.

◆ getMinValueD()

double SoVolumeHistogram::getMinValueD ( ) const

Returns the min value of the dataset for floating data types.

◆ getNumSignificantBits()

int SoVolumeHistogram::getNumSignificantBits ( ) const

Returns the number of significant bits for the dataset, only relevant for integer data types.

◆ getNumValues()

int64_t SoVolumeHistogram::getNumValues ( size_t  entry)

Returns the histogram value corresponding to the entry.

Equivalent to getHistogram()[entry]

◆ getUndefinedValue()

double SoVolumeHistogram::getUndefinedValue ( ) const
inline

return the current undefined value.

Definition at line 107 of file SoVolumeHistogram.h.

◆ getValue()

int64_t SoVolumeHistogram::getValue ( size_t  entry)

Returns the value corresponding to the entry for integer data types.

◆ getValueD()

double SoVolumeHistogram::getValueD ( size_t  entry)

Returns the value corresponding to the entry for floating data types.

◆ set() [1/2]

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

◆ set() [2/2]

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

◆ setInputValueRange()

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.

◆ setUndefinedValue()

void SoVolumeHistogram::setUndefinedValue ( const double  undefinedValue)
inline

Setup the undefined value to ignore when computing the histogram.

Definition at line 100 of file SoVolumeHistogram.h.


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