Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkMAPAlgorithmModel.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 QmitkMAPAlgorithmModel_h
14 #define QmitkMAPAlgorithmModel_h
15 
16 #include <QAbstractTableModel>
17 #include <QStringList>
18 
19 // MITK
21 
22 // MatchPoint
23 #include <mapMetaPropertyAlgorithmInterface.h>
24 #include <mapRegistrationAlgorithmBase.h>
25 
47 {
48  Q_OBJECT
49 
50 public:
55  QmitkMAPAlgorithmModel(QObject *parent = nullptr);
56 
59 
68  void SetAlgorithm(map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
69 
77  void SetAlgorithm(map::algorithm::facet::MetaPropertyAlgorithmInterface *pMetaInterface);
78 
88  Qt::ItemFlags flags(const QModelIndex &index) const override;
89 
100  QVariant data(const QModelIndex &index, int role) const override;
101 
113  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
114 
120  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
121 
127  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
128 
141  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
142 
143 private:
144  void UpdateMetaProperties() const;
145 
150  QVariant GetPropertyValue(const map::algorithm::MetaPropertyInfo *pInfo, int role) const;
151 
152  template <typename TValueType>
153  bool CheckCastAndSetProp(const map::algorithm::MetaPropertyInfo *pInfo, const QVariant &value);
154 
155  bool SetPropertyValue(const map::algorithm::MetaPropertyInfo *pInfo, const QVariant &value);
156 
157  map::algorithm::facet::MetaPropertyAlgorithmInterface *m_pMetaInterface;
158  mutable map::algorithm::facet::MetaPropertyAlgorithmInterface::MetaPropertyVectorType m_MetaProperties;
159 };
160 
161 #endif
#define MITKMATCHPOINTREGISTRATIONUI_EXPORT
Qt table model exposing the meta-properties of a MatchPoint registration algorithm.
void SetAlgorithm(map::algorithm::RegistrationAlgorithmBase *pAlgorithm)
Sets the algorithm whose meta-properties should be displayed.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns in the model.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows (meta-properties) in the model.
QVariant data(const QModelIndex &index, int role) const override
Returns data for the given model index and role.
QmitkMAPAlgorithmModel(QObject *parent=nullptr)
Constructs the algorithm model.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns item flags for the given model index.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets a property value at the given index.
void SetAlgorithm(map::algorithm::facet::MetaPropertyAlgorithmInterface *pMetaInterface)
Sets the meta-property interface directly as data source.
~QmitkMAPAlgorithmModel() override
Destructor.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Returns header data for the table columns.