Computes and stores histogram data, which can be used in plots.
More...
#include <iAHistogramData.h>
|
| static QSharedPointer< 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. More...
|
| |
| static QSharedPointer< iAHistogramData > | create (QString const &name, iAValueType type, DataType minX, DataType maxX, QVector< DataType > const &histoData) |
| | Create from already computed histogram data in a QVector. More...
|
| |
| static QSharedPointer< iAHistogramData > | create (QString const &name, iAValueType type, DataType minX, DataType maxX, size_t numBin) |
| | Create an empty histogram. More...
|
| |
| static QSharedPointer< iAHistogramData > | create (QString const &name, iAValueType type, DataType minX, DataType maxX, size_t numBin, DataType *histoData) |
| | Create from already computed histogram data. More...
|
| |
| static QSharedPointer< 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. More...
|
| |
| static QSharedPointer< iAHistogramData > | create (QString const &name, vtkImageData *img, size_t numBin, iAImageInfo *imageInfo=nullptr) |
| | create a histogram for a vtk image. More...
|
| |
Computes and stores histogram data, which can be used in plots.
◆ ~iAHistogramData()
| iAHistogramData::~iAHistogramData |
( |
| ) |
|
◆ iAHistogramData()
Create an empty histogram (with numBin bins, initialized to 0).
◆ 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]
| QSharedPointer< iAHistogramData > iAHistogramData::create |
( |
QString const & |
name, |
|
|
vtkImageData * |
img, |
|
|
size_t |
numBin, |
|
|
iAImageInfo * |
imageInfo = nullptr |
|
) |
| |
|
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 |
| numBin | the number of bins the data will be split into |
| imageInfo | optional iAImageInfo struct that will be filled with the statistical information determined while computing the histogram |
◆ 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: