Medical Imaging Interaction Toolkit  2025.12.02
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 
43 
45 
46 protected:
53  QmitkSegWithPreviewToolGUIBase(bool mode2D, bool enableProcessingOfAllTimeSteps = true);
55 
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 
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
#define MITKSEGMENTATIONUI_EXPORT
GUI base clase for tools derived from mitk::SegWithPreviewTool.
~QmitkSegWithPreviewToolGUIBase() override
virtual void EnableWidgets(bool enabled)
std::function< bool(bool)> EnableConfirmSegBtnFunctionType
virtual void DisconnectOldTool(mitk::SegWithPreviewTool *oldTool)
void BusyStateChanged(bool isBusy) override
QPushButton * GetConfirmSegmentationButton() const
mitkClassMacro(QmitkSegWithPreviewToolGUIBase, QmitkToolGUI)
void SetOverwriteStyle(mitk::MultiLabelSegmentation::OverwriteStyle overwriteStyle)
virtual void InitializeUI(QBoxLayout *mainLayout)
QmitkSegWithPreviewToolGUIBase(bool mode2D, bool enableProcessingOfAllTimeSteps=true)
virtual void ConnectNewTool(mitk::SegWithPreviewTool *newTool)
void OnNewToolAssociated(mitk::Tool *)
void SetMergeStyle(mitk::MultiLabelSegmentation::MergeStyle mergeStyle)
EnableConfirmSegBtnFunctionType m_EnableConfirmSegBtnFnc
Base class for GUIs belonging to mitk::Tool classes.
Definition: QmitkToolGUI.h:34
mitk::Tool::Pointer m_Tool
Definition: QmitkToolGUI.h:55
Base class for any auto segmentation tool that provides a preview of the new segmentation.
Base class of all tools used by mitk::ToolManager.
Definition: mitkTool.h:79