Medical Imaging Interaction Toolkit  2024.06.00
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:
47  QmitkSegWithPreviewToolGUIBase(bool mode2D);
49 
50  virtual void DisconnectOldTool(mitk::SegWithPreviewTool* oldTool);
51  virtual void ConnectNewTool(mitk::SegWithPreviewTool* newTool);
52 
59  virtual void InitializeUI(QBoxLayout* mainLayout);
60 
61  void BusyStateChanged(bool isBusy) override;
62 
63  using EnableConfirmSegBtnFunctionType = std::function<bool(bool)>;
65 
71  virtual void EnableWidgets(bool enabled);
72 
73  template <class TTool>
75  {
76  return dynamic_cast<TTool*>(m_Tool.GetPointer());
77  };
78 
79  void SetMergeStyle(mitk::MultiLabelSegmentation::MergeStyle mergeStyle);
80  void SetOverwriteStyle(mitk::MultiLabelSegmentation::OverwriteStyle overwriteStyle);
81 
82 private:
83  QCheckBox* m_CheckIgnoreLocks = nullptr;
84  QCheckBox* m_CheckMerge = nullptr;
85  QCheckBox* m_CheckProcessAll = nullptr;
86  QPushButton* m_ConfirmSegBtn = nullptr;
87  QBoxLayout* m_MainLayout = nullptr;
88 
90  bool m_Mode2D;
91 
93 };
94 
95 #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:32
QmitkToolGUI::BusyStateChanged
virtual void BusyStateChanged(bool)
Definition: QmitkToolGUI.h:56
mitkSegWithPreviewTool.h
itk::SmartPointer< Self >
mitk::Tool
Base class of all tools used by mitk::ToolManager.
Definition: mitkTool.h:83
mitk::MultiLabelSegmentation::MergeStyle
MergeStyle
Definition: mitkLabelSetImage.h:605
mitk::MultiLabelSegmentation::OverwriteStyle
OverwriteStyle
Definition: mitkLabelSetImage.h:613
MitkSegmentationUIExports.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
QmitkSegWithPreviewToolGUIBase::GetConnectedToolAs
TTool * GetConnectedToolAs()
Definition: QmitkSegWithPreviewToolGUIBase.h:74
QmitkSegWithPreviewToolGUIBase::m_EnableConfirmSegBtnFnc
EnableConfirmSegBtnFunctionType m_EnableConfirmSegBtnFnc
Definition: QmitkSegWithPreviewToolGUIBase.h:64
QmitkSegWithPreviewToolGUIBase::EnableConfirmSegBtnFunctionType
std::function< bool(bool)> EnableConfirmSegBtnFunctionType
Definition: QmitkSegWithPreviewToolGUIBase.h:63
QmitkToolGUI::m_Tool
mitk::Tool::Pointer m_Tool
Definition: QmitkToolGUI.h:54