Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkInitialValuesModel.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 QmitkInitialValuesModel_h
14 #define QmitkInitialValuesModel_h
15 
16 #include <QAbstractTableModel>
17 
20 #include "mitkDataNode.h"
22 
23 #include "MitkModelFitUIExports.h"
24 
25 
30 class MITKMODELFITUI_EXPORT QmitkInitialValuesModel : public QAbstractTableModel
31 {
32  Q_OBJECT
33 
34 public:
35  QmitkInitialValuesModel(QObject* parent = nullptr);
36  ~QmitkInitialValuesModel() override {};
37 
42  void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names,
46  void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names);
47 
56  void addInitialParameterImage(const mitk::DataNode* node, mitk::ModelTraitsInterface::ParametersType::size_type paramIndex);
57 
58  bool hasValidInitialValues() const;
59 
60  void resetInitialParameterImage();
61 
63  mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const;
67  mitk::ModelTraitsInterface::ParametersType getInitialValues() const;
68 
69  Qt::ItemFlags flags(const QModelIndex& index) const override;
70  QVariant data(const QModelIndex& index, int role) const override;
71  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
72  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
73  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
74  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
75 
77  bool isModified();
78 
79 private:
80  int valueType(const QModelIndex& index) const;
81 
84 
85  typedef std::map<mitk::ModelTraitsInterface::ParametersType::size_type, mitk::DataNode::ConstPointer> ImageMapType;
86  ImageMapType m_ParameterImageMap;
87 
89  bool m_modified;
90 
91 };
92 
93 #endif
mitkModelTraitsInterface.h
mitkSimpleBarrierConstraintChecker.h
MITKMODELFITUI_EXPORT
#define MITKMODELFITUI_EXPORT
Definition: MitkModelFitUIExports.h:15
itk::SmartPointer< Self >
QmitkInitialValuesModel::~QmitkInitialValuesModel
~QmitkInitialValuesModel() override
Definition: QmitkInitialValuesModel.h:36
mitk::ModelTraitsInterface::ParameterNamesType
std::vector< ParameterNameType > ParameterNamesType
Definition: mitkModelTraitsInterface.h:34
QmitkInitialValuesModel
Definition: QmitkInitialValuesModel.h:30
mitkDataNode.h
MitkModelFitUIExports.h
mitk::ModelTraitsInterface::ParametersType
itk::Array< ParameterValueType > ParametersType
Definition: mitkModelTraitsInterface.h:31
mitkInitialParameterizationDelegateBase.h
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63