ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMultipleValuedNonLinearVnlOptimizer.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 itkMultipleValuedNonLinearVnlOptimizer_h
19 #define itkMultipleValuedNonLinearVnlOptimizer_h
20 
23 #include "itkCommand.h"
24 #include "ITKOptimizersExport.h"
25 
26 namespace itk
27 {
37 class ITKOptimizers_EXPORT MultipleValuedNonLinearVnlOptimizer:
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_ASSIGN(MultipleValuedNonLinearVnlOptimizer);
42 
48 
51  MultipleValueNonLinearOptimizer);
52 
55  using ParametersType = Superclass::ParametersType;
56 
63  void SetCostFunction(MultipleValuedCostFunction *costFunction) override = 0;
64 
68  void SetUseCostFunctionGradient(bool);
69 
71  {
72  this->SetUseCostFunctionGradient(true);
73  }
74 
76  {
77  this->SetUseCostFunctionGradient(false);
78  }
79 
80  bool GetUseCostFunctionGradient() const;
81 
88  itkGetConstReferenceMacro(CachedValue, MeasureType);
89  itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
90  itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
92 
93 protected:
96 
97  void PrintSelf(std::ostream & os, Indent indent) const override;
98 
100 
101  void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor);
102 
103  const CostFunctionAdaptorType * GetCostFunctionAdaptor() const;
104 
105  CostFunctionAdaptorType * GetCostFunctionAdaptor();
106 
109  CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor() const;
110 
116 
117 private:
119  void IterationReport(const EventObject & event);
120 
123 
125 
127  mutable MeasureType m_CachedValue;
128  mutable DerivativeType m_CachedDerivative;
129 };
130 } // end namespace itk
131 
132 #endif
Light weight base class for most itk classes.
This class is a base for the Optimization methods that optimize a multi-valued function.
This class is a base for the CostFunctions returning a multiple values.
This class is a base for the Optimization methods that optimize a multiple valued function...
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
This class is an Adaptor that allows to pass itk::MultipleValuedCostFunctions to vnl_optimizers expec...