Medical Imaging Interaction Toolkit  2022.04.99-e5ef182d
Medical Imaging Interaction Toolkit
QmitkSurfaceBasedInterpolatorWidget.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 QmitkSurfaceBasedInterpolatorWidgetWidget_h_Included
14 #define QmitkSurfaceBasedInterpolatorWidgetWidget_h_Included
15 
17 #include "mitkDataNode.h"
18 #include "mitkDataStorage.h"
19 #include "mitkLabelSetImage.h"
21 
22 #include <map>
23 
24 #include <QWidget>
25 
26 // For running 3D interpolation in background
27 #include <QFuture>
28 #include <QFutureWatcher>
29 #include <QTimer>
30 #include <QtConcurrentRun>
31 
32 #include "ui_QmitkSurfaceBasedInterpolatorWidgetGUIControls.h"
33 
34 namespace mitk
35 {
36  class ToolManager;
37 }
38 
52 {
53  Q_OBJECT
54 
55 public:
56  QmitkSurfaceBasedInterpolatorWidget(QWidget *parent = nullptr, const char *name = nullptr);
58 
59  void SetDataStorage(mitk::DataStorage &storage);
60 
61  void OnToolManagerWorkingDataModified();
62 
66  void OnSurfaceInterpolationInfoChanged(const itk::EventObject &);
67 
71  void ShowInterpolationResult(bool);
72 
73  Ui::QmitkSurfaceBasedInterpolatorWidgetGUIControls m_Controls;
74 
75 public slots:
76 
80  void OnToggleWidgetActivation(bool);
81 
82 protected slots:
83 
84  void OnAcceptInterpolationClicked();
85 
86  void OnSurfaceInterpolationFinished();
87 
88  void OnRunInterpolation();
89 
90  void OnShowMarkers(bool);
91 
92  void StartUpdateInterpolationTimer();
93 
94  void StopUpdateInterpolationTimer();
95 
96  void ChangeSurfaceColor();
97 
98 private:
99  mitk::SurfaceBasedInterpolationController::Pointer m_SurfaceBasedInterpolatorController;
100 
101  mitk::ToolManager *m_ToolManager;
102 
103  bool m_Activated;
104 
105  unsigned int m_SurfaceInterpolationInfoChangedObserverTag;
106 
107  mitk::DataNode::Pointer m_InterpolatedSurfaceNode;
108  mitk::DataNode::Pointer m_3DContourNode;
109 
110  mitk::DataStorage::Pointer m_DataStorage;
111 
112  mitk::LabelSetImage::Pointer m_WorkingImage;
113 
114  QFuture<void> m_Future;
115  QFutureWatcher<void> m_Watcher;
116  QTimer *m_Timer;
117 };
118 
119 #endif
Ui::QmitkSurfaceBasedInterpolatorWidgetGUIControls m_Controls
Data management class that handles &#39;was created by&#39; relations.
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKSEGMENTATIONUI_EXPORT
Manages and coordinates instances of mitk::Tool.