ITK  4.2.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
22 
23 namespace itk
24 {
39 class ITK_EXPORT MultiStartOptimizerv4
41 {
42 public:
48 
51 
53  itkNewMacro(Self);
54 
56  typedef std::vector< ParametersType > ParametersListType;
57  typedef ParametersListType::size_type ParameterListSizeType;
62 
64  typedef enum {
70  OTHER_ERROR
71  } StopConditionType;
72 
74  typedef std::string StopConditionReturnStringType;
75 
77  typedef std::ostringstream StopConditionDescriptionType;
78 
80  typedef Superclass::MetricType MetricType;
81  typedef MetricType::Pointer MetricTypePointer;
82 
84  typedef MetricType::DerivativeType DerivativeType;
85 
88  typedef std::vector< MeasureType > MetricValuesListType;
89 
91  typedef Superclass::InternalComputationValueType InternalComputationValueType;
92 
94  itkGetConstReferenceMacro(StopCondition, StopConditionType);
95 
97  itkSetMacro(NumberOfIterations, SizeValueType);
98 
100  itkGetConstReferenceMacro(NumberOfIterations, SizeValueType);
101 
103  itkGetConstMacro(CurrentIteration, SizeValueType);
104 
106  void InstantiateLocalOptimizer(void);
107 
109  virtual void StartOptimization(void);
110 
113  virtual void StopOptimization(void);
114 
117  virtual void ResumeOptimization();
118 
120  virtual const StopConditionReturnStringType GetStopConditionDescription() const;
121 
123  ParametersListType & GetParametersList();
124 
126  void SetParametersList(ParametersListType & p);
127 
129  const MetricValuesListType & GetMetricValuesList() const;
130 
132  ParametersType GetBestParameters( );
133 
135  itkSetObjectMacro( LocalOptimizer, OptimizerType );
136  itkGetObjectMacro( LocalOptimizer, OptimizerType );
138 
139  inline ParameterListSizeType GetBestParametersIndex( ) { return this->m_BestParametersIndex; }
140 
141 protected:
142 
145  virtual ~MultiStartOptimizerv4();
147 
148  virtual void PrintSelf(std::ostream & os, Indent indent) const;
149 
150  /* Common variables for optimization control and reporting */
151  bool m_Stop;
162 
163 private:
164  MultiStartOptimizerv4( const Self & ); //purposely not implemented
165  void operator=( const Self& ); //purposely not implemented
166 
167 };
168 
169 } // end namespace itk
170 
171 #endif
172