Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
QmitkHistogramVisualizationWidget.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 QmitkHistogramVisualizationWidget_h
13 #define QmitkHistogramVisualizationWidget_h
14 
16 
17 // itk
18 #include <itkHistogram.h>
19 
20 #include <QmitkChartWidget.h>
21 
22 namespace Ui
23 {
24  class QmitkHistogramVisualizationControls;
25 }
26 
32 {
33  Q_OBJECT
34 
35 public:
36  QmitkHistogramVisualizationWidget(QWidget *parent = nullptr);
38  void SetHistogram(itk::Statistics::Histogram<double>::ConstPointer histogram, const std::string &dataLabel);
40  void Reset();
42  void SetTheme(QmitkChartWidget::ColorTheme style);
44  void ResetDefault();
45 
47  int GetBins();
48 
49  signals:
52  void RequestHistogramUpdate(unsigned int nBins);
53 
54 private:
55  void CreateConnections();
56  void SetGUIElementsEnabled(bool enabled);
58  std::vector<std::pair<double, double> > ConvertHistogramToPairList(itk::Statistics::Histogram<double>::ConstPointer histogram) const;
59 
60 //slots
62  void OnClipboardButtonClicked();
64  void OnDefaultNBinsCheckBoxChanged();
66  void OnNBinsSpinBoxValueChanged();
68  void OnShowSubchartCheckBoxChanged();
70  void OnViewMinMaxCheckBoxChanged();
72  void OnMaxValueSpinBoxValueChanged();
74  void OnMinValueSpinBoxValueChanged();
75 
76 private:
77  Ui::QmitkHistogramVisualizationControls *m_Controls;
78  const unsigned int m_DefaultNBins = 100;
79  const unsigned int m_MinNBins = 10;
80  const unsigned int m_MaxNBins = 10000;
81 
82  std::map < std::string, itk::Statistics::Histogram<double>::ConstPointer> m_Histograms;
83 };
84 
85 #endif
QmitkHistogramVisualizationWidget
Widget for displaying Histograms.
Definition: QmitkHistogramVisualizationWidget.h:31
MitkImageStatisticsUIExports.h
Ui
Definition: BlueBerryExampleLauncherDialog.h:21
QmitkChartWidget.h
MITKIMAGESTATISTICSUI_EXPORT
#define MITKIMAGESTATISTICSUI_EXPORT
Definition: MitkImageStatisticsUIExports.h:15
QmitkChartWidget::ColorTheme
ColorTheme
enum of chart style (modifies background and line color).
Definition: QmitkChartWidget.h:60