|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Background thread runnable for computing image statistics. More...
#include <QmitkImageStatisticsCalculationRunnable.h>


Public Types | |
| typedef itk::Statistics::Histogram< double > | HistogramType |
| ITK histogram type used for statistics computation. More... | |
Public Types inherited from QmitkDataGenerationJobBase | |
| using | ResultMapType = std::map< std::string, mitk::BaseData::Pointer > |
| Map type for results produced by the job. More... | |
Public Member Functions | |
| QmitkImageStatisticsCalculationRunnable () | |
| Default constructor. Initializes with zero-ignore disabled and 100 histogram bins. More... | |
| ~QmitkImageStatisticsCalculationRunnable () | |
| Destructor. More... | |
| void | Initialize (const mitk::Image *image, const mitk::BaseData *mask) |
| Initializes the runnable with the image and optional mask data. More... | |
| mitk::ImageStatisticsContainer * | GetStatisticsData () const |
| Returns the computed statistics container. More... | |
| const mitk::Image * | GetStatisticsImage () const |
| Returns the input image used for statistics calculation. More... | |
| const mitk::BaseData * | GetMaskData () const |
| Returns the mask data used for statistics calculation. More... | |
| void | SetIgnoreZeroValueVoxel (bool _arg) |
| Sets whether zero-valued voxels should be ignored during computation. More... | |
| bool | GetIgnoreZeroValueVoxel () const |
| Returns whether zero-valued voxels are ignored during computation. More... | |
| void | SetHistogramNBins (unsigned int nbins) |
| Sets the number of bins for histogram computation. More... | |
| unsigned int | GetHistogramNBins () const |
| Returns the number of bins used for histogram computation. More... | |
| ResultMapType | GetResults () const override |
| Returns the computation results as a labeled map. More... | |
Public Member Functions inherited from QmitkDataGenerationJobBase | |
| void | run () final |
| Executes the job computation with error handling and result signalling. More... | |
| bool | GetComputationSuccessFlag () const |
| Returns whether the last computation completed successfully. More... | |
| std::string | GetLastErrorMessage () const |
| Returns the error message from the last failed computation. More... | |
| bool | IsRunning () const |
| Returns whether the job is currently executing. More... | |
Protected Member Functions | |
| bool | RunComputation () override |
Protected Member Functions inherited from QmitkDataGenerationJobBase | |
| QmitkDataGenerationJobBase ()=default | |
| virtual | ~QmitkDataGenerationJobBase ()=default |
Additional Inherited Members | |
Signals inherited from QmitkDataGenerationJobBase | |
| void | Error (QString err, const QmitkDataGenerationJobBase *job) |
| Emitted when an error occurs during computation. More... | |
| void | ResultsAvailable (ResultMapType results, const QmitkDataGenerationJobBase *job) |
| Emitted when computation results are available. More... | |
Protected Attributes inherited from QmitkDataGenerationJobBase | |
| std::string | m_LastErrorMessage |
Background thread runnable for computing image statistics.
This class derives from QmitkDataGenerationJobBase and performs image statistics calculation in a background thread, keeping the GUI responsive. It supports optional mask data (binary images, multi-label segmentations, or planar figures) and can be configured to ignore zero-valued voxels and to use a specific number of histogram bins.
The computed results include an mitk::ImageStatisticsContainer with relation rules connecting it to the source image and mask.
Definition at line 42 of file QmitkImageStatisticsCalculationRunnable.h.
| typedef itk::Statistics::Histogram<double> QmitkImageStatisticsCalculationRunnable::HistogramType |
ITK histogram type used for statistics computation.
Definition at line 48 of file QmitkImageStatisticsCalculationRunnable.h.
| QmitkImageStatisticsCalculationRunnable::QmitkImageStatisticsCalculationRunnable | ( | ) |
Default constructor. Initializes with zero-ignore disabled and 100 histogram bins.
| QmitkImageStatisticsCalculationRunnable::~QmitkImageStatisticsCalculationRunnable | ( | ) |
Destructor.
| unsigned int QmitkImageStatisticsCalculationRunnable::GetHistogramNBins | ( | ) | const |
Returns the number of bins used for histogram computation.
| bool QmitkImageStatisticsCalculationRunnable::GetIgnoreZeroValueVoxel | ( | ) | const |
Returns whether zero-valued voxels are ignored during computation.
| const mitk::BaseData* QmitkImageStatisticsCalculationRunnable::GetMaskData | ( | ) | const |
Returns the mask data used for statistics calculation.
|
overridevirtual |
Returns the computation results as a labeled map.
The result map contains a single entry with key "statistics" mapping to the computed mitk::ImageStatisticsContainer.
Implements QmitkDataGenerationJobBase.
| mitk::ImageStatisticsContainer* QmitkImageStatisticsCalculationRunnable::GetStatisticsData | ( | ) | const |
Returns the computed statistics container.
| const mitk::Image* QmitkImageStatisticsCalculationRunnable::GetStatisticsImage | ( | ) | const |
Returns the input image used for statistics calculation.
| void QmitkImageStatisticsCalculationRunnable::Initialize | ( | const mitk::Image * | image, |
| const mitk::BaseData * | mask | ||
| ) |
Initializes the runnable with the image and optional mask data.
| [in] | image | The input image for which statistics will be calculated. |
| [in] | mask | Optional mask data. Supported types: mitk::MultiLabelSegmentation, mitk::Image (binary mask), or mitk::PlanarFigure. Pass nullptr for no mask. |
| mitk::Exception | if the mask is not nullptr and not one of the supported types. |
|
overrideprotectedvirtual |
Does the real computation. Returns true if there where results produced.
Implements QmitkDataGenerationJobBase.
| void QmitkImageStatisticsCalculationRunnable::SetHistogramNBins | ( | unsigned int | nbins | ) |
Sets the number of bins for histogram computation.
| [in] | nbins | The number of histogram bins. |
| void QmitkImageStatisticsCalculationRunnable::SetIgnoreZeroValueVoxel | ( | bool | _arg | ) |
Sets whether zero-valued voxels should be ignored during computation.
| [in] | _arg | True to ignore zero-valued voxels; false to include them. |