Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
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 
54 {
55  Q_OBJECT
56 
57 public:
58  QmitkSurfaceBasedInterpolatorWidget(QWidget *parent = nullptr, const char *name = nullptr);
60 
61  void SetDataStorage(mitk::DataStorage &storage);
62 
63  void OnToolManagerWorkingDataModified();
64 
68  void OnSurfaceInterpolationInfoChanged(const itk::EventObject &);
69 
73  void ShowInterpolationResult(bool);
74 
75  Ui::QmitkSurfaceBasedInterpolatorWidgetGUIControls m_Controls;
76 
77 public slots:
78 
82  void OnToggleWidgetActivation(bool);
83 
84 protected slots:
85 
86  void OnAcceptInterpolationClicked();
87 
88  void OnSurfaceInterpolationFinished();
89 
90  void OnRunInterpolation();
91 
92  void OnShowMarkers(bool);
93 
94  void StartUpdateInterpolationTimer();
95 
96  void StopUpdateInterpolationTimer();
97 
98  void ChangeSurfaceColor();
99 
100 private:
101  mitk::SurfaceBasedInterpolationController::Pointer m_SurfaceBasedInterpolatorController;
102 
103  mitk::ToolManager *m_ToolManager;
104 
105  bool m_Activated;
106 
107  unsigned int m_SurfaceInterpolationInfoChangedObserverTag;
108 
109  mitk::DataNode::Pointer m_InterpolatedSurfaceNode;
110  mitk::DataNode::Pointer m_3DContourNode;
111 
112  mitk::DataStorage::Pointer m_DataStorage;
113 
114  mitk::LabelSetImage::Pointer m_WorkingImage;
115 
116  QFuture<void> m_Future;
117  QFutureWatcher<void> m_Watcher;
118  QTimer *m_Timer;
119 };
120 
121 #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.