Computes and stores histogram data, which can be used in plots.
More...
#include <iAHistogramData.h>
|
| | 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.
|
| |
| | 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 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 (vtkImageData *img, size_t desiredNumBin) |
| | compute the final bin count for a given image and desired bin count
|
| |
|
| using | DataType = double |
| | Data type used for x and y values.
|
| |
Computes and stores histogram data, which can be used in plots.
◆ iAHistogramData() [1/2]
Create an empty histogram (with numBin bins, initialized to 0).
◆ iAHistogramData() [2/2]
Create with the given, already computed histogram data.
◆ ~iAHistogramData()
| iAHistogramData::~iAHistogramData |
( |
| ) |
|
◆ clear()
| void iAHistogramData::clear |
( |
| ) |
|
Sets all histogram frequencies back to 0.
◆ create() [1/6]
create a histogram for the given (raw) data vector.
- Parameters
-
| 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) |
◆ create() [2/6]
Create from already computed histogram data in a QVector.
- Parameters
-
| 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 |
◆ create() [3/6]
Create an empty histogram.
Useful if you need a custom way of creating a histogram; use setBin to populate the values.
- Parameters
-
| 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). |
◆ create() [4/6]
Create from already computed histogram data.
- Deprecated
- (because of data ownership issues, see notes for histoData parameter)
- Parameters
-
| 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! |
◆ create() [5/6]
Create from already computed histogram data in a std::vector.
- Parameters
-
| 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 |
◆ create() [6/6]
| std::shared_ptr< iAHistogramData > iAHistogramData::create |
( |
QString const & | name, |
|
|
vtkImageData * | img, |
|
|
size_t | desiredNumBin, |
|
|
iAImageStatistics * | imgStatistics = nullptr, |
|
|
int | component = 0 ) |
|
static |
create a histogram for a vtk image.
- Parameters
-
| 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) |
◆ finalNumBin()
| size_t iAHistogramData::finalNumBin |
( |
vtkImageData * | img, |
|
|
size_t | desiredNumBin ) |
|
static |
compute the final bin count for a given image and desired bin count
◆ nearestIdx()
| size_t iAHistogramData::nearestIdx |
( |
DataType | dataX | ) |
const |
|
overridevirtual |
Retrieve the index closest to the given x data value.
- Parameters
-
| dataX | the value (on the x axis) for which to search the closest datapoint in this data object. |
- Returns
- the index (such as can be passed to xValue/yValue) of the datapoint closest to dataX calling xValue on the returned index will always give a value lower than or equal to dataX.
Implements iAPlotData.
◆ setBin()
| void iAHistogramData::setBin |
( |
size_t | binIdx, |
|
|
DataType | value ) |
Set the value for a given bin index.
Also updates y bounds
- Parameters
-
| binIdx | the index of the bin that should be changed |
| value | the new value for the bin |
◆ setSpacing()
| void iAHistogramData::setSpacing |
( |
DataType | spacing | ) |
|
Sets custom spacing.
- Deprecated
- should be set automatically - if not it's a bug that needs to be fixed inside the class, not by setting it from externally
◆ setYBounds()
Sets custom y bounds.
- Deprecated
- should be set automatically - if not it's a bug that needs to be fixed inside the class, not by setting it from externally
◆ spacing()
Get the spacing (the witdh of a bin)
◆ toolTipText()
| QString iAHistogramData::toolTipText |
( |
DataType | dataX | ) |
const |
|
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.
- Parameters
-
| dataX | the value (on the x axis) the user currently is hovering over. |
- Returns
- a description of the datapoint that the user currrently is over/closest to.
Implements iAPlotData.
◆ valueCount()
| size_t iAHistogramData::valueCount |
( |
| ) |
const |
|
overridevirtual |
The number of available data elements (i.e. in xValue/yValue, idx can go from 0 to valueCount()-1).
Implements iAPlotData.
◆ xBounds()
◆ xValue()
Value on the x axis for a datum with given index.
- Parameters
-
Implements iAPlotData.
◆ yBounds()
◆ yValue()
The documentation for this class was generated from the following files: