ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSingleValuedNonLinearVnlOptimizerv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkSingleValuedNonLinearVnlOptimizerv4_h
19 #define itkSingleValuedNonLinearVnlOptimizerv4_h
20 
21 #include "ITKOptimizersv4Export.h"
22 
25 #include "itkCommand.h"
26 
27 namespace itk
28 {
37 class ITKOptimizersv4_EXPORT SingleValuedNonLinearVnlOptimizerv4 :
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_ASSIGN(SingleValuedNonLinearVnlOptimizerv4);
42 
48 
51 
52 
57 
62 
65 
68 
69  void StartOptimization(bool doOnlyInitialization = false) override;
70 
77  void SetMetric(MetricType *metric) override = 0;
78 
84  itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
85  itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
87 
89  const StopConditionReturnStringType GetStopConditionDescription() const override = 0;
90 
91 protected:
93  ~SingleValuedNonLinearVnlOptimizerv4() override;
94 
96 
97  void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor);
98 
99  const CostFunctionAdaptorType * GetCostFunctionAdaptor() const;
100 
101  CostFunctionAdaptorType * GetCostFunctionAdaptor();
102 
105  CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor() const;
106 
108  void PrintSelf(std::ostream & os, Indent indent) const override;
109 
110 private:
117  void IterationReport(const EventObject & event);
118 
119  CostFunctionAdaptorType *m_CostFunctionAdaptor;
120 
121  CommandType::Pointer m_Command;
122 
123  mutable ParametersType m_CachedCurrentPosition;
124  mutable DerivativeType m_CachedDerivative;
125 };
126 } // end namespace itk
127 
128 #endif
Light weight base class for most itk classes.
ObjectToObjectOptimizerBaseTemplate< double > ObjectToObjectOptimizerBase
Superclass::StopConditionDescriptionType StopConditionDescriptionType
This class is an Adaptor that allows to pass itk::ObjectToObjectMetricBase objects to vnl_optimizers ...
This is a base for the ITKv4 Optimization methods using the vnl library.
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:163
Abstraction of the Events used to communicating among filters and with GUIs.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::StopConditionReturnStringType StopConditionReturnStringType
Abstract base for object-to-object optimizers.