19 #include <itkAmoebaOptimizer.h>
38 OptimizerPointer->SetMaximize(
m_Controls.m_Maximize->isChecked());
39 OptimizerPointer->SetParametersConvergenceTolerance(
40 m_Controls.m_ParametersConvergenceToleranceAmoeba->text().toFloat());
41 OptimizerPointer->SetFunctionConvergenceTolerance(
m_Controls.m_FunctionConvergenceToleranceAmoeba->text().toFloat());
42 typedef itk::SingleValuedNonLinearOptimizer OptimizerType;
47 simplexDelta[i] = simplexDeltaAmoeba[i + 1];
49 OptimizerPointer->AutomaticInitialSimplexOff();
50 OptimizerPointer->SetInitialSimplexDelta(simplexDelta);
51 OptimizerPointer->SetMaximumNumberOfIterations(
m_Controls.m_IterationsAmoeba->text().toInt());
52 return OptimizerPointer.GetPointer();
57 itk::Array<double> optimizerValues;
58 optimizerValues.SetSize(19);
59 optimizerValues.fill(0);
60 optimizerValues[0] =
m_Controls.m_Maximize->isChecked();
61 optimizerValues[1] =
m_Controls.m_SimplexDeltaAmoeba1->text().toDouble();
62 optimizerValues[2] =
m_Controls.m_SimplexDeltaAmoeba2->text().toDouble();
63 optimizerValues[3] =
m_Controls.m_SimplexDeltaAmoeba3->text().toDouble();
64 optimizerValues[4] =
m_Controls.m_SimplexDeltaAmoeba4->text().toDouble();
65 optimizerValues[5] =
m_Controls.m_SimplexDeltaAmoeba5->text().toDouble();
66 optimizerValues[6] =
m_Controls.m_SimplexDeltaAmoeba6->text().toDouble();
67 optimizerValues[7] =
m_Controls.m_SimplexDeltaAmoeba7->text().toDouble();
68 optimizerValues[8] =
m_Controls.m_SimplexDeltaAmoeba8->text().toDouble();
69 optimizerValues[9] =
m_Controls.m_SimplexDeltaAmoeba9->text().toDouble();
70 optimizerValues[10] =
m_Controls.m_SimplexDeltaAmoeba10->text().toDouble();
71 optimizerValues[11] =
m_Controls.m_SimplexDeltaAmoeba11->text().toDouble();
72 optimizerValues[12] =
m_Controls.m_SimplexDeltaAmoeba12->text().toDouble();
73 optimizerValues[13] =
m_Controls.m_SimplexDeltaAmoeba13->text().toDouble();
74 optimizerValues[14] =
m_Controls.m_SimplexDeltaAmoeba14->text().toDouble();
75 optimizerValues[15] =
m_Controls.m_SimplexDeltaAmoeba15->text().toDouble();
76 optimizerValues[16] =
m_Controls.m_ParametersConvergenceToleranceAmoeba->text().toFloat();
77 optimizerValues[17] =
m_Controls.m_FunctionConvergenceToleranceAmoeba->text().toFloat();
78 optimizerValues[18] =
m_Controls.m_IterationsAmoeba->text().toInt();
79 return optimizerValues;
84 m_Controls.m_Maximize->setChecked(optimizerValues[0]);
85 m_Controls.m_SimplexDeltaAmoeba1->setText(QString::number(optimizerValues[1]));
86 m_Controls.m_SimplexDeltaAmoeba2->setText(QString::number(optimizerValues[2]));
87 m_Controls.m_SimplexDeltaAmoeba3->setText(QString::number(optimizerValues[3]));
88 m_Controls.m_SimplexDeltaAmoeba4->setText(QString::number(optimizerValues[4]));
89 m_Controls.m_SimplexDeltaAmoeba5->setText(QString::number(optimizerValues[5]));
90 m_Controls.m_SimplexDeltaAmoeba6->setText(QString::number(optimizerValues[6]));
91 m_Controls.m_SimplexDeltaAmoeba7->setText(QString::number(optimizerValues[7]));
92 m_Controls.m_SimplexDeltaAmoeba8->setText(QString::number(optimizerValues[8]));
93 m_Controls.m_SimplexDeltaAmoeba9->setText(QString::number(optimizerValues[9]));
94 m_Controls.m_SimplexDeltaAmoeba10->setText(QString::number(optimizerValues[10]));
95 m_Controls.m_SimplexDeltaAmoeba11->setText(QString::number(optimizerValues[11]));
96 m_Controls.m_SimplexDeltaAmoeba12->setText(QString::number(optimizerValues[12]));
97 m_Controls.m_SimplexDeltaAmoeba13->setText(QString::number(optimizerValues[13]));
98 m_Controls.m_SimplexDeltaAmoeba14->setText(QString::number(optimizerValues[14]));
99 m_Controls.m_SimplexDeltaAmoeba15->setText(QString::number(optimizerValues[15]));
100 m_Controls.m_ParametersConvergenceToleranceAmoeba->setText(QString::number(optimizerValues[16]));
101 m_Controls.m_FunctionConvergenceToleranceAmoeba->setText(QString::number(optimizerValues[17]));
102 m_Controls.m_IterationsAmoeba->setText(QString::number(optimizerValues[18]));
108 this->ShowSimplexDelta();
119 QValidator *validatorLineEditInput =
new QIntValidator(0, 20000000,
this);
120 m_Controls.m_IterationsAmoeba->setValidator(validatorLineEditInput);
121 QValidator *validatorLineEditInputFloat =
new QDoubleValidator(0, 20000000, 8,
this);
122 m_Controls.m_SimplexDeltaAmoeba1->setValidator(validatorLineEditInputFloat);
123 m_Controls.m_SimplexDeltaAmoeba2->setValidator(validatorLineEditInputFloat);
124 m_Controls.m_SimplexDeltaAmoeba3->setValidator(validatorLineEditInputFloat);
125 m_Controls.m_SimplexDeltaAmoeba4->setValidator(validatorLineEditInputFloat);
126 m_Controls.m_SimplexDeltaAmoeba5->setValidator(validatorLineEditInputFloat);
127 m_Controls.m_SimplexDeltaAmoeba6->setValidator(validatorLineEditInputFloat);
128 m_Controls.m_SimplexDeltaAmoeba7->setValidator(validatorLineEditInputFloat);
129 m_Controls.m_SimplexDeltaAmoeba8->setValidator(validatorLineEditInputFloat);
130 m_Controls.m_SimplexDeltaAmoeba9->setValidator(validatorLineEditInputFloat);
131 m_Controls.m_SimplexDeltaAmoeba10->setValidator(validatorLineEditInputFloat);
132 m_Controls.m_SimplexDeltaAmoeba11->setValidator(validatorLineEditInputFloat);
133 m_Controls.m_SimplexDeltaAmoeba12->setValidator(validatorLineEditInputFloat);
134 m_Controls.m_SimplexDeltaAmoeba13->setValidator(validatorLineEditInputFloat);
135 m_Controls.m_SimplexDeltaAmoeba14->setValidator(validatorLineEditInputFloat);
136 m_Controls.m_SimplexDeltaAmoeba15->setValidator(validatorLineEditInputFloat);
137 m_Controls.m_ParametersConvergenceToleranceAmoeba->setValidator(validatorLineEditInputFloat);
138 m_Controls.m_FunctionConvergenceToleranceAmoeba->setValidator(validatorLineEditInputFloat);
173 void QmitkAmoebaOptimizerView::ShowSimplexDelta()
197 this->updateGeometry();
std::list< QLabel * > simplexDeltaLabels
itk::SmartPointer< Self > Pointer
QmitkAmoebaOptimizerView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
virtual QString GetName() override
~QmitkAmoebaOptimizerView()
virtual mitk::OptimizerParameters::OptimizerType GetOptimizerType() override
std::list< QLineEdit * > simplexDeltaLineEdits
virtual void SetNumberOfTransformParameters(int transformParameters) override
Widget for rigid registration.
Ui::QmitkAmoebaOptimizerControls m_Controls
virtual void SetupUI(QWidget *parent) override
int m_NumberTransformParameters
virtual itk::Object::Pointer GetOptimizer() override
virtual itk::Array< double > GetOptimizerParameters() override
OptimizerType
Unique integer value for every optimizer.
virtual void SetOptimizerParameters(itk::Array< double > metricValues) override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.