Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkAbstractSemanticRelationsStorageModel.cpp
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 // semantic relations UI module
15 
16 #include "QmitkCustomVariants.h"
17 
20  , m_SemanticRelationsDataStorageAccess(nullptr)
21 {
22  m_SemanticRelationsIntegration = std::make_unique<mitk::SemanticRelationsIntegration>();
23  m_SemanticRelationsIntegration->AddObserver(this);
24 }
25 
27 {
28  if (nullptr != m_SemanticRelationsIntegration)
29  {
30  m_SemanticRelationsIntegration->RemoveObserver(this);
31  }
32 }
33 
35 {
36  // if the case ID of updated instance is equal to the currently active caseID
37  if (caseID == m_CaseID)
38  {
40  }
41 }
42 
44 {
45  m_CaseID = caseID;
47 }
48 
50 {
51  m_Lesion = lesion;
53 }
54 
55 void QmitkAbstractSemanticRelationsStorageModel::SetDataNodeSelection(const QList<mitk::DataNode::Pointer>& dataNodeSelection)
56 {
57  m_SelectedDataNodes = dataNodeSelection;
59 }
60 
62 {
64  {
65  return;
66  }
67 
68  // update the model, so that the table will be filled with the new patient information
69  beginResetModel();
70 
71  SetData();
72 
73  endResetModel();
74  emit ModelUpdated();
75 }
76 
78 {
79  m_SemanticRelationsDataStorageAccess = std::make_unique<mitk::SemanticRelationsDataStorageAccess>(m_DataStorage.Lock());
81 }
itk::SmartPointer< T > Lock() const
virtual void SetData()=0
This function is called if the model data is updated. It can be used by subclasses to define the way ...
void SetCaseID(const mitk::SemanticTypes::CaseID &caseID)
Set the current case ID which is needed to access the semantic relations storage. ...
std::unique_ptr< mitk::SemanticRelationsDataStorageAccess > m_SemanticRelationsDataStorageAccess
std::unique_ptr< mitk::SemanticRelationsIntegration > m_SemanticRelationsIntegration
void Update(const mitk::SemanticTypes::CaseID &caseID) override
void DataStorageChanged() override
Create a new &#39;SemanticRelationsDataStorageAccess&#39; instance with the new data storage and update the m...
void SetDataNodeSelection(const QList< mitk::DataNode::Pointer > &dataNodeSelection)
Set the current data node selection which can be used to show which lesions are visible on the node s...
void SetLesion(const mitk::SemanticTypes::Lesion &lesion)
Set the current lesion which can be used to show on which images the lesion is visible.
mitk::WeakPointer< mitk::DataStorage > m_DataStorage