Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSliceNavigationWidget.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 QmitkSliceNavigationWidget_h
14 #define QmitkSliceNavigationWidget_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 #include <mitkStepper.h>
19 
20 #include <QString>
21 #include <QWidget>
22 #include <memory>
23 
24 namespace Ui { class QmitkSliceNavigationWidget; }
25 
27 {
28  Q_OBJECT
29 
30 public:
31 
32  QmitkSliceNavigationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = {});
34 
41  QString ClippedValueToString(float value);
42 
43  QString GetLabelUnit();
44 
45  QString GetMinValueLabel();
46 
47  QString GetMaxValueLabel();
48 
49  int GetPos();
50 
51  bool GetInverseDirection() const;
52 
53  bool GetInvertedControls() const;
54 
55 public slots:
56 
63  void Refetch();
64 
69  void SetStepper(mitk::Stepper* stepper);
70 
74  void ShowLabels(bool show);
75 
80  void ShowLabelUnit(bool show);
81 
82  void SetPos(int val);
83 
84  void SetInverseDirection(bool inverseDirection);
85 
86  void SetInvertedControls(bool invertedControls);
87 
88 protected slots:
89 
97  void SliderChanged(double);
98 
106  void SpinBoxChanged(double);
107 
113  void SetLabelValues(float min, float max);
114 
120  void SetLabelValuesValid(bool minValid, bool maxValid);
121 
127  void SetLabelUnit(const char* unit);
128 
132  void SetLabels();
133 
134 protected:
135 
136  std::unique_ptr<Ui::QmitkSliceNavigationWidget> m_Controls;
137 
138  mitk::Stepper::Pointer m_Stepper;
140 
141  QString m_LabelUnit;
142 
146 
148  float m_MinValue;
149  float m_MaxValue;
150 
153 
154 };
155 
156 #endif
#define MITKQTWIDGETS_EXPORT
void SetLabelValuesValid(bool minValid, bool maxValid)
Enable / disable labels for the range minimum or maximum.
void ShowLabelUnit(bool show)
Enable / disable displaying of the unit label (range will be displayed without unit if enabled).
void SetInverseDirection(bool inverseDirection)
void SetInvertedControls(bool invertedControls)
QmitkSliceNavigationWidget(QWidget *parent=nullptr, Qt::WindowFlags f={})
void SetLabelValues(float min, float max)
Set label values for the range minimum and maximum.
void Refetch()
Update the slider with the recent changes applied to the navigation widget.
void ShowLabels(bool show)
Enable / disable displaying of the minimum and maximum labels.
~QmitkSliceNavigationWidget() override
QString ClippedValueToString(float value)
Convert the passed value to a QString representation.
void SpinBoxChanged(double)
React on changes of the spinbox.
void SetStepper(mitk::Stepper *stepper)
Set the stepper that should be represented and modified.
bool GetInverseDirection() const
void SetLabelUnit(const char *unit)
Set the range unit (e.g. mm or ms).
bool GetInvertedControls() const
void SetLabels()
Configure slider with labels according to range and unit settings.
void SliderChanged(double)
React on changes of the slider.
std::unique_ptr< Ui::QmitkSliceNavigationWidget > m_Controls
Helper class to step through a list.
Definition: mitkStepper.h:48