Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkMedSAMToolGUI.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 QmitkMedSAMToolGUI_h
14 #define QmitkMedSAMToolGUI_h
15 
18 #include "ui_QmitkMedSAMGUIControls.h"
19 #include <mitkIPreferences.h>
20 #include "QmitknnUNetGPU.h"
21 
27 {
28  Q_OBJECT
29 
30 public:
32  itkFactorylessNewMacro(Self);
33  itkCloneMacro(Self);
34 
39  void EnableAll(bool);
40 
44  void WriteStatusMessage(const QString &);
45 
49  void WriteErrorMessage(const QString &);
50 
54  void ShowProgressBar(bool);
55 
62  bool ActivateSAMDaemon();
63 
67  void OnPreferenceChangedEvent(const mitk::IPreferences::ChangeEvent &);
68 
72  void ShowErrorMessage(const std::string &, QMessageBox::Icon = QMessageBox::Critical);
73 
79  bool ValidatePrefences();
80 
81 protected:
84 
85  void InitializeUI(QBoxLayout *mainLayout) override;
86 
90  void StatusMessageListener(const std::string&);
91 
92 protected slots:
96  void OnActivateBtnClicked();
97 
101  void OnPreviewBtnClicked();
102 
106  void OnResetPicksClicked();
107 
108 private:
109  mitk::IPreferences *m_Preferences;
110  QmitkGPULoader m_GpuLoader;
111  Ui_QmitkMedSAMGUIControls m_Controls;
112  bool m_FirstPreviewComputation = true;
113  const std::string WARNING_SAM_NOT_FOUND =
114  "MedSAM is not detected in the selected python environment. Please reinstall MedSAM.";
115 };
116 #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
QmitknnUNetGPU.h
QmitkGPULoader
Class to load and save GPU information for further validation.
Definition: QmitknnUNetGPU.h:35
QmitkSegmentAnythingToolGUI.h
QmitkSegWithPreviewToolGUIBase::InitializeUI
virtual void InitializeUI(QBoxLayout *mainLayout)
MitkSegmentationUIExports.h
mitkIPreferences.h
QmitkMedSAMToolGUI
GUI for mitk::MedSAMTool.
Definition: QmitkMedSAMToolGUI.h:26
mitk::IPreferences
Interface to application preferences.
Definition: mitkIPreferences.h:50