ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkMultiStartOptimizerv4.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 __itkMultiStartOptimizerv4_h
19 #define __itkMultiStartOptimizerv4_h
20 
23 
24 namespace itk
25 {
39 template<typename TInternalComputationValueType>
41 : public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
42 {
43 public:
49 
52 
54  itkNewMacro(Self);
55 
57  typedef std::vector< ParametersType > ParametersListType;
58  typedef typename ParametersListType::size_type ParameterListSizeType;
59 
64 
66  typedef enum {
74 
77 
80 
84  typedef TInternalComputationValueType InternalComputationValueType;
85 
88  typedef typename MetricType::Pointer MetricTypePointer;
89 
91  typedef typename MetricType::DerivativeType DerivativeType;
92 
95  typedef std::vector< MeasureType > MetricValuesListType;
96 
98  itkGetConstReferenceMacro(StopCondition, StopConditionType);
99 
101  void InstantiateLocalOptimizer(void);
102 
104  virtual void StartOptimization( bool doOnlyInitialization = false );
105 
108  virtual void StopOptimization(void);
109 
112  virtual void ResumeOptimization();
113 
115  virtual const StopConditionReturnStringType GetStopConditionDescription() const ITK_OVERRIDE;
116 
119 
122 
125 
128 
130  itkSetObjectMacro( LocalOptimizer, OptimizerType );
131  itkGetModifiableObjectMacro(LocalOptimizer, OptimizerType );
133 
135 
136 protected:
141 
142  virtual void PrintSelf(std::ostream & os, Indent indent) const;
143 
144  /* Common variables for optimization control and reporting */
145  bool m_Stop;
154 
155 private:
156  MultiStartOptimizerv4Template( const Self & ); //purposely not implemented
157  void operator=( const Self& ); //purposely not implemented
158 
159 };
160 
163 
164 } // end namespace itk
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
167 #include "itkMultiStartOptimizerv4.hxx"
168 #endif
169 
170 #endif
StopConditionDescriptionType m_StopConditionDescription
virtual void StartOptimization(bool doOnlyInitialization=false)
Light weight base class for most itk classes.
OptimizerParameters< TInternalComputationValueType > ParametersType
MetricType::DerivativeType DerivativeType
std::vector< ParametersType > ParametersListType
ParametersListType & GetParametersList()
Multi-start searches over input parameters and returns the best metric value.
itk::GradientDescentOptimizerv4Template< TInternalComputationValueType > LocalOptimizerType
LocalOptimizerType::Pointer LocalOptimizerPointer
Superclass::StopConditionReturnStringType StopConditionReturnStringType
ParametersListType::size_type ParameterListSizeType
ObjectToObjectMetricBaseTemplate< TInternalComputationValueType > MetricType
MultiStartOptimizerv4Template< double > MultiStartOptimizerv4
const MetricValuesListType & GetMetricValuesList() const
virtual void PrintSelf(std::ostream &os, Indent indent) const
virtual void StopOptimization(void)
Superclass::StopConditionDescriptionType StopConditionDescriptionType
TInternalComputationValueType InternalComputationValueType
std::vector< MeasureType > MetricValuesListType
void SetParametersList(ParametersListType &p)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::ParametersType ParametersType
ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > OptimizerType
ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > Superclass
MultiStartOptimizerv4Template Self
Abstract base for object-to-object optimizers.
virtual const StopConditionReturnStringType GetStopConditionDescription() const ITK_OVERRIDE