ITK  4.8.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:
46 
49 
50 
55 
60 
63 
66 
67  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
68 
75  virtual void SetMetric(MetricType *metric) ITK_OVERRIDE = 0;
76 
82  itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
83  itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
85 
87  virtual const StopConditionReturnStringType GetStopConditionDescription() const ITK_OVERRIDE = 0;
88 
89 protected:
91  virtual ~SingleValuedNonLinearVnlOptimizerv4();
92 
94 
95  void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor);
96 
97  const CostFunctionAdaptorType * GetCostFunctionAdaptor() const;
98 
99  CostFunctionAdaptorType * GetCostFunctionAdaptor();
100 
103  CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor() const;
104 
106  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
107 
108 private:
115  void IterationReport(const EventObject & event);
116 
117  SingleValuedNonLinearVnlOptimizerv4(const Self &); //purposely not implemented
118  void operator=(const Self &); //purposely not implemented
119 
120  CostFunctionAdaptorType *m_CostFunctionAdaptor;
121 
122  CommandType::Pointer m_Command;
123 
124  mutable ParametersType m_CachedCurrentPosition;
125  mutable DerivativeType m_CachedDerivative;
126 };
127 } // end namespace itk
128 
129 #endif
Light weight base class for most itk classes.
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:168
Abstraction of the Events used to communicating among filters and with GUIs.
Superclass::StopConditionReturnStringType StopConditionReturnStringType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::StopConditionDescriptionType StopConditionDescriptionType
Abstract base for object-to-object optimizers.