Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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_INCLUDED
13 #define QMITKIMAGESTATISTICSCALCULATIONRUNNABLE_H_INCLUDED
14 
15 //QT headers
16 #include <QThread>
17 #include <qrunnable.h>
18 #include <qobject.h>
19 
20 //mitk headers
21 #include "mitkImage.h"
22 #include "mitkPlanarFigure.h"
25 
26 // itk headers
27 #ifndef __itkHistogram_h
28 #include <itkHistogram.h>
29 #endif
30 
31 
39 {
40  Q_OBJECT
41 public:
42 
43  typedef itk::Statistics::Histogram<double> HistogramType;
44 
51 
54  void Initialize(const mitk::Image* image, const mitk::Image* binaryImage, const mitk::PlanarFigure* planarFig);
57  mitk::ImageStatisticsContainer* GetStatisticsData() const;
58 
59  const mitk::Image* GetStatisticsImage() const;
60  const mitk::Image* GetMaskImage() const;
61  const mitk::PlanarFigure* GetPlanarFigure() const;
62 
65  void SetIgnoreZeroValueVoxel(bool _arg);
68  bool GetIgnoreZeroValueVoxel() const;
71  void SetHistogramNBins(unsigned int nbins);
74  unsigned int GetHistogramNBins() const;
77  const HistogramType* GetTimeStepHistogram(unsigned int t = 0) const;
78 
81  bool GetStatisticsUpdateSuccessFlag() const;
84  void run() override;
85 
86  std::string GetLastErrorMessage() const;
87 signals:
88  void finished();
89 
90 private:
91  mitk::Image::ConstPointer m_StatisticsImage;
92  mitk::Image::ConstPointer m_BinaryMask;
93  mitk::PlanarFigure::ConstPointer m_PlanarFigureMask;
94  mitk::ImageStatisticsContainer::Pointer m_StatisticsContainer;
95  bool m_IgnoreZeros;
96  unsigned int m_HistogramNBins;
97  bool m_CalculationSuccessful;
98  std::vector<HistogramType::ConstPointer> m_HistogramVector;
99  std::string m_message;
100 };
101 #endif // QMITKIMAGESTATISTICSCALCULATIONRUNNABLE_H_INCLUDED
#define MITKIMAGESTATISTICSUI_EXPORT
Image class for storing images.
Definition: mitkImage.h:72
mitk::Image::Pointer image
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
Container class for storing a StatisticsObject for each timestep.