Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkImageStatisticsWidget.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 QmitkImageStatisticsWidget_h
13 #define QmitkImageStatisticsWidget_h
14 
16 
17 #include <mitkDataStorage.h>
18 #include <mitkDataNode.h>
19 
20 #include <QWidget>
21 #include <memory>
22 
23 class QSortFilterProxyModel;
25 
26 namespace Ui
27 {
28  class QmitkImageStatisticsControls;
29 }
30 
43 {
44  Q_OBJECT
45 
46 public:
51  QmitkImageStatisticsWidget(QWidget *parent = nullptr);
52 
55 
61  void SetDataStorage(mitk::DataStorage *newDataStorage);
62 
67  void SetImageNodes(const std::vector<mitk::DataNode::ConstPointer> &nodes);
68 
73  void SetMaskNodes(const std::vector<mitk::DataNode::ConstPointer> &nodes);
74 
78  void Reset();
79 
84  void SetIgnoreZeroValueVoxel(bool _arg);
85 
91 
96  void SetHistogramNBins(unsigned int nbins);
97 
102  unsigned int GetHistogramNBins() const;
103 
104 signals:
109  void IgnoreZeroValuedVoxelStateChanged(Qt::CheckState status);
110 
111 private:
112  void CreateConnections();
113  void OnDataAvailable();
114 
116  void OnClipboardButtonClicked();
117 
118  std::unique_ptr<Ui::QmitkImageStatisticsControls> m_Controls;
119  QmitkImageStatisticsTreeModel *m_imageStatisticsModel;
120  QSortFilterProxyModel *m_ProxyModel;
121 };
122 #endif
#define MITKIMAGESTATISTICSUI_EXPORT
Tree model that represents mitk::ImageStatisticsContainer data in the Qt model/view framework.
Widget for displaying image statistics in a tree view with clipboard export.
void Reset()
Clears all data from the model and disables the widget controls.
bool GetIgnoreZeroValueVoxel() const
Returns whether zero-valued voxels are currently being ignored.
void SetIgnoreZeroValueVoxel(bool _arg)
Sets whether zero-valued voxels should be ignored when selecting statistics.
void SetImageNodes(const std::vector< mitk::DataNode::ConstPointer > &nodes)
Sets the image nodes whose statistics should be displayed.
void SetMaskNodes(const std::vector< mitk::DataNode::ConstPointer > &nodes)
Sets the mask nodes whose statistics should be displayed.
void IgnoreZeroValuedVoxelStateChanged(Qt::CheckState status)
Emitted when the user toggles the "ignore zero-valued voxels" checkbox.
unsigned int GetHistogramNBins() const
Returns the current number of histogram bins.
void SetHistogramNBins(unsigned int nbins)
Sets the number of histogram bins used to select matching statistics.
void SetDataStorage(mitk::DataStorage *newDataStorage)
Sets the data storage from which the model fetches statistics objects.
~QmitkImageStatisticsWidget() override
Destructor.
QmitkImageStatisticsWidget(QWidget *parent=nullptr)
Constructs the image statistics widget.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.