Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkInitialValuesDelegate.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 QmitkInitialValuesDelegate_h
14 #define QmitkInitialValuesDelegate_h
15 
16 
18 #include <mitkDataStorage.h>
19 #include <mitkNodePredicateBase.h>
20 
21 #include <QStyledItemDelegate>
22 
23 #include <MitkModelFitUIExports.h>
24 
25 
39 class MITKMODELFITUI_EXPORT QmitkInitialValuesDelegate : public QStyledItemDelegate
40 {
41  Q_OBJECT
42 
43 public:
44 
49  QmitkInitialValuesDelegate(QObject* parent = nullptr);
50 
63  QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option
64  , const QModelIndex& index) const override;
65 
75  void setEditorData(QWidget* editor, const QModelIndex& index) const override;
76 
87  void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
88 
94 
100 
101 protected:
107  int valueType(const QModelIndex& index) const;
108 
110  mitk::DataStorage::Pointer m_Storage;
112  mitk::NodePredicateBase::Pointer m_Predicate;
113 
114 };
115 
116 #endif
#define MITKMODELFITUI_EXPORT
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Transfers data from the editor back to the model.
mitk::DataStorage::Pointer m_Storage
Data storage used as source for potential initial value images.
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populates the editor with data from the model.
void setDataStorage(mitk::DataStorage *storage)
Sets the data storage used to populate the image selection combo box.
void setNodePredicate(mitk::NodePredicateBase *predicate)
Sets the node predicate used to filter images in the data storage.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates an appropriate editor widget based on the value type.
mitk::NodePredicateBase::Pointer m_Predicate
Predicate used to filter for valid initial value images in the data storage.
QmitkInitialValuesDelegate(QObject *parent=nullptr)
Constructs a QmitkInitialValuesDelegate.
int valueType(const QModelIndex &index) const
Determines the value type for the given index.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Abstract base class for predicates used to filter DataNode objects in DataStorage queries.