ITK  4.5.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 
76  typedef std::string StopConditionReturnStringType;
77 
79  typedef std::ostringstream StopConditionDescriptionType;
80 
82  typedef TInternalComputationValueType InternalComputationValueType;
83 
86  typedef typename MetricType::Pointer MetricTypePointer;
87 
89  typedef typename MetricType::DerivativeType DerivativeType;
90 
93  typedef std::vector< MeasureType > MetricValuesListType;
94 
96  itkGetConstReferenceMacro(StopCondition, StopConditionType);
97 
99  itkSetMacro(NumberOfIterations, SizeValueType);
100 
102  itkGetConstReferenceMacro(NumberOfIterations, SizeValueType);
103 
105  itkGetConstMacro(CurrentIteration, SizeValueType);
106 
108  void InstantiateLocalOptimizer(void);
109 
111  virtual void StartOptimization( bool doOnlyInitialization = false );
112 
115  virtual void StopOptimization(void);
116 
119  virtual void ResumeOptimization();
120 
123 
126 
129 
132 
135 
137  itkSetObjectMacro( LocalOptimizer, OptimizerType );
138  itkGetModifiableObjectMacro(LocalOptimizer, OptimizerType );
140 
142 
143 protected:
148 
149  virtual void PrintSelf(std::ostream & os, Indent indent) const;
150 
151  /* Common variables for optimization control and reporting */
152  bool m_Stop;
163 
164 private:
165  MultiStartOptimizerv4Template( const Self & ); //purposely not implemented
166  void operator=( const Self& ); //purposely not implemented
167 
168 };
169 
172 
173 } // end namespace itk
174 
175 #ifndef ITK_MANUAL_INSTANTIATION
176 #include "itkMultiStartOptimizerv4.hxx"
177 #endif
178 
179 #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()
virtual const StopConditionReturnStringType GetStopConditionDescription() const
Multi-start searches over input parameters and returns the best metric value.
itk::GradientDescentOptimizerv4Template< TInternalComputationValueType > LocalOptimizerType
LocalOptimizerType::Pointer LocalOptimizerPointer
ParametersListType::size_type ParameterListSizeType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
ObjectToObjectMetricBaseTemplate< TInternalComputationValueType > MetricType
MultiStartOptimizerv4Template< double > MultiStartOptimizerv4
const MetricValuesListType & GetMetricValuesList() const
virtual void PrintSelf(std::ostream &os, Indent indent) const
virtual void StopOptimization(void)
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.