Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSliceWidget.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 QmitkSliceWidget_h
14 #define QmitkSliceWidget_h
15 
17 
18 #include <QmitkRenderWindow.h>
19 #include <mitkDataStorage.h>
22 #include <mitkSlicedGeometry3D.h>
24 #include <QWidget>
25 #include <memory>
26 
27 namespace Ui
28 {
29  class QmitkSliceWidgetUi;
30 }
31 
42 {
43  Q_OBJECT
44 
45 public:
52  QmitkSliceWidget(QWidget *parent = nullptr, const char *name = nullptr, Qt::WindowFlags f = {});
53 
55  ~QmitkSliceWidget() override;
56 
62 
67  QFrame *GetSelectionFrame();
68 
70  void UpdateGL();
71 
76  void mousePressEvent(QMouseEvent *e) override;
77 
82  void setPopUpEnabled(bool b);
83 
88  void SetDataStorage(mitk::StandaloneDataStorage::Pointer storage);
89 
95 
101 
107 
113 
119 
125 
131 
132 public slots:
133 
138  void SetData(mitk::DataStorage::SetOfObjects::ConstIterator it);
139 
145  void SetData(mitk::DataStorage::SetOfObjects::ConstIterator it, mitk::AnatomicalPlane view);
146 
151  void SetData(mitk::DataNode::Pointer node);
152 
158  void SetData(mitk::DataNode::Pointer node, mitk::AnatomicalPlane view);
159 
164  void InitWidget(mitk::AnatomicalPlane viewDirection);
165 
170  void wheelEvent(QWheelEvent *e) override;
171 
176  void ChangeView(QAction *val);
177 
182  void SetLevelWindowEnabled(bool enable);
183 
184 protected:
187 
188 private:
189  std::unique_ptr<Ui::QmitkSliceWidgetUi> m_Controls;
190  bool popUpEnabled;
191  mitk::VtkPropRenderer::Pointer m_Renderer;
192  mitk::SlicedGeometry3D::Pointer m_SlicedGeometry;
193  mitk::StandaloneDataStorage::Pointer m_DataStorage;
194 
195  QMenu *popUp;
196 };
197 
198 #endif
#define MITKQTWIDGETSEXT_EXPORT
MITK implementation of the QVTKWidget.
Widget for displaying a single 2D slice of image data with a slice navigation slider.
bool IsLevelWindowEnabled()
Check whether the level window widget is enabled.
mitk::AnatomicalPlane m_View
void SetData(mitk::DataStorage::SetOfObjects::ConstIterator it)
Set the data node to display using the current view direction.
void SetData(mitk::DataNode::Pointer node)
Set the data node to display using the current view direction.
void setPopUpEnabled(bool b)
Enable or disable the right-click view direction popup menu.
QFrame * GetSelectionFrame()
Get the selection frame widget.
mitk::BaseController * GetController() const
Get the base controller.
void wheelEvent(QWheelEvent *e) override
Handle mouse wheel to navigate slices.
QmitkSliceWidget(QWidget *parent=nullptr, const char *name=nullptr, Qt::WindowFlags f={})
Construct the slice widget.
QmitkRenderWindow * m_RenderWindow
void mousePressEvent(QMouseEvent *e) override
Handle right-click to show the view direction popup menu.
mitk::StandaloneDataStorage * GetDataStorage()
Get the current data storage.
QmitkRenderWindow * GetRenderWindow()
Get the render window.
void UpdateGL()
Force a camera fit and render update.
void SetDataStorage(mitk::StandaloneDataStorage::Pointer storage)
Set the data storage for this widget.
mitk::SliceNavigationController * GetSliceNavigationController() const
Get the slice navigation controller.
void ChangeView(QAction *val)
Change the view direction from the popup menu.
mitk::CameraRotationController * GetCameraRotationController() const
Get the camera rotation controller.
QmitkSliceNavigationWidget * GetSliceNavigationWidget()
Get the slice navigation widget (slider).
void SetData(mitk::DataNode::Pointer node, mitk::AnatomicalPlane view)
Set the data node to display with a specified view direction.
void SetData(mitk::DataStorage::SetOfObjects::ConstIterator it, mitk::AnatomicalPlane view)
Set the data node to display with a specified view direction.
void InitWidget(mitk::AnatomicalPlane viewDirection)
Initialize the widget with the given view direction.
void SetLevelWindowEnabled(bool enable)
Enable or disable the level window widget.
~QmitkSliceWidget() override
Destructor.
mitk::VtkPropRenderer * GetRenderer()
Get the VTK prop renderer used for rendering.
Base class for renderer slice, camera, and time control.
Controls azimuthal camera rotation driven by a Stepper.
Controls the selection of the slice the associated BaseRenderer will display.
Concrete DataStorage implementation that stores nodes in an in-memory adjacency list graph.
Organizes the MITK rendering process within the VTK rendering pipeline.
AnatomicalPlane
Enumeration of standard anatomical image planes.