Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 
43  void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names,
48  void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names);
49 
58  void addInitialParameterImage(const mitk::DataNode* node, mitk::ModelTraitsInterface::ParametersType::size_type paramIndex);
59 
60  bool hasValidInitialValues() const;
61 
62  void resetInitialParameterImage();
63 
65  mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const;
69  mitk::ModelTraitsInterface::ParametersType getInitialValues() const;
70 
71 
72  Qt::ItemFlags flags(const QModelIndex& index) const override;
73  QVariant data(const QModelIndex& index, int role) const override;
74  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
75  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
76  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
77  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
78 
80  bool isModified();
81 
82 private:
83  int valueType(const QModelIndex& index) const;
84 
88 
89  typedef std::map<mitk::ModelTraitsInterface::ParametersType::size_type, mitk::DataNode::ConstPointer> ImageMapType;
90  ImageMapType m_ParameterImageMap;
91 
93  bool m_modified;
94 
95 };
96 
97 #endif
mitk::ModelTraitsInterface::ParamterUnitMapType
std::map< ParameterNameType, std::string > ParamterUnitMapType
Definition: mitkModelTraitsInterface.h:40
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