Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkFitPlotDataModel.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 QmitkFitPlotDataModel_h
14 #define QmitkFitPlotDataModel_h
15 
16 #include <QAbstractTableModel>
17 
19 #include "MitkModelFitUIExports.h"
20 
25 class MITKMODELFITUI_EXPORT QmitkFitPlotDataModel : public QAbstractTableModel
26 {
27  Q_OBJECT
28 
29 public:
30  using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
31 
32  QmitkFitPlotDataModel(QObject* parent = nullptr);
33  ~QmitkFitPlotDataModel() override {};
34 
35  const mitk::ModelFitPlotData* GetPlotData() const;
36  const std::string& GetXName() const;
37 
38  Qt::ItemFlags flags(const QModelIndex& index) const override;
39  QVariant data(const QModelIndex& index, int role) const override;
40  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
41  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
42  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
43  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
44 
45 public Q_SLOTS:
46 
47  void SetPlotData(const mitk::ModelFitPlotData* data);
48  void SetXName(const std::string& xName);
49 
50 protected:
51  std::pair<std::string, const mitk::PlotDataCurve*> GetCurveByColumn(int col) const;
52  std::pair<bool, mitk::ModelFitPlotData::PositionalCollectionMap::value_type> GetPositionalCurvePoint(const mitk::PlotDataCurve*) const;
53 
54 private:
55  mitk::ModelFitPlotData m_PlotData;
56  std::string m_XName;
57 
58 };
59 
60 #endif
QmitkFitPlotDataModel
Definition: QmitkFitPlotDataModel.h:25
QmitkFitPlotDataModel::FitVectorType
std::vector< mitk::modelFit::ModelFitInfo::ConstPointer > FitVectorType
Definition: QmitkFitPlotDataModel.h:30
mitkModelFitPlotDataHelper.h
MITKMODELFITUI_EXPORT
#define MITKMODELFITUI_EXPORT
Definition: MitkModelFitUIExports.h:15
QmitkFitPlotDataModel::~QmitkFitPlotDataModel
~QmitkFitPlotDataModel() override
Definition: QmitkFitPlotDataModel.h:33
mitk::PlotDataCurve
Definition: mitkModelFitPlotDataHelper.h:39
MitkModelFitUIExports.h
mitk::ModelFitPlotData
Definition: mitkModelFitPlotDataHelper.h:73