Medical Imaging Interaction Toolkit  2023.12.99-f298153c
Medical Imaging Interaction Toolkit
QmitkSegmentAnythingToolGUI.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 QmitkSegmentAnythingToolGUI_h
14 #define QmitkSegmentAnythingToolGUI_h
15 
18 #include "ui_QmitkSegmentAnythingGUIControls.h"
19 #include "QmitknnUNetGPU.h"
21 #include <QMessageBox>
22 #include <QStandardPaths>
23 #include <mitkIPreferences.h>
24 
30 {
31  Q_OBJECT
32 
33 public:
35  itkFactorylessNewMacro(Self);
36  itkCloneMacro(Self);
37 
42  static bool IsSAMInstalled(const QString &);
43 
44 protected slots:
48  void OnResetPicksClicked();
49 
53  void OnActivateBtnClicked();
54 
55 protected:
58 
59  void InitializeUI(QBoxLayout *mainLayout) override;
60 
64  void WriteStatusMessage(const QString&);
65 
69  void WriteErrorMessage(const QString&);
70 
74  void StatusMessageListener(const std::string&);
75 
79  void OnPreferenceChangedEvent(const mitk::IPreferences::ChangeEvent&);
80 
84  void ShowErrorMessage(const std::string&, QMessageBox::Icon = QMessageBox::Critical);
85 
90  void EnableAll(bool);
91 
96  void ShowProgressBar(bool);
97 
104  bool ActivateSAMDaemon();
105 
111  bool ValidatePrefences();
112 
113 private:
114  mitk::IPreferences* m_Preferences;
115  Ui_QmitkSegmentAnythingGUIControls m_Controls;
116  QmitkGPULoader m_GpuLoader;
117  bool m_FirstPreviewComputation = true;
118  const std::string WARNING_SAM_NOT_FOUND =
119  "SAM is not detected in the selected python environment. Please reinstall SAM.";
120 };
121 #endif
MITKSEGMENTATIONUI_EXPORT
#define MITKSEGMENTATIONUI_EXPORT
Definition: MitkSegmentationUIExports.h:15
QmitkSegWithPreviewToolGUIBase
GUI base clase for tools derived from mitk::SegWithPreviewTool.
Definition: QmitkSegWithPreviewToolGUIBase.h:30
QmitkSegWithPreviewToolGUIBase::mitkClassMacro
mitkClassMacro(QmitkSegWithPreviewToolGUIBase, QmitkToolGUI)
mitk::IPreferences::ChangeEvent
Event object sent on IPreferences::OnPropertyChanged events.
Definition: mitkIPreferences.h:56
QmitkSegWithPreviewToolGUIBase.h
QmitknnUNetGPU.h
QmitkGPULoader
Class to load and save GPU information for further validation.
Definition: QmitknnUNetGPU.h:35
QmitkSetupVirtualEnvUtil.h
QmitkSegWithPreviewToolGUIBase::InitializeUI
virtual void InitializeUI(QBoxLayout *mainLayout)
MitkSegmentationUIExports.h
mitkIPreferences.h
mitk::IPreferences
Interface to application preferences.
Definition: mitkIPreferences.h:50
QmitkSegmentAnythingToolGUI
GUI for mitk::SegmentAnythingTool.
Definition: QmitkSegmentAnythingToolGUI.h:29