Medical Imaging Interaction Toolkit  2025.12.02
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 #include "ui_QmitkSliceNavigationWidget.h"
18 
19 #include <mitkStepper.h>
20 
21 #include <QString>
22 #include <QWidget>
23 
24 class MITKQTWIDGETS_EXPORT QmitkSliceNavigationWidget : public QWidget, public Ui::QmitkSliceNavigationWidget
25 {
26  Q_OBJECT
27 
28 public:
29 
30  QmitkSliceNavigationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = {});
31 
38  QString ClippedValueToString(float value);
39 
40  QString GetLabelUnit();
41 
42  QString GetMinValueLabel();
43 
44  QString GetMaxValueLabel();
45 
46  int GetPos();
47 
48  bool GetInverseDirection() const;
49 
50  bool GetInvertedControls() const;
51 
52 public slots:
53 
60  void Refetch();
61 
66  void SetStepper(mitk::Stepper* stepper);
67 
71  void ShowLabels(bool show);
72 
77  void ShowLabelUnit(bool show);
78 
79  void SetPos(int val);
80 
81  void SetInverseDirection(bool inverseDirection);
82 
83  void SetInvertedControls(bool invertedControls);
84 
85 protected slots:
86 
94  void SliderChanged(double);
95 
103  void SpinBoxChanged(double);
104 
110  void SetLabelValues(float min, float max);
111 
117  void SetLabelValuesValid(bool minValid, bool maxValid);
118 
124  void SetLabelUnit(const char* unit);
125 
129  void SetLabels();
130 
131 protected:
132 
133  mitk::Stepper::Pointer m_Stepper;
135 
136  QString m_LabelUnit;
137 
141 
143  float m_MinValue;
144  float m_MaxValue;
145 
148 
149 };
150 
151 #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.
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.
Helper class to step through a list.
Definition: mitkStepper.h:48