Medical Imaging Interaction Toolkit  2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
QmitkSegWithPreviewToolGUIBase.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 QmitkSegWithPreviewToolGUIBase_h
14 #define QmitkSegWithPreviewToolGUIBase_h
15 
16 #include "QmitkToolGUI.h"
17 
18 #include "mitkSegWithPreviewTool.h"
19 
21 
22 class QCheckBox;
23 class QPushButton;
24 class QBoxLayout;
25 
31 {
32  Q_OBJECT
33 
34 public:
36  itkCloneMacro(Self);
37 
38  itkGetConstMacro(Mode2D, bool);
39 
40 protected slots:
41 
42  void OnNewToolAssociated(mitk::Tool *);
43 
44  void OnAcceptPreview();
45 
46 protected:
53  QmitkSegWithPreviewToolGUIBase(bool mode2D, bool enableProcessingOfAllTimeSteps = true);
55 
56  virtual void DisconnectOldTool(mitk::SegWithPreviewTool* oldTool);
57  virtual void ConnectNewTool(mitk::SegWithPreviewTool* newTool);
58 
65  virtual void InitializeUI(QBoxLayout* mainLayout);
66 
67  void BusyStateChanged(bool isBusy) override;
68 
69  using EnableConfirmSegBtnFunctionType = std::function<bool(bool)>;
71 
77  virtual void EnableWidgets(bool enabled);
78 
79  template <class TTool>
81  {
82  return dynamic_cast<TTool*>(m_Tool.GetPointer());
83  };
84 
85  void SetMergeStyle(mitk::MultiLabelSegmentation::MergeStyle mergeStyle);
86  void SetOverwriteStyle(mitk::MultiLabelSegmentation::OverwriteStyle overwriteStyle);
87 
88  QPushButton* GetConfirmSegmentationButton() const;
89 
90 private:
91  QCheckBox* m_CheckIgnoreLocks = nullptr;
92  QCheckBox* m_CheckMerge = nullptr;
93  QCheckBox* m_CheckProcessAll = nullptr;
94  QPushButton* m_ConfirmSegBtn = nullptr;
95  QBoxLayout* m_MainLayout = nullptr;
96 
98  bool m_Mode2D;
99  bool m_EnableProcessingOfAllTimeSteps;
100 
102 };
103 
104 #endif
mitk::SegWithPreviewTool
Base class for any auto segmentation tool that provides a preview of the new segmentation.
Definition: mitkSegWithPreviewTool.h:38
QmitkToolGUI.h
MITKSEGMENTATIONUI_EXPORT
#define MITKSEGMENTATIONUI_EXPORT
Definition: MitkSegmentationUIExports.h:15
QmitkSegWithPreviewToolGUIBase
GUI base clase for tools derived from mitk::SegWithPreviewTool.
Definition: QmitkSegWithPreviewToolGUIBase.h:30
QmitkToolGUI
Base class for GUIs belonging to mitk::Tool classes.
Definition: QmitkToolGUI.h:33
QmitkToolGUI::BusyStateChanged
virtual void BusyStateChanged(bool)
Definition: QmitkToolGUI.h:57
mitk::MultiLabelSegmentation::OverwriteStyle
OverwriteStyle
Definition: mitkLabelSetImage.h:74
mitkSegWithPreviewTool.h
itk::SmartPointer< Self >
mitk::Tool
Base class of all tools used by mitk::ToolManager.
Definition: mitkTool.h:78
MitkSegmentationUIExports.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::MultiLabelSegmentation::MergeStyle
MergeStyle
Definition: mitkLabelSetImage.h:66
QmitkSegWithPreviewToolGUIBase::GetConnectedToolAs
TTool * GetConnectedToolAs()
Definition: QmitkSegWithPreviewToolGUIBase.h:80
QmitkSegWithPreviewToolGUIBase::m_EnableConfirmSegBtnFnc
EnableConfirmSegBtnFunctionType m_EnableConfirmSegBtnFnc
Definition: QmitkSegWithPreviewToolGUIBase.h:70
QmitkSegWithPreviewToolGUIBase::EnableConfirmSegBtnFunctionType
std::function< bool(bool)> EnableConfirmSegBtnFunctionType
Definition: QmitkSegWithPreviewToolGUIBase.h:69
QmitkToolGUI::m_Tool
mitk::Tool::Pointer m_Tool
Definition: QmitkToolGUI.h:55