Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (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 <QmitkMappingJob.h>
16 
17 QmitkMapperSettingsWidget::QmitkMapperSettingsWidget(QWidget *parent) : QWidget(parent), m_MaskMode(false), m_allowSampling(true)
18 {
19  this->setupUi(this);
20 
21  connect(m_cbLinkFactors, SIGNAL(clicked()), this, SLOT(OnLinkSampleFactorChecked()));
22  connect(m_sbXFactor, SIGNAL(valueChanged(double)), this, SLOT(OnXFactorChanged(double)));
23 }
24 
26 {
27  if (!settings)
28  {
29  return;
30  }
31 
32  settings->m_allowUndefPixels = m_groupAllowUndefPixels->isChecked();
33  settings->m_paddingValue = m_sbPaddingValue->value();
34  settings->m_allowUnregPixels = m_groupAllowUnregPixels->isChecked();
35  settings->m_errorValue = m_sbErrorValue->value();
36  settings->m_InterpolatorLabel = m_comboInterpolator->currentText().toStdString();
37 
38  switch (m_comboInterpolator->currentIndex())
39  {
40  case 0:
42  break;
43 
44  case 1:
46  break;
47 
48  case 2:
50  break;
51 
52  case 3:
54  break;
55 
56  case 4:
58  break;
59  }
60 }
61 
63 {
64  if (m_cbLinkFactors->isChecked())
65  {
66  this->m_sbYFactor->setValue(d);
67  this->m_sbZFactor->setValue(d);
68  }
69 }
70 
72 {
73  this->m_sbYFactor->setEnabled(!(this->m_cbLinkFactors->isChecked()));
74  this->m_sbZFactor->setEnabled(!(this->m_cbLinkFactors->isChecked()));
75 
76  if (m_cbLinkFactors->isChecked())
77  {
78  this->m_sbYFactor->setValue(this->m_sbXFactor->value());
79  this->m_sbZFactor->setValue(this->m_sbXFactor->value());
80  }
81 }
82 
84 {
85  if (activeMask != m_MaskMode)
86  {
87  if (activeMask)
88  {
89  this->m_comboInterpolator->setCurrentIndex(0);
90  this->m_sbErrorValue->setValue(0);
91  this->m_sbPaddingValue->setValue(0);
92  }
93  else
94  {
95  this->m_comboInterpolator->setCurrentIndex(1);
96  }
97  }
98 
99  m_MaskMode = activeMask;
100 }
101 
103 {
104  m_allowSampling = allow;
105  m_groupActivateSampling->setVisible(allow);
106 }
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)
QmitkMapperSettingsWidget(QWidget *parent=nullptr)
std::string m_InterpolatorLabel
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 (...