Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkImageStatisticsCalculationRunnable.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef QmitkImageStatisticsCalculationRunnable_h
13 #define QmitkImageStatisticsCalculationRunnable_h
14 
15 //mitk headers
17 
19 
20 // itk headers
21 #ifndef __itkHistogram_h
22 #include <itkHistogram.h>
23 #endif
24 
26 
43 {
44  Q_OBJECT
45 public:
46 
48  typedef itk::Statistics::Histogram<double> HistogramType;
49 
52 
55 
64  void Initialize(const mitk::Image* image, const mitk::BaseData* mask);
65 
71 
77 
82  const mitk::BaseData* GetMaskData() const;
83 
88  void SetIgnoreZeroValueVoxel(bool _arg);
89 
95 
100  void SetHistogramNBins(unsigned int nbins);
101 
106  unsigned int GetHistogramNBins() const;
107 
116  ResultMapType GetResults() const override;
117 
118 protected:
119  bool RunComputation() override;
120 
121 private:
122  mitk::Image::ConstPointer m_StatisticsImage;
123  mitk::BaseData::ConstPointer m_MaskData;
124  mitk::ImageStatisticsContainer::Pointer m_StatisticsContainer;
125  bool m_IgnoreZeros;
126  unsigned int m_HistogramNBins;
127 };
128 #endif
#define MITKIMAGESTATISTICSUI_EXPORT
Base class for background data generation jobs used by QmitkDataGeneratorBase and derived classes.
std::map< std::string, mitk::BaseData::Pointer > ResultMapType
Map type for results produced by the job.
Background thread runnable for computing image statistics.
const mitk::BaseData * GetMaskData() const
Returns the mask data used for statistics calculation.
void Initialize(const mitk::Image *image, const mitk::BaseData *mask)
Initializes the runnable with the image and optional mask data.
void SetHistogramNBins(unsigned int nbins)
Sets the number of bins for histogram computation.
bool GetIgnoreZeroValueVoxel() const
Returns whether zero-valued voxels are ignored during computation.
itk::Statistics::Histogram< double > HistogramType
ITK histogram type used for statistics computation.
mitk::ImageStatisticsContainer * GetStatisticsData() const
Returns the computed statistics container.
QmitkImageStatisticsCalculationRunnable()
Default constructor. Initializes with zero-ignore disabled and 100 histogram bins.
unsigned int GetHistogramNBins() const
Returns the number of bins used for histogram computation.
ResultMapType GetResults() const override
Returns the computation results as a labeled map.
void SetIgnoreZeroValueVoxel(bool _arg)
Sets whether zero-valued voxels should be ignored during computation.
const mitk::Image * GetStatisticsImage() const
Returns the input image used for statistics calculation.
Base class of all data objects.
Definition: mitkBaseData.h:60
Container class for storing a StatisticsObject for each time step.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76