Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkFitParameterModel.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 QmitkFitParameterModel_h
14 #define QmitkFitParameterModel_h
15 
16 #include <QAbstractTableModel>
17 
18 #include <mitkModelFitInfo.h>
19 #include <mitkPointSet.h>
20 
21 #include <MitkModelFitUIExports.h>
22 
23 
40 class MITKMODELFITUI_EXPORT QmitkFitParameterModel : public QAbstractTableModel
41 {
42  Q_OBJECT
43 
44 public:
46  using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
47 
52  QmitkFitParameterModel(QObject* parent = nullptr);
53 
55  ~QmitkFitParameterModel() override {};
56 
61  const FitVectorType& getFits() const;
62 
68 
74 
80  Qt::ItemFlags flags(const QModelIndex& index) const override;
81 
94  QVariant data(const QModelIndex& index, int role) const override;
95 
107  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
108 
119  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
120 
129  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
130 
138  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
139 
140 public Q_SLOTS:
141 
149  void setFits(const FitVectorType& fits);
150 
158  void setCurrentPosition(const mitk::Point3D& currentPos);
159 
168  void setPositionBookmarks(const mitk::PointSet* bookmarks);
169 
170 
171 protected:
172 
173  std::size_t getBookmarksCount() const;
174 
175 private:
176 
177  bool hasSingleFit() const;
178 
179  FitVectorType m_Fits;
180  mitk::PointSet::ConstPointer m_Bookmarks;
181  mitk::Point3D m_CurrentPos;
182 
183 };
184 
185 #endif
#define MITKMODELFITUI_EXPORT
Qt table model for displaying parameter values of model fit results at various world positions.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows in the model.
std::size_t getBookmarksCount() const
const mitk::PointSet * getPositionBookmarks() const
Returns the point set used as position bookmarks.
const FitVectorType & getFits() const
Returns the currently set model fit info instances.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns in the model.
mitk::Point3D getCurrentPosition() const
Returns the current world coordinate position used for value lookup.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns item flags for the given model index.
void setFits(const FitVectorType &fits)
Sets the model fit info instances to display.
QVariant data(const QModelIndex &index, int role) const override
Returns data for the given index and role.
~QmitkFitParameterModel() override
Destructor.
void setCurrentPosition(const mitk::Point3D &currentPos)
Sets the current world coordinate position for parameter value lookup.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets data for a given index (currently always returns false; model is read-only).
std::vector< mitk::modelFit::ModelFitInfo::ConstPointer > FitVectorType
Vector type holding const pointers to ModelFitInfo instances.
QmitkFitParameterModel(QObject *parent=nullptr)
Constructs a QmitkFitParameterModel.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Returns header data for the specified section, orientation, and role.
void setPositionBookmarks(const mitk::PointSet *bookmarks)
Sets the point set used as position bookmarks.
Data structure which stores a set of points.
Definition: mitkPointSet.h:71