Medical Imaging Interaction Toolkit  2023.04.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 
37 {
38  Q_OBJECT
39 
40 public:
41  QmitkMAPAlgorithmModel(QObject *parent = nullptr);
43 
44  void SetAlgorithm(map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
45  void SetAlgorithm(map::algorithm::facet::MetaPropertyAlgorithmInterface *pMetaInterface);
46 
47  Qt::ItemFlags flags(const QModelIndex &index) const override;
48  QVariant data(const QModelIndex &index, int role) const override;
49  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
50  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
51  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
52  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
53 
54 private:
55  void UpdateMetaProperties() const;
56 
61  QVariant GetPropertyValue(const map::algorithm::MetaPropertyInfo *pInfo, int role) const;
62 
63  template <typename TValueType>
64  bool CheckCastAndSetProp(const map::algorithm::MetaPropertyInfo *pInfo, const QVariant &value);
65 
66  bool SetPropertyValue(const map::algorithm::MetaPropertyInfo *pInfo, const QVariant &value);
67 
68  map::algorithm::facet::MetaPropertyAlgorithmInterface *m_pMetaInterface;
69  mutable map::algorithm::facet::MetaPropertyAlgorithmInterface::MetaPropertyVectorType m_MetaProperties;
70 };
71 
72 #endif
QmitkMAPAlgorithmModel::~QmitkMAPAlgorithmModel
~QmitkMAPAlgorithmModel() override
Definition: QmitkMAPAlgorithmModel.h:42
QmitkMAPAlgorithmModel
Definition: QmitkMAPAlgorithmModel.h:36
MITKMATCHPOINTREGISTRATIONUI_EXPORT
#define MITKMATCHPOINTREGISTRATIONUI_EXPORT
Definition: MitkMatchPointRegistrationUIExports.h:15
MitkMatchPointRegistrationUIExports.h