Medical Imaging Interaction Toolkit  2024.06.00
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 #include <ui_QmitkHistogramVisualizationWidget.h>
17 
18 // itk
19 #include <itkHistogram.h>
20 
26 {
27  Q_OBJECT
28 
29 public:
30  QmitkHistogramVisualizationWidget(QWidget *parent = nullptr);
32  void SetHistogram(itk::Statistics::Histogram<double>::ConstPointer histogram, const std::string &dataLabel);
34  void Reset();
36  void SetTheme(QmitkChartWidget::ColorTheme style);
38  void ResetDefault();
39 
41  int GetBins();
42 
43  signals:
46  void RequestHistogramUpdate(unsigned int nBins);
47 
48 private:
49  void CreateConnections();
50  void SetGUIElementsEnabled(bool enabled);
52  std::vector<std::pair<double, double> > ConvertHistogramToPairList(itk::Statistics::Histogram<double>::ConstPointer histogram) const;
53 
54 //slots
56  void OnClipboardButtonClicked();
58  void OnDefaultNBinsCheckBoxChanged();
60  void OnNBinsSpinBoxValueChanged();
62  void OnShowSubchartCheckBoxChanged();
64  void OnViewMinMaxCheckBoxChanged();
66  void OnMaxValueSpinBoxValueChanged();
68  void OnMinValueSpinBoxValueChanged();
69 
70 private:
71  Ui::QmitkHistogramVisualizationControls m_Controls;
72  const unsigned int m_DefaultNBins = 100;
73  const unsigned int m_MinNBins = 10;
74  const unsigned int m_MaxNBins = 10000;
75 
76  std::map < std::string, itk::Statistics::Histogram<double>::ConstPointer> m_Histograms;
77 };
78 
79 #endif
QmitkHistogramVisualizationWidget
Widget for displaying Histograms.
Definition: QmitkHistogramVisualizationWidget.h:25
MitkImageStatisticsUIExports.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