Medical Imaging Interaction Toolkit  2022.04.99-3f7a773b
Medical Imaging Interaction Toolkit
QmitkAbstractSemanticRelationsStorageModel.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 QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H
14 #define QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H
15 
16 // mitk semantic relations UI
18 
19 // semantic relations module
23 #include <mitkSemanticTypes.h>
24 
25 // qt widgets module
27 
28 /*
29 * @brief The QmitkAbstractSemanticRelationsStorageModel is a subclass of 'QmitkAbstractDataStorageModel' and provides additional
30 * functionality to set and store a semantic relations instance, the current case ID and the current lesion.
31 */
33 {
34  Q_OBJECT
35 
36 public:
37 
38  QmitkAbstractSemanticRelationsStorageModel(QObject* parent = nullptr);
40 
41  /*
42  * @brief Update this model with the data from the semantic relations,
43  * if the case ID is equal to the currently selected case ID of the table model.
44  *
45  * Overridden from 'ISemanticRelationsObserver'.
46  * In order for the Update-function to be called, this model has to be added as an observer of SemanticRelation
47  * (e.g. m_SemanticRelations->AddObserver(m_SemanticRelationsStorageModel);)
48  *
49  * @par caseID The current case ID to identify the currently active patient / case.
50  */
51  void Update(const mitk::SemanticTypes::CaseID& caseID) override;
52 
58  void SetCaseID(const mitk::SemanticTypes::CaseID& caseID);
59 
60  const mitk::SemanticTypes::CaseID& GetCaseID() const { return m_CaseID; }
66  void SetLesion(const mitk::SemanticTypes::Lesion& lesion);
67 
68  const mitk::SemanticTypes::Lesion& GetLesion() const { return m_Lesion; }
75  void SetDataNodeSelection(const QList<mitk::DataNode::Pointer>& dataNodeSelection);
76 
77  const QList<mitk::DataNode::Pointer>& GetSelectedDataNodes() const { return m_SelectedDataNodes; };
78  /*
79  * @brief Update the semantic relations storage model with the current data from the semantic relations model
80  * and the current case ID.
81  */
82  void UpdateModelData();
83 
84 Q_SIGNALS:
85  void ModelUpdated();
86 
87 protected:
88 
94  void DataStorageChanged() override;
95 
101  virtual void SetData() = 0;
102 
103  std::unique_ptr<mitk::SemanticRelationsDataStorageAccess> m_SemanticRelationsDataStorageAccess;
104  std::unique_ptr<mitk::SemanticRelationsIntegration> m_SemanticRelationsIntegration;
105 
107  QList<mitk::DataNode::Pointer> m_SelectedDataNodes;
109 };
110 
111 #endif // QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H
virtual void DataStorageChanged()=0
std::unique_ptr< mitk::SemanticRelationsDataStorageAccess > m_SemanticRelationsDataStorageAccess
std::unique_ptr< mitk::SemanticRelationsIntegration > m_SemanticRelationsIntegration
const QList< mitk::DataNode::Pointer > & GetSelectedDataNodes() const
#define MITKSEMANTICRELATIONSUI_EXPORT
virtual void Update(const mitk::SemanticTypes::CaseID &caseID)=0