ITK  4.6.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 
23 #include "itkCommand.h"
24 
25 namespace itk
26 {
37 {
38 public:
44 
47 
48 
53 
58 
61 
64 
65  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
66 
73  virtual void SetMetric(MetricType *metric) = 0;
74 
80  itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
81  itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
83 
85  virtual const StopConditionReturnStringType GetStopConditionDescription() const = 0;
86 
87 protected:
89  virtual ~SingleValuedNonLinearVnlOptimizerv4();
90 
92 
93  void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor);
94 
95  const CostFunctionAdaptorType * GetCostFunctionAdaptor(void) const;
96 
97  CostFunctionAdaptorType * GetCostFunctionAdaptor(void);
98 
101  CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor(void) const;
102 
104  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
105 
106 private:
113  void IterationReport(const EventObject & event);
114 
115  SingleValuedNonLinearVnlOptimizerv4(const Self &); //purposely not implemented
116  void operator=(const Self &); //purposely not implemented
117 
118  CostFunctionAdaptorType *m_CostFunctionAdaptor;
119 
120  CommandType::Pointer m_Command;
121 
122  mutable ParametersType m_CachedCurrentPosition;
123  mutable DerivativeType m_CachedDerivative;
124 };
125 } // end namespace itk
126 
127 #endif
Light weight base class for most itk classes.
void IterationReport(const EventObject &event)
virtual const StopConditionReturnStringType GetStopConditionDescription() const =0
virtual void SetMetric(MetricType *metric)=0
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.
virtual void StartOptimization(bool doOnlyInitialization=false) ITK_OVERRIDE
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
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.
const CostFunctionAdaptorType * GetCostFunctionAdaptor(void) const
CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor(void) const
Superclass::StopConditionReturnStringType StopConditionReturnStringType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor)
Superclass::StopConditionDescriptionType StopConditionDescriptionType
Abstract base for object-to-object optimizers.