Medical Imaging Interaction Toolkit  2025.12.02
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 #include "ui_QmitkMonaiLabelToolGUIControls.h"
19 #include <QMessageBox>
20 #include <mitkIPreferences.h>
21 #include <mitkMonaiLabelTool.h>
22 #include <QMap>
23 
25 {
26  Q_OBJECT
27 
28 public:
30  itkCloneMacro(Self);
31 
32 protected slots:
33 
36  void OnModelChanged(const QString &);
37 
38 protected:
39  QmitkMonaiLabelToolGUI(int dimension);
41 
42  void ConnectNewTool(mitk::SegWithPreviewTool *newTool) override;
43  void InitializeUI(QBoxLayout *mainLayout) override;
44 
45  void EnableWidgets(bool enabled) override;
46 
47  virtual void DisplayWidgets(bool enabled);
48 
52  void WriteStatusMessage(const QString &);
53 
57  void WriteErrorMessage(const QString &);
58 
62  void ShowErrorMessage(const std::string &message);
63 
67  void StatusMessageListener(const bool status);
68 
73 
77  void PopulateModelBox(QString appName, std::vector<mitk::MonaiModelInfo> models, bool allowAllModels);
78 
82  void PopulateUI(bool allowAllModels);
83 
84 private:
85  mitk::IPreferences *m_Preferences;
86  Ui_QmitkMonaiLabelToolGUIControls m_Controls;
87  bool m_FirstPreviewComputation = true;
88  EnableConfirmSegBtnFunctionType m_SuperclassEnableConfirmSegBtnFnc;
89  int m_Dimension;
90 };
91 
92 #endif
#define MITKSEGMENTATIONUI_EXPORT
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.