Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
QmitkDataSelectionWidget.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 QmitkDataSelectionWidget_h
14 #define QmitkDataSelectionWidget_h
15 
17 
18 #include <ui_QmitkDataSelectionWidgetControls.h>
19 #include <mitkDataNode.h>
20 #include <mitkDataStorage.h>
21 #include <mitkWeakPointer.h>
22 
23 #include <vector>
24 
25 namespace mitk
26 {
27  class NodePredicateBase;
28 }
29 
31 
33 {
34  Q_OBJECT
35 
36 public:
37  enum Predicate
38  {
44  SegmentationOrSurfacePredicate
45  };
46 
47  explicit QmitkDataSelectionWidget(QWidget* parent = nullptr);
48  ~QmitkDataSelectionWidget() override;
49 
50  unsigned int AddDataSelection(Predicate predicate);
51  unsigned int AddDataSelection(mitk::NodePredicateBase* predicate = nullptr);
52  unsigned int AddDataSelection(const QString &labelText, const QString &info, const QString &popupTitel, const QString &popupHint, Predicate predicate);
53  unsigned int AddDataSelection(const QString &labelText, const QString &info, const QString &popupTitel, const QString &popupHint, mitk::NodePredicateBase* predicate = nullptr);
54 
55  void SetDataStorage(mitk::DataStorage* dataStorage);
56  mitk::DataStorage::Pointer GetDataStorage() const;
57  mitk::DataNode::Pointer GetSelection(unsigned int index);
58  void SetPredicate(unsigned int index, Predicate predicate);
59  void SetPredicate(unsigned int index, const mitk::NodePredicateBase* predicate);
60  const mitk::NodePredicateBase *GetPredicate(unsigned int index) const;
61  void SetHelpText(const QString& text);
62 
63 signals:
64  void SelectionChanged(unsigned int index, const mitk::DataNode* selection);
65 
66 private slots:
67  void OnSelectionChanged(QList<mitk::DataNode::Pointer> selection);
68 
69 private:
70  Ui::QmitkDataSelectionWidgetControls m_Controls;
72  std::vector<QmitkSingleNodeSelectionWidget*> m_NodeSelectionWidgets;
73 };
74 
75 #endif
QmitkDataSelectionWidget
Definition: QmitkDataSelectionWidget.h:32
QmitkDataSelectionWidget::ImagePredicate
@ ImagePredicate
Definition: QmitkDataSelectionWidget.h:39
MITKSEGMENTATIONUI_EXPORT
#define MITKSEGMENTATIONUI_EXPORT
Definition: MitkSegmentationUIExports.h:15
QmitkDataSelectionWidget::Predicate
Predicate
Definition: QmitkDataSelectionWidget.h:37
mitkDataStorage.h
QmitkDataSelectionWidget::SegmentationPredicate
@ SegmentationPredicate
Definition: QmitkDataSelectionWidget.h:40
itk::SmartPointer< Self >
mitk::NodePredicateBase
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
Definition: mitkNodePredicateBase.h:35
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitkDataNode.h
QmitkDataSelectionWidget::ContourModelPredicate
@ ContourModelPredicate
Definition: QmitkDataSelectionWidget.h:43
QmitkDataSelectionWidget::ImageAndSegmentationPredicate
@ ImageAndSegmentationPredicate
Definition: QmitkDataSelectionWidget.h:42
mitkWeakPointer.h
MitkSegmentationUIExports.h
QmitkSingleNodeSelectionWidget
Widget that represents a node selection of (max) one node. It acts like a button. Clicking on it allo...
Definition: QmitkSingleNodeSelectionWidget.h:40
QmitkDataSelectionWidget::SurfacePredicate
@ SurfacePredicate
Definition: QmitkDataSelectionWidget.h:41
mitk::WeakPointer< mitk::DataStorage >
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63