Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 
30 class MITKMODELFITUI_EXPORT QmitkFitParameterModel : public QAbstractTableModel
31 {
32  Q_OBJECT
33 
34 public:
35  using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
36 
37  QmitkFitParameterModel(QObject* parent = nullptr);
38  ~QmitkFitParameterModel() override {};
39 
40  const FitVectorType& getFits() const;
41 
42  mitk::Point3D getCurrentPosition() const;
43 
44  const mitk::PointSet* getPositionBookmarks() const;
45 
46  Qt::ItemFlags flags(const QModelIndex& index) const override;
47  QVariant data(const QModelIndex& index, int role) const override;
48  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
49  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
50  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
51  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
52 
53 public Q_SLOTS:
54 
55  void setFits(const FitVectorType& fits);
56 
57  void setCurrentPosition(const mitk::Point3D& currentPos);
58 
59  void setPositionBookmarks(const mitk::PointSet* bookmarks);
60 
61 
62 protected:
63 
64  std::size_t getBookmarksCount() const;
65 
66 private:
67 
68  bool hasSingleFit() const;
69 
70  FitVectorType m_Fits;
71  mitk::PointSet::ConstPointer m_Bookmarks;
72  mitk::Point3D m_CurrentPos;
73 
74 };
75 
76 #endif
QmitkFitParameterModel
Definition: QmitkFitParameterModel.h:30
MITKMODELFITUI_EXPORT
#define MITKMODELFITUI_EXPORT
Definition: MitkModelFitUIExports.h:15
itk::SmartPointer< const Self >
mitkPointSet.h
QmitkFitParameterModel::~QmitkFitParameterModel
~QmitkFitParameterModel() override
Definition: QmitkFitParameterModel.h:38
mitk::Point< ScalarType, 3 >
mitkModelFitInfo.h
MitkModelFitUIExports.h
QmitkFitParameterModel::FitVectorType
std::vector< mitk::modelFit::ModelFitInfo::ConstPointer > FitVectorType
Definition: QmitkFitParameterModel.h:35
mitk::PointSet
Data structure which stores a set of points.
Definition: mitkPointSet.h:71