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  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkFullSearchOptimizer_h
16 #define __itkFullSearchOptimizer_h
17 
18 #include "itkSingleValuedNonLinearOptimizer.h"
19 #include "itkMapContainer.h"
20 #include "itkImage.h"
21 #include "itkArray.h"
22 #include "itkFixedArray.h"
23 
24 namespace itk
25 {
26 
43 {
44 public:
45 
49  typedef SmartPointer< Self > Pointer;
50  typedef SmartPointer< const Self > ConstPointer;
51 
53  itkNewMacro( Self );
54 
57 
59  typedef enum {
63 
64  /* Typedefs inherited from superclass */
65  typedef Superclass::ParametersType ParametersType;
66  typedef Superclass::CostFunctionType CostFunctionType;
67  typedef Superclass::CostFunctionPointer CostFunctionPointer;
68  typedef Superclass::MeasureType MeasureType;
69 
70  typedef ParametersType::ValueType ParameterValueType; // = double
72  typedef FixedArray< RangeValueType, 3 > RangeType;
73  typedef MapContainer< unsigned int, RangeType > SearchSpaceType;
74  typedef SearchSpaceType::Pointer SearchSpacePointer;
75  typedef SearchSpaceType::ConstIterator SearchSpaceIteratorType;
76 
79  typedef Array< ParameterValueType > SearchSpacePointType;
80 
83  typedef Array< IndexValueType > SearchSpaceIndexType;
84 
86  typedef Array< SizeValueType > SearchSpaceSizeType;
87 
91  itkGetConstMacro( Maximize, bool );
92  itkSetMacro( Maximize, bool );
93  itkBooleanMacro( Maximize );
94  bool GetMinimize() const
95  { return !m_Maximize; }
96  void SetMinimize( bool v )
97  { this->SetMaximize( !v ); }
98  void MinimizeOn()
99  { this->MaximizeOff(); }
100  void MinimizeOff()
101  { this->MaximizeOn(); }
102 
117  virtual void UpdateCurrentPosition( void );
118 
122  virtual void StartOptimization( void );
123 
127  virtual void ResumeOptimization( void );
128 
132  virtual void StopOptimization( void );
133 
144  itkSetObjectMacro( SearchSpace, SearchSpaceType );
145  itkGetObjectMacro( SearchSpace, SearchSpaceType );
146 
148  virtual void AddSearchDimension( unsigned int param_nr,
149  RangeValueType minimum, RangeValueType maximum, RangeValueType step );
150 
151  virtual void RemoveSearchDimension( unsigned int param_nr );
152 
154  virtual unsigned long GetNumberOfIterations( void );
155 
157  virtual unsigned int GetNumberOfSearchSpaceDimensions( void );
158 
160  virtual const SearchSpaceSizeType & GetSearchSpaceSize( void );
161 
163  virtual ParametersType PointToPosition( const SearchSpacePointType & point );
164 
165  virtual ParametersType IndexToPosition( const SearchSpaceIndexType & index );
166 
168  virtual SearchSpacePointType IndexToPoint( const SearchSpaceIndexType & index );
169 
171  itkGetConstMacro( CurrentIteration, unsigned long );
172 
174  itkGetConstReferenceMacro( CurrentPointInSearchSpace, SearchSpacePointType );
175  itkGetConstReferenceMacro( CurrentIndexInSearchSpace, SearchSpaceIndexType );
176 
178  itkGetConstReferenceMacro( BestPointInSearchSpace, SearchSpacePointType );
179  itkGetConstReferenceMacro( BestIndexInSearchSpace, SearchSpaceIndexType );
180 
182  itkGetConstMacro( Value, double );
183 
185  itkGetConstMacro( BestValue, double );
186 
188  itkGetConstMacro( StopCondition, StopConditionType );
189 
190 protected:
191 
193  virtual ~FullSearchOptimizer() {}
194 
195  //void PrintSelf(std::ostream& os, Indent indent) const;
196 
198  bool m_Stop;
199  double m_Value;
200  double m_BestValue;
202 
210 
212  virtual void ProcessSearchSpaceChanges( void );
213 
214 private:
215 
216  FullSearchOptimizer( const Self & ); // purposely not implemented
217  void operator=( const Self & ); // purposely not implemented
218 
219  unsigned long m_CurrentIteration;
220 
221 };
222 
223 } // end namespace itk
224 
225 #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 11-03-2014 for elastix by doxygen 1.8.6 elastix logo