|
open_iA 2024.9
|
Computes and stores histogram data, which can be used in plots. More...
#include <iAHistogramData.h>
Public Member Functions | |
| iAHistogramData (QString const &name, iAValueType type, DataType minX, DataType maxX, size_t numBin) | |
| Create an empty histogram (with numBin bins, initialized to 0). | |
| iAHistogramData (QString const &name, iAValueType type, DataType minX, DataType maxX, size_t numBin, DataType *histoData) | |
| Create with the given, already computed histogram data. | |
| ~iAHistogramData () | |
| void | clear () |
| Sets all histogram frequencies back to 0. | |
| void | setBin (size_t binIdx, DataType value) |
| Set the value for a given bin index. | |
| void | setSpacing (DataType spacing) |
| Sets custom spacing. | |
| void | setYBounds (DataType yMin, DataType yMax) |
| Sets custom y bounds. | |
| iAPlotData::DataType | spacing () const |
| Get the spacing (the witdh of a bin) | |
| DataType | yValue (size_t idx) const override |
| overriden from iAPlotData, check description there! | |
| DataType | xValue (size_t idx) const override |
| Value on the x axis for a datum with given index. | |
| DataType const * | xBounds () const override |
| The range of values for x; i.e. xBounds()[0] is the minimum of all xValue(...), xBounds()[1] is the maximum. | |
| DataType const * | yBounds () const override |
| The range of values for y; i.e. yBounds()[0] is the minimum of all yValue(...), yBounds()[1] is the maximum. | |
| size_t | valueCount () const override |
| The number of available data elements (i.e. in xValue/yValue, idx can go from 0 to valueCount()-1). | |
| size_t | nearestIdx (DataType dataX) const override |
| Retrieve the index closest to the given x data value. | |
| QString | toolTipText (DataType dataX) const override |
| The tooltip text for this data when the user is currently hovering over the given x position. | |
Public Member Functions inherited from iAPlotData | |
| iAPlotData (QString const &name, iAValueType type) | |
| Construct a plot data object. | |
| virtual | ~iAPlotData () |
| QString const & | name () const |
| The name of the data series that this object holds. | |
| virtual iAValueType | valueType () const |
| The type of the values held by this data object. | |
Static Public Member Functions | |
| static std::shared_ptr< iAHistogramData > | create (QString const &name, iAValueType type, const std::vector< DataType > &data, size_t numBin, DataType minValue=std::numeric_limits< DataType >::infinity(), DataType maxValue=std::numeric_limits< DataType >::infinity()) |
| create a histogram for the given (raw) data vector. | |
| static std::shared_ptr< iAHistogramData > | create (QString const &name, iAValueType type, DataType minX, DataType maxX, QVector< DataType > const &histoData) |
| Create from already computed histogram data in a QVector. | |
| static std::shared_ptr< iAHistogramData > | create (QString const &name, iAValueType type, DataType minX, DataType maxX, size_t numBin) |
| Create an empty histogram. | |
| static std::shared_ptr< iAHistogramData > | create (QString const &name, iAValueType type, DataType minX, DataType maxX, size_t numBin, DataType *histoData) |
| Create from already computed histogram data. | |
| static std::shared_ptr< iAHistogramData > | create (QString const &name, iAValueType type, DataType minX, DataType maxX, std::vector< DataType > const &histoData) |
| Create from already computed histogram data in a std::vector. | |
| static std::shared_ptr< iAHistogramData > | create (QString const &name, vtkImageData *img, size_t desiredNumBin, iAImageStatistics *imgStatistics=nullptr, int component=0) |
| create a histogram for a vtk image. | |
| static size_t | finalNumBin (size_t numValues, iAValueType type, double const valueRange[2], size_t desiredNumBin) |
| compute the final bin count for given data type, value count, and desired bin count | |
| static size_t | finalNumBin (vtkImageData *img, size_t desiredNumBin) |
| compute the final bin count for a given image and desired bin count | |
| static double | histoRange (double const range[2], size_t numBins, iAValueType valueType) |
| compute the actual histogram range for the given range and number of bins | |
Additional Inherited Members | |
Public Types inherited from iAPlotData | |
| using | DataType = double |
| Data type used for x and y values. | |
Computes and stores histogram data, which can be used in plots.
| iAHistogramData::iAHistogramData | ( | QString const & | name, |
| iAValueType | type, | ||
| DataType | minX, | ||
| DataType | maxX, | ||
| size_t | numBin ) |
Create an empty histogram (with numBin bins, initialized to 0).
| iAHistogramData::iAHistogramData | ( | QString const & | name, |
| iAValueType | type, | ||
| DataType | minX, | ||
| DataType | maxX, | ||
| size_t | numBin, | ||
| DataType * | histoData ) |
Create with the given, already computed histogram data.
| iAHistogramData::~iAHistogramData | ( | ) |
| void iAHistogramData::clear | ( | ) |
Sets all histogram frequencies back to 0.
|
static |
create a histogram for the given (raw) data vector.
| name | the name of the plot |
| type | the type of the data values (continuous or discrete) |
| data | the vector containing the raw data values |
| numBin | the number of bins the data will be split into |
| minValue | the minimum value in the data values (performance improvement if both minValue and maxValue are given; if left out, it is determined automatically) |
| maxValue | the maximum value in the data values (performance improvement if both minValue and maxValue are given; if left out, it is determined automatically) |
|
static |
Create from already computed histogram data in a QVector.
| name | the name of the plot |
| type | the type of the data values (continuous or discrete) |
| minX | minimum value in the data values |
| maxX | minimum value in the data values |
| histoData | the histogram frequencies |
|
static |
Create an empty histogram.
Useful if you need a custom way of creating a histogram; use setBin to populate the values.
| name | the name of the plot |
| type | the type of the data values (continuous or discrete) |
| minX | minimum value in the data values |
| maxX | minimum value in the data values |
| numBin | the number of bins in the new histogram data (all initialized to 0). |
|
static |
Create from already computed histogram data.
| name | the name of the plot |
| type | the type of the data values (continuous or discrete) |
| minX | minimum value in the data values |
| maxX | minimum value in the data values |
| numBin | the number of bins - the number of items contained in histoData |
| histoData | the histogram frequencies. note that the class DOES NOT take ownership of the given array: you have to delete the array manually! |
|
static |
Create from already computed histogram data in a std::vector.
| name | the name of the plot |
| type | the type of the data values (continuous or discrete) |
| minX | minimum value in the data values |
| maxX | minimum value in the data values |
| histoData | the histogram frequencies |
|
static |
create a histogram for a vtk image.
| name | the name of the plot |
| img | a pointer to the vtk image for which to create the histogram |
| desiredNumBin | the desired number of bins the data will be split into; can be adapted, depending on the actual number of different values in image |
| imgStatistics | optional iAImageStatistics struct that will be filled with the statistical information determined while computing the histogram |
| component | which component of the image the histogram should be created for (in case it has multiple components) |
|
static |
compute the final bin count for given data type, value count, and desired bin count
|
static |
compute the final bin count for a given image and desired bin count
|
static |
compute the actual histogram range for the given range and number of bins
|
overridevirtual |
Retrieve the index closest to the given x data value.
| dataX | the value (on the x axis) for which to search the closest datapoint in this data object. |
Implements iAPlotData.
| void iAHistogramData::setBin | ( | size_t | binIdx, |
| DataType | value ) |
Set the value for a given bin index.
Also updates y bounds
| binIdx | the index of the bin that should be changed |
| value | the new value for the bin |
| void iAHistogramData::setSpacing | ( | DataType | spacing | ) |
Sets custom spacing.
Sets custom y bounds.
| iAPlotData::DataType iAHistogramData::spacing | ( | ) | const |
Get the spacing (the witdh of a bin)
|
overridevirtual |
The tooltip text for this data when the user is currently hovering over the given x position.
Note that currently only the x axis position of the user is considered.
| dataX | the value (on the x axis) the user currently is hovering over. |
Implements iAPlotData.
|
overridevirtual |
The number of available data elements (i.e. in xValue/yValue, idx can go from 0 to valueCount()-1).
Implements iAPlotData.
|
overridevirtual |
The range of values for x; i.e. xBounds()[0] is the minimum of all xValue(...), xBounds()[1] is the maximum.
Implements iAPlotData.
|
overridevirtual |
|
overridevirtual |
The range of values for y; i.e. yBounds()[0] is the minimum of all yValue(...), yBounds()[1] is the maximum.
Implements iAPlotData.
|
overridevirtual |
overriden from iAPlotData, check description there!
Implements iAPlotData.