Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkMapperSettingsWidget.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 <QmitkMappingJob.h>
20 
21 QmitkMapperSettingsWidget::QmitkMapperSettingsWidget(QWidget *) : m_MaskMode(false), m_allowSampling(true)
22 {
23  this->setupUi(this);
24 
25  connect(m_cbLinkFactors, SIGNAL(clicked()), this, SLOT(OnLinkSampleFactorChecked()));
26  connect(m_sbXFactor, SIGNAL(valueChanged(double)), this, SLOT(OnXFactorChanged(double)));
27 }
28 
30 {
31  if (!settings)
32  {
33  return;
34  }
35 
36  settings->m_allowUndefPixels = m_groupAllowUndefPixels->isChecked();
37  settings->m_paddingValue = m_sbPaddingValue->value();
38  settings->m_allowUnregPixels = m_groupAllowUnregPixels->isChecked();
39  settings->m_errorValue = m_sbErrorValue->value();
40  settings->m_InterpolatorLabel = m_comboInterpolator->currentText().toStdString();
41 
42  switch (m_comboInterpolator->currentIndex())
43  {
44  case 0:
46  break;
47 
48  case 1:
50  break;
51 
52  case 2:
54  break;
55 
56  case 3:
58  break;
59 
60  case 4:
62  break;
63  }
64 }
65 
67 {
68  if (m_cbLinkFactors->isChecked())
69  {
70  this->m_sbYFactor->setValue(d);
71  this->m_sbZFactor->setValue(d);
72  }
73 }
74 
76 {
77  this->m_sbYFactor->setEnabled(!(this->m_cbLinkFactors->isChecked()));
78  this->m_sbZFactor->setEnabled(!(this->m_cbLinkFactors->isChecked()));
79 
80  if (m_cbLinkFactors->isChecked())
81  {
82  this->m_sbYFactor->setValue(this->m_sbXFactor->value());
83  this->m_sbZFactor->setValue(this->m_sbXFactor->value());
84  }
85 }
86 
88 {
89  if (activeMask != m_MaskMode)
90  {
91  if (activeMask)
92  {
93  this->m_comboInterpolator->setCurrentIndex(0);
94  this->m_sbErrorValue->setValue(0);
95  this->m_sbPaddingValue->setValue(0);
96  }
97  else
98  {
99  this->m_comboInterpolator->setCurrentIndex(1);
100  }
101  }
102 
103  m_MaskMode = activeMask;
104 }
105 
107 {
108  m_allowSampling = allow;
109  m_groupActivateSampling->setVisible(allow);
110 }
void SetMaskMode(bool activeMask)
Slot that can be used to set the mode for the mapping settings. Mask mode allows only nearest neighbo...
void ConfigureJobSettings(QmitkMappingJobSettings *settings)
std::string m_InterpolatorLabel
QmitkMapperSettingsWidget(QWidget *parent=0)
mitk::ImageMappingInterpolator::Type m_InterpolatorType
void AllowSampling(bool allow)
Slot that can be used to set the widget to a mode where super/sub sampling is allowed (true) or not (...