Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkMonaiLabelToolGUI.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 QmitkMonaiLabelToolGUI_h
14 #define QmitkMonaiLabelToolGUI_h
15 
17 
19 
20 #include <mitkIPreferences.h>
21 #include <mitkMonaiLabelTool.h>
22 
23 #include <QMessageBox>
24 #include <QMap>
25 #include <memory>
26 
27 namespace Ui
28 {
29  class QmitkMonaiLabelToolGUIControls;
30 }
31 
43 {
44  Q_OBJECT
45 
46 public:
48  itkCloneMacro(Self);
49 
50 protected slots:
51 
54  void OnModelChanged(const QString &);
55 
56 protected:
57  QmitkMonaiLabelToolGUI(int dimension);
59 
60  void ConnectNewTool(mitk::SegWithPreviewTool *newTool) override;
61  void InitializeUI(QBoxLayout *mainLayout) override;
62 
63  void EnableWidgets(bool enabled) override;
64 
65  virtual void DisplayWidgets(bool enabled);
66 
70  void WriteStatusMessage(const QString &);
71 
75  void WriteErrorMessage(const QString &);
76 
80  void ShowErrorMessage(const std::string &message);
81 
85  void StatusMessageListener(const bool status);
86 
91 
95  void PopulateModelBox(QString appName, std::vector<mitk::MonaiModelInfo> models, bool allowAllModels);
96 
100  void PopulateUI(bool allowAllModels);
101 
102 private:
103  mitk::IPreferences *m_Preferences;
104  std::unique_ptr<Ui::QmitkMonaiLabelToolGUIControls> m_Controls;
105  bool m_FirstPreviewComputation = true;
106  EnableConfirmSegBtnFunctionType m_SuperclassEnableConfirmSegBtnFnc;
107  int m_Dimension;
108 };
109 
110 #endif
#define MITKSEGMENTATIONUI_EXPORT
Base GUI class for MONAI Label segmentation tools.
void OnPreferenceChangedEvent(const mitk::IPreferences::ChangeEvent &event)
Function to listen to Preference changes.
void PopulateUI(bool allowAllModels)
Helper function to populate required server metadata into UI.
void OnModelChanged(const QString &)
void PopulateModelBox(QString appName, std::vector< mitk::MonaiModelInfo > models, bool allowAllModels)
Helper function to write MONAI model info in to model combo box.
void InitializeUI(QBoxLayout *mainLayout) override
QmitkMonaiLabelToolGUI(int dimension)
void EnableWidgets(bool enabled) override
virtual void DisplayWidgets(bool enabled)
void WriteStatusMessage(const QString &)
Writes any message in white on the tool pane.
void StatusMessageListener(const bool status)
Function to listen to tool class status emitters.
mitkClassMacro(QmitkMonaiLabelToolGUI, QmitkMultiLabelSegWithPreviewToolGUIBase)
void ShowErrorMessage(const std::string &message)
Creates a QMessage object and shows on screen.
void ConnectNewTool(mitk::SegWithPreviewTool *newTool) override
void WriteErrorMessage(const QString &)
Writes any message in red on the tool pane.
GUI for tools based on mitk::AutoMLSegmentationWithPreviewTool.
std::function< bool(bool)> EnableConfirmSegBtnFunctionType
Event object sent on IPreferences::OnPropertyChanged events.
Interface to application preferences.
Base class for any auto segmentation tool that provides a preview of the new segmentation.