go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkFullSearchOptimizer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 
19 #ifndef __itkFullSearchOptimizer_h
20 #define __itkFullSearchOptimizer_h
21 
22 #include "itkSingleValuedNonLinearOptimizer.h"
23 #include "itkMapContainer.h"
24 #include "itkImage.h"
25 #include "itkArray.h"
26 #include "itkFixedArray.h"
27 
28 namespace itk
29 {
30 
47 {
48 public:
49 
54  typedef SmartPointer< const Self > ConstPointer;
55 
57  itkNewMacro( Self );
58 
61 
63  typedef enum {
67 
68  /* Typedefs inherited from superclass */
69  typedef Superclass::ParametersType ParametersType;
70  typedef Superclass::CostFunctionType CostFunctionType;
71  typedef Superclass::CostFunctionPointer CostFunctionPointer;
72  typedef Superclass::MeasureType MeasureType;
73 
74  typedef ParametersType::ValueType ParameterValueType; // = double
75  typedef ParameterValueType RangeValueType;
76  typedef FixedArray< RangeValueType, 3 > RangeType;
77  typedef MapContainer< unsigned int, RangeType > SearchSpaceType;
78  typedef SearchSpaceType::Pointer SearchSpacePointer;
79  typedef SearchSpaceType::ConstIterator SearchSpaceIteratorType;
80 
83  typedef Array< ParameterValueType > SearchSpacePointType;
84 
87  typedef Array< IndexValueType > SearchSpaceIndexType;
88 
90  typedef Array< SizeValueType > SearchSpaceSizeType;
91 
95  itkGetConstMacro( Maximize, bool );
96  itkSetMacro( Maximize, bool );
97  itkBooleanMacro( Maximize );
98  bool GetMinimize() const
99  { return !m_Maximize; }
100  void SetMinimize( bool v )
101  { this->SetMaximize( !v ); }
102  void MinimizeOn()
103  { this->MaximizeOff(); }
104  void MinimizeOff()
105  { this->MaximizeOn(); }
106 
121  virtual void UpdateCurrentPosition( void );
122 
126  virtual void StartOptimization( void );
127 
131  virtual void ResumeOptimization( void );
132 
136  virtual void StopOptimization( void );
137 
148  itkSetObjectMacro( SearchSpace, SearchSpaceType );
149  itkGetObjectMacro( SearchSpace, SearchSpaceType );
150 
152  virtual void AddSearchDimension( unsigned int param_nr,
153  RangeValueType minimum, RangeValueType maximum, RangeValueType step );
154 
155  virtual void RemoveSearchDimension( unsigned int param_nr );
156 
158  virtual unsigned long GetNumberOfIterations( void );
159 
161  virtual unsigned int GetNumberOfSearchSpaceDimensions( void );
162 
164  virtual const SearchSpaceSizeType & GetSearchSpaceSize( void );
165 
167  virtual ParametersType PointToPosition( const SearchSpacePointType & point );
168 
169  virtual ParametersType IndexToPosition( const SearchSpaceIndexType & index );
170 
172  virtual SearchSpacePointType IndexToPoint( const SearchSpaceIndexType & index );
173 
175  itkGetConstMacro( CurrentIteration, unsigned long );
176 
178  itkGetConstReferenceMacro( CurrentPointInSearchSpace, SearchSpacePointType );
179  itkGetConstReferenceMacro( CurrentIndexInSearchSpace, SearchSpaceIndexType );
180 
182  itkGetConstReferenceMacro( BestPointInSearchSpace, SearchSpacePointType );
183  itkGetConstReferenceMacro( BestIndexInSearchSpace, SearchSpaceIndexType );
184 
186  itkGetConstMacro( Value, double );
187 
189  itkGetConstMacro( BestValue, double );
190 
192  itkGetConstMacro( StopCondition, StopConditionType );
193 
194 protected:
195 
197  virtual ~FullSearchOptimizer() {}
198 
199  //void PrintSelf(std::ostream& os, Indent indent) const;
200 
202  bool m_Stop;
203  double m_Value;
204  double m_BestValue;
206 
207  SearchSpacePointer m_SearchSpace;
208  SearchSpacePointType m_CurrentPointInSearchSpace;
209  SearchSpaceIndexType m_CurrentIndexInSearchSpace;
210  SearchSpacePointType m_BestPointInSearchSpace;
211  SearchSpaceIndexType m_BestIndexInSearchSpace;
212  SearchSpaceSizeType m_SearchSpaceSize;
214 
216  virtual void ProcessSearchSpaceChanges( void );
217 
218 private:
219 
220  FullSearchOptimizer( const Self & ); // purposely not implemented
221  void operator=( const Self & ); // purposely not implemented
222 
223  unsigned long m_CurrentIteration;
224 
225 };
226 
227 } // end namespace itk
228 
229 #endif
FixedArray< RangeValueType, 3 > RangeType
virtual void StopOptimization(void)
virtual void RemoveSearchDimension(unsigned int param_nr)
SearchSpaceSizeType m_SearchSpaceSize
SearchSpacePointType m_BestPointInSearchSpace
void operator=(const Self &)
ParameterValueType RangeValueType
SmartPointer< Self > Pointer
virtual void SetMaximize(bool _arg)
Superclass::CostFunctionType CostFunctionType
virtual ParametersType IndexToPosition(const SearchSpaceIndexType &index)
virtual void StartOptimization(void)
virtual void AddSearchDimension(unsigned int param_nr, RangeValueType minimum, RangeValueType maximum, RangeValueType step)
SearchSpaceType::ConstIterator SearchSpaceIteratorType
virtual void ResumeOptimization(void)
SearchSpaceType::Pointer SearchSpacePointer
virtual const SearchSpaceSizeType & GetSearchSpaceSize(void)
SearchSpacePointType m_CurrentPointInSearchSpace
MapContainer< unsigned int, RangeType > SearchSpaceType
virtual void UpdateCurrentPosition(void)
SingleValuedNonLinearOptimizer Superclass
Superclass::CostFunctionPointer CostFunctionPointer
SmartPointer< const Self > ConstPointer
virtual unsigned int GetNumberOfSearchSpaceDimensions(void)
virtual SearchSpacePointType IndexToPoint(const SearchSpaceIndexType &index)
Array< SizeValueType > SearchSpaceSizeType
Array< ParameterValueType > SearchSpacePointType
virtual unsigned long GetNumberOfIterations(void)
virtual ParametersType PointToPosition(const SearchSpacePointType &point)
virtual void ProcessSearchSpaceChanges(void)
virtual void MaximizeOn()
An optimizer based on full search.
SearchSpaceIndexType m_CurrentIndexInSearchSpace
virtual void MaximizeOff()
ParametersType::ValueType ParameterValueType
SearchSpaceIndexType m_BestIndexInSearchSpace
Superclass::MeasureType MeasureType
Superclass::ParametersType ParametersType
Array< IndexValueType > SearchSpaceIndexType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo