Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkAlgorithmSettingsConfig.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 
14 
15 #include <mapConvert.h>
16 #include <mapMetaPropertyAccessor.h>
17 
19 {
20  this->setupUi(this);
21 
23  m_ProxyModel = new QSortFilterProxyModel(this);
24 
25  // configure property model/view/widget
26  m_ProxyModel->setSourceModel(m_AlgorithmModel);
27  m_ProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
28  m_ProxyModel->setDynamicSortFilter(true);
29 
30  this->m_AlgoPropertiesView->setModel(m_ProxyModel);
31  this->m_AlgoPropertiesView->setSortingEnabled(true);
32  this->m_AlgoPropertiesView->setAlternatingRowColors(true);
33  this->m_AlgoPropertiesView->setSelectionMode(QAbstractItemView::SingleSelection);
34  this->m_AlgoPropertiesView->setSelectionBehavior(QAbstractItemView::SelectItems);
35 }
36 
37 void setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg);
38 
39 map::algorithm::RegistrationAlgorithmBase *getAlgorithm();
40 
41 void QmitkAlgorithmSettingsConfig::setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg)
42 {
43  if (alg != this->m_currentAlg)
44  {
45  this->m_currentAlg = alg;
47 
48  this->m_AlgoPropertiesView->setWindowModified(true);
49  this->m_AlgoPropertiesView->update();
50  }
51 }
52 
53 map::algorithm::RegistrationAlgorithmBase *QmitkAlgorithmSettingsConfig::getAlgorithm()
54 {
55  return this->m_currentAlg;
56 }
QmitkAlgorithmSettingsConfig(QWidget *parent=nullptr)
map::algorithm::RegistrationAlgorithmBase * getAlgorithm()
map::algorithm::RegistrationAlgorithmBase::Pointer m_currentAlg
void setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg)
Changes the current algorithm and updates widget accordingly.
QmitkMAPAlgorithmModel * m_AlgorithmModel
void SetAlgorithm(map::algorithm::RegistrationAlgorithmBase *pAlgorithm)