Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 #include <mapConvert.h>
20 #include <mapMetaPropertyAccessor.h>
21 
23 {
24  this->setupUi(this);
25 
27  m_ProxyModel = new QSortFilterProxyModel(this);
28 
29  // configure property model/view/widget
30  m_ProxyModel->setSourceModel(m_AlgorithmModel);
31  m_ProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
32  m_ProxyModel->setDynamicSortFilter(true);
33 
34  this->m_AlgoPropertiesView->setModel(m_ProxyModel);
35  this->m_AlgoPropertiesView->setSortingEnabled(true);
36  this->m_AlgoPropertiesView->setAlternatingRowColors(true);
37  this->m_AlgoPropertiesView->setSelectionMode(QAbstractItemView::SingleSelection);
38  this->m_AlgoPropertiesView->setSelectionBehavior(QAbstractItemView::SelectItems);
39 }
40 
41 void setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg);
42 
43 map::algorithm::RegistrationAlgorithmBase *getAlgorithm();
44 
45 void QmitkAlgorithmSettingsConfig::setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg)
46 {
47  if (alg != this->m_currentAlg)
48  {
49  this->m_currentAlg = alg;
51 
52  this->m_AlgoPropertiesView->setWindowModified(true);
53  this->m_AlgoPropertiesView->update();
54  }
55 }
56 
57 map::algorithm::RegistrationAlgorithmBase *QmitkAlgorithmSettingsConfig::getAlgorithm()
58 {
59  return this->m_currentAlg;
60 }
map::algorithm::RegistrationAlgorithmBase * getAlgorithm()
void setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg)
map::algorithm::RegistrationAlgorithmBase * getAlgorithm()
void setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg)
Changes the current algorithm and updates widget accordingly.
void SetAlgorithm(map::algorithm::RegistrationAlgorithmBase *pAlgorithm)