Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkTransferFunctionGeneratorWidget.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 
13 #ifndef QmitkTransferFunctionGeneratorWidget_h
14 #define QmitkTransferFunctionGeneratorWidget_h
15 
17 
18 #include <mitkCommon.h>
19 
20 #include <QWidget>
21 
22 #include <mitkDataNode.h>
24 #include <memory>
25 
26 namespace Ui
27 {
29 }
30 
44 {
45  Q_OBJECT
46 
47 public:
53  QmitkTransferFunctionGeneratorWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
54 
57 
63  void SetDataNode(mitk::DataNode *node, mitk::TimeStepType timestep = 0);
64 
70  int AddPreset(const QString &presetName);
71 
76  void SetPresetsTabEnabled(bool enable);
77 
82  void SetThresholdTabEnabled(bool enable);
83 
88  void SetBellTabEnabled(bool enable);
89 
90 public slots:
92  void OnSavePreset();
93 
95  void OnLoadPreset();
96 
102  void OnDeltaLevelWindow(int dx, int dy);
103 
109  void OnDeltaThreshold(int dx, int dy);
110 
111 signals:
117 
120 
121 protected slots:
122 
123  void OnPreset(int mode);
124 
125 protected:
126  std::unique_ptr<Ui::QmitkTransferFunctionGeneratorWidget> m_Controls;
127  mitk::TransferFunctionProperty::Pointer tfpToChange;
128 
129  double histoMinimum;
130  double histoMaximum;
131 
132  double thPos;
133  double thDelta;
134 
135  double deltaScale;
136  double deltaMax;
137  double deltaMin;
138 
140 
141  QString presetFileName;
142 
143  double ScaleDelta(int d) const;
144 };
145 
146 #endif
#define MITKQTWIDGETSEXT_EXPORT
Widget for generating transfer functions via presets, threshold, and bell modes.
void SignalTransferFunctionModeChanged(int mode)
Emitted when a preset is selected from the combo box.
void OnLoadPreset()
Load a transfer function from an XML file.
void SetThresholdTabEnabled(bool enable)
Enable or disable the threshold tab.
mitk::TransferFunctionProperty::Pointer tfpToChange
void SetDataNode(mitk::DataNode *node, mitk::TimeStepType timestep=0)
Set the data node whose transfer function to generate/modify.
QmitkTransferFunctionGeneratorWidget(QWidget *parent=nullptr, Qt::WindowFlags f={})
Construct the transfer function generator widget.
int AddPreset(const QString &presetName)
Add a named preset to the presets combo box.
void OnDeltaThreshold(int dx, int dy)
Update the threshold transfer function based on crosshair drag.
void OnSavePreset()
Save the current transfer function to an XML file.
~QmitkTransferFunctionGeneratorWidget() override
Destructor.
void SignalUpdateCanvas()
Emitted when the transfer function canvas should be refreshed.
void OnDeltaLevelWindow(int dx, int dy)
Update the bell-shaped transfer function based on crosshair drag.
std::unique_ptr< Ui::QmitkTransferFunctionGeneratorWidget > m_Controls
void SetPresetsTabEnabled(bool enable)
Enable or disable the presets tab.
void SetBellTabEnabled(bool enable)
Enable or disable the bell (level/window) tab.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
itk::Statistics::Histogram< double > HistogramType
Histogram type used for image statistics (double-precision).
Definition: mitkImage.h:96
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).