![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/HistogramDataComponent.h>
DataComponent storing information on the intensity distribution of the image they are attached to. More...
Inheritance diagram for HistogramDataComponent:DataComponent storing information on the intensity distribution of the image they are attached to.
You can use it to query the minimum/maximum intensity of an image as well as its intensity histogram. Most information is lazy-evaluated and cached. Thus, you can expect consecutive calls to minmax() and/or histogram() as being free as long as the corresponding image remains unchanged.
Example:
Public Member Functions | |
| HistogramDataComponent (const SharedImageSet *sis) | |
| Creates a new HistogramDataComponent for the given SharedImageSet. | |
| const SharedImage * | histogram (int index) const |
| Returns the intensity histogram for the image with the given index not considering any masks. | |
| std::unique_ptr< SharedImage > | histogramMaskWeighted (int index) const |
| Returns the intensity histogram for the image with the given index while considering masks. | |
| std::shared_ptr< const SharedImage > | derivedHistogram (int index, int numBins, const vec2 &intensityRange) const |
| Returns the intensity histogram with the given parameters for image with the given index. | |
| vec2 | minmax () const |
| Returns the accumulated minimum and maximum intensity of all images considering all channels. | |
| vec2 | minmax (int index) const |
| Returns the minimum and maximum intensity of the image with the given index considering all channels. | |
| vec2 | minmaxNormalized () const |
| Returns the minimum and maximum intensity of all images in the normalized intensity range as it is seen by GLSL shaders. | |
| vec2 | minmaxNormalized (int index) const |
| Returns the minimum and maximum intensity of the image in the normalized intensity range as it is seen by GLSL shaders. | |
| vec2 | minmaxOriginal () const |
| Returns the minimum and maximum intensity of all images in the original pixel values domain. | |
| vec2 | minmaxOriginal (int index) const |
| Returns the minimum and maximum intensity of the image in the original pixel values domain. | |
| int | maxNumBuckets (int index) const |
| Returns the maximum number of buckets that makes sense for a histogram for the image with the given index. | |
| vec2 | computeAutoWindowing (double lowerLimit, double upperLimit, int index, bool considerMask=false) const |
| Deduces optimal window/level (returned as vec2) settings the image with the given index based on its histogram. | |
| vec2 | computeAutoWindowingParameters (double window, double level, int index, bool considerMask=false) const |
| Inverse computation of computeAutoWindowing. | |
Public Member Functions inherited from TemporaryDataComponent | |
| std::string | id () const override |
| Returns a unique string identifier for this type of data component. | |
| std::unique_ptr< DataComponentBase > | clone () const override |
| Creates a clone of this data component. | |
| bool | assign (const DataComponentBase &) override |
| Assigns the content of other to this data component. | |
| bool | equals (const DataComponentBase &) const override |
| Compares this data component to other for equality. | |
| void | configure (const Properties *) override |
| Configure this object instance by de-serializing the given Properties. | |
| void | configuration (Properties *) const override |
| Serialize the current object configuration into the given Properties object. | |
Public Member Functions inherited from Configurable | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Public Member Functions inherited from SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
Additional Inherited Members | |
Static Public Member Functions inherited from LazyInstantiatedDataComponent< HistogramDataComponent, SharedImageSet > | |
| static HistogramDataComponent & | get (const SharedImageSet &data) |
| Returns the specific options of type T that are associated with the given data. | |
| static HistogramDataComponent * | get (const SharedImageSet *data) |
Public Attributes inherited from Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Protected Member Functions inherited from DataComponentBase | |
| DataComponentBase (const DataComponentBase &)=default | |
| DataComponentBase & | operator= (const DataComponentBase &other)=default |
Protected Member Functions inherited from SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
explicit |
Creates a new HistogramDataComponent for the given SharedImageSet.
| data | Pointer to the SharedImageSet to compute histograms for. |
| const SharedImage * histogram | ( | int | index | ) | const |
Returns the intensity histogram for the image with the given index not considering any masks.
The binning of the histogram is based on the image content. The min/max bin correspond to the min/max value of the underlying image (i.e. minmax()). The number of bins determined by maxNumBuckets().
| std::unique_ptr< SharedImage > histogramMaskWeighted | ( | int | index | ) | const |
Returns the intensity histogram for the image with the given index while considering masks.
The binning of the histogram is based on the image content. The min/max bin correspond to the min/max value of the underlying image (i.e. minmax()). The number of bins determined by maxNumBuckets().
| std::shared_ptr< const SharedImage > derivedHistogram | ( | int | index, |
| int | numBins, | ||
| const vec2 & | intensityRange ) const |
Returns the intensity histogram with the given parameters for image with the given index.
The histogram is derived from the original full range histogram.
| index | Index of the image to compute the histogram for. |
| numBins | Number of bins of the histogram to compute. |
| intensityRange | Intensity range of the histogram to compute in storage value domain. |
| vec2 minmax | ( | ) | const |
Returns the accumulated minimum and maximum intensity of all images considering all channels.
| vec2 minmax | ( | int | index | ) | const |
Returns the minimum and maximum intensity of the image with the given index considering all channels.
| vec2 minmaxNormalized | ( | ) | const |
Returns the minimum and maximum intensity of all images in the normalized intensity range as it is seen by GLSL shaders.
| vec2 minmaxNormalized | ( | int | index | ) | const |
Returns the minimum and maximum intensity of the image in the normalized intensity range as it is seen by GLSL shaders.
| vec2 minmaxOriginal | ( | ) | const |
Returns the minimum and maximum intensity of all images in the original pixel values domain.
| vec2 minmaxOriginal | ( | int | index | ) | const |
Returns the minimum and maximum intensity of the image in the original pixel values domain.
| int maxNumBuckets | ( | int | index | ) | const |
Returns the maximum number of buckets that makes sense for a histogram for the image with the given index.
For discrete numeric type images this matches the distance between the min and max value. However, it will never exceed the maximum supported 1D texture size, which is also the number of bins used for float images.
| vec2 computeAutoWindowing | ( | double | lowerLimit, |
| double | upperLimit, | ||
| int | index, | ||
| bool | considerMask = false ) const |
Deduces optimal window/level (returned as vec2) settings the image with the given index based on its histogram.
| lowerLimit | Percentage of lower values removed by the auto windowing. |
| upperLimit | Percentage of upper values removed by the auto windowing. |
| index | Index of the image to compute the auto windowing for. |
| considerMask | Flag whether to consider a mask attached to the image when computing the auto windowing. |
| vec2 computeAutoWindowingParameters | ( | double | window, |
| double | level, | ||
| int | index, | ||
| bool | considerMask = false ) const |
Inverse computation of computeAutoWindowing.
Computes the needed lower/upper limit (returned as vec2) needed to deduce the auto windowing with the provided parameters.
| window | Window parameter to use. |
| level | Windowing level to use. |
| index | Index of the image to compute the inverse auto windowing for. |
| considerMask | Flag whether to consider a mask attached to the image when computing the inverse auto windowing. |