Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkFindSegmentationTaskDialog.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 QmitkFindSegmentationTaskDialog_h
14 #define QmitkFindSegmentationTaskDialog_h
15 
16 #include <QDialog>
18 #include <memory>
19 
20 class QTableWidgetItem;
21 
22 namespace Ui
23 {
25 }
26 
33 class QmitkFindSegmentationTaskDialog : public QDialog
34 {
35  Q_OBJECT
36 
37 public:
42  explicit QmitkFindSegmentationTaskDialog(QWidget* parent = nullptr);
44 
49  void SetTaskList(const mitk::SegmentationTaskList* taskList);
50 
52  std::optional<size_t> GetSelectedTask() const;
53 
55  bool LoadSelectedTask() const;
56 
57 private:
58  enum Column
59  {
60  Number,
61  Name,
62  Status,
63  Image,
64  Segmentation,
65  Result,
66  Description
67  };
68 
69  void OnItemSelectionChanged();
70  void OnItemDoubleClicked(QTableWidgetItem* item);
71  void OnFinished(int result);
72 
73  void ApplyFilter();
74  bool ContainsNumber(int row) const;
75  bool ContainsName(int row) const;
76  bool HasStatus(int row) const;
77 
78  std::unique_ptr<Ui::QmitkFindSegmentationTaskDialog> m_Ui;
79  mitk::SegmentationTaskList::ConstPointer m_TaskList;
80  std::optional<size_t> m_SelectedTask;
81 };
82 
83 #endif
Dialog for finding and selecting a segmentation task from a task list.
void SetTaskList(const mitk::SegmentationTaskList *taskList)
Set the task list to display in the dialog.
std::optional< size_t > GetSelectedTask() const
Return the index of the selected task, or std::nullopt if none is selected.
bool LoadSelectedTask() const
Return true if the selected task should be loaded immediately.
QmitkFindSegmentationTaskDialog(QWidget *parent=nullptr)
Construct the find task dialog.
A list of segmentation tasks.