ITK  6.0.0
Insight Toolkit
itkSingleValuedNonLinearVnlOptimizerv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 {
38 class ITKOptimizersv4_EXPORT SingleValuedNonLinearVnlOptimizerv4 : public ObjectToObjectOptimizerBaseTemplate<double>
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_MOVE(SingleValuedNonLinearVnlOptimizerv4);
42 
48 
50  itkOverrideGetNameOfClassMacro(SingleValuedNonLinearVnlOptimizerv4);
51 
57 
58  using MetricType = Superclass::MetricType;
59  using DerivativeType = Superclass::DerivativeType;
60  using ParametersType = Superclass::ParametersType;
61  using ScalesType = Superclass::ScalesType;
62 
64  using StopConditionReturnStringType = Superclass::StopConditionReturnStringType;
65 
67  using StopConditionDescriptionType = Superclass::StopConditionDescriptionType;
68 
69  void
70  StartOptimization(bool doOnlyInitialization = false) override;
71 
78  void
79  SetMetric(MetricType * metric) override = 0;
80 
86  itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
87  itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
92  GetStopConditionDescription() const override = 0;
93 
94 protected:
97 
99 
100  void
101  SetCostFunctionAdaptor(CostFunctionAdaptorType * adaptor);
102 
104  GetCostFunctionAdaptor() const;
105 
107  GetCostFunctionAdaptor();
108 
112  GetNonConstCostFunctionAdaptor() const;
113 
115  void
116  PrintSelf(std::ostream & os, Indent indent) const override;
117 
118 private:
125  void
126  IterationReport(const EventObject & event);
127 
128  CostFunctionAdaptorType * m_CostFunctionAdaptor{};
129 
130  CommandType::Pointer m_Command{};
131 
132  mutable ParametersType m_CachedCurrentPosition{};
133  mutable DerivativeType m_CachedDerivative{};
134 };
135 } // end namespace itk
136 
137 #endif
itk::SingleValuedNonLinearVnlOptimizerv4::MetricType
Superclass::MetricType MetricType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:58
itk::SingleValuedNonLinearVnlOptimizerv4::ScalesType
Superclass::ScalesType ScalesType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:61
itk::ReceptorMemberCommand
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:164
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::SingleValuedNonLinearVnlOptimizerv4
This is a base for the ITKv4 Optimization methods using the vnl library.
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:38
itk::ObjectToObjectOptimizerBase
ObjectToObjectOptimizerBaseTemplate< double > ObjectToObjectOptimizerBase
Definition: itkObjectToObjectOptimizerBase.h:327
itk::SingleValuedNonLinearVnlOptimizerv4::StopConditionReturnStringType
Superclass::StopConditionReturnStringType StopConditionReturnStringType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:64
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::SingleValuedNonLinearVnlOptimizerv4::StopConditionDescriptionType
Superclass::StopConditionDescriptionType StopConditionDescriptionType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:67
itk::SingleValuedNonLinearVnlOptimizerv4::DerivativeType
Superclass::DerivativeType DerivativeType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:59
itk::SingleValuedVnlCostFunctionAdaptorv4
This class is an Adaptor that allows to pass itk::ObjectToObjectMetricBase objects to vnl_optimizers ...
Definition: itkSingleValuedVnlCostFunctionAdaptorv4.h:37
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itkObjectToObjectOptimizerBase.h
itk::ObjectToObjectOptimizerBaseTemplate
Abstract base for object-to-object optimizers.
Definition: itkObjectToObjectOptimizerBase.h:113
itk::EventObject
Abstraction of the Events used to communicating among filters and with GUIs.
Definition: itkEventObject.h:58
itk::SingleValuedNonLinearVnlOptimizerv4::ParametersType
Superclass::ParametersType ParametersType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:60
itkCommand.h
itkSingleValuedVnlCostFunctionAdaptorv4.h