Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkPatientTableModel.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 QmitkPatientTableModel_h
14 #define QmitkPatientTableModel_h
15 
16 // semantic relations UI module
18 
19 // semantic relations module
20 #include <mitkSemanticTypes.h>
22 
23 // mitk core
24 #include <mitkDataNode.h>
25 
26 // qt
27 #include <QPixmap>
28 #include <QStandardItemModel>
29 
40 {
41  Q_OBJECT
42 
43 public:
44 
45  QmitkPatientTableModel(QObject* parent = nullptr);
46  ~QmitkPatientTableModel() override;
47 
49  // overridden functions from QAbstractItemModel
51  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
52  QModelIndex parent(const QModelIndex& child) const override;
53 
54  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
55  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
56 
57  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
58 
59  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
60  Qt::ItemFlags flags(const QModelIndex& index) const override;
64 
65  void SetNodeType(const std::string& nodeType);
66 
67 protected:
68 
69  // the following functions have to be overridden...
70  void NodePredicateChanged() override;
71  // but are not implemented in this model
72  void NodeAdded(const mitk::DataNode*) override { }
73  void NodeChanged(const mitk::DataNode*) override { }
74  void NodeRemoved(const mitk::DataNode*) override { }
80  void SetData() override;
81 
82 private:
83 
84  void SetHeaderModel();
85  void SetPixmaps();
86  void SetLesionPresences();
87 
96  void SetPixmapOfNode(const mitk::DataNode* dataNode, QPixmap* pixmapFromImage);
106  void SetLesionPresenceOfNode(const mitk::DataNode* dataNode, bool lesionPresence);
116  mitk::DataNode* GetCurrentDataNode(const QModelIndex &index) const;
117 
118  std::map<mitk::DataNode::ConstPointer, QPixmap> m_PixmapMap;
119  std::map<mitk::DataNode::ConstPointer, bool> m_LesionPresence;
120 
124  std::string m_SelectedNodeType;
125 
126  QStandardItemModel* m_HeaderModel;
127 };
128 
129 #endif
QmitkPatientTableModel::QmitkPatientTableModel
QmitkPatientTableModel(QObject *parent=nullptr)
QmitkPatientTableModel::~QmitkPatientTableModel
~QmitkPatientTableModel() override
QmitkPatientTableModel::NodePredicateChanged
void NodePredicateChanged() override
QmitkPatientTableModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
mitkSemanticTypes.h
QmitkPatientTableModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QmitkAbstractSemanticRelationsStorageModel.h
QmitkPatientTableModel::SetNodeType
void SetNodeType(const std::string &nodeType)
end override
QmitkPatientTableModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
mitk::SemanticTypes::InformationTypeVector
std::vector< InformationType > InformationTypeVector
Definition: mitkSemanticTypes.h:120
QmitkPatientTableModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QmitkPatientTableModel::SetData
void SetData() override
Overridden from 'QmitkAbstractSemanticRelationsStorageModel': This function retrieves all control poi...
QmitkPatientTableModel::NodeRemoved
void NodeRemoved(const mitk::DataNode *) override
Definition: QmitkPatientTableModel.h:74
QmitkPatientTableModel::parent
QModelIndex parent(const QModelIndex &child) const override
QmitkPatientTableModel::NodeAdded
void NodeAdded(const mitk::DataNode *) override
Definition: QmitkPatientTableModel.h:72
QmitkPatientTableModel
The QmitkPatientTableModel is a subclass of the QmitkAbstractSemanticRelationsStorageModel and holds ...
Definition: QmitkPatientTableModel.h:39
QmitkPatientTableModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
QmitkPatientTableModel::NodeChanged
void NodeChanged(const mitk::DataNode *) override
Definition: QmitkPatientTableModel.h:73
mitkDataNode.h
QmitkPatientTableModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
mitk::SemanticRelationsDataStorageAccess::DataNodeVector
std::vector< DataNode::Pointer > DataNodeVector
Definition: mitkSemanticRelationsDataStorageAccess.h:43
QmitkAbstractSemanticRelationsStorageModel
Definition: QmitkAbstractSemanticRelationsStorageModel.h:32
mitkSemanticRelationsDataStorageAccess.h
mitk::SemanticTypes::ExaminationPeriodVector
std::vector< ExaminationPeriod > ExaminationPeriodVector
Definition: mitkSemanticTypes.h:119
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63