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 
25 namespace itk
26 {
27 
44  {
45  public:
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<long> SearchSpaceIndexType;
84 
86  typedef Array<unsigned long> SearchSpaceSizeType;
87 
88 
92  itkGetConstMacro( Maximize, bool );
93  itkSetMacro( Maximize, bool );
94  itkBooleanMacro( Maximize );
95  bool GetMinimize( ) const
96  { return !m_Maximize; }
97  void SetMinimize(bool v)
98  { this->SetMaximize(!v); }
99  void MinimizeOn()
100  { this->MaximizeOff(); }
101  void MinimizeOff()
102  { this->MaximizeOn(); }
103 
118  virtual void UpdateCurrentPosition(void);
119 
123  virtual void StartOptimization( void );
124 
128  virtual void ResumeOptimization( void );
129 
133  virtual void StopOptimization( void );
134 
145  itkSetObjectMacro( SearchSpace, SearchSpaceType );
146  itkGetObjectMacro( SearchSpace, SearchSpaceType);
147 
149  virtual void AddSearchDimension( unsigned int param_nr,
150  RangeValueType minimum, RangeValueType maximum, RangeValueType step );
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  virtual ParametersType IndexToPosition(const SearchSpaceIndexType & index);
165 
168 
170  itkGetConstMacro( CurrentIteration, unsigned long );
171 
173  itkGetConstReferenceMacro( CurrentPointInSearchSpace, SearchSpacePointType );
174  itkGetConstReferenceMacro( CurrentIndexInSearchSpace, SearchSpaceIndexType );
175 
177  itkGetConstReferenceMacro( BestPointInSearchSpace, SearchSpacePointType );
178  itkGetConstReferenceMacro( BestIndexInSearchSpace, SearchSpaceIndexType );
179 
181  itkGetConstMacro( Value, double );
182 
184  itkGetConstMacro( BestValue, double );
185 
187  itkGetConstMacro( StopCondition, StopConditionType );
188 
189 
190  protected:
192  virtual ~FullSearchOptimizer() {};
193 
194  //void PrintSelf(std::ostream& os, Indent indent) const;
195 
196  bool m_Maximize;
197  bool m_Stop;
198  double m_Value;
199  double m_BestValue;
201 
209 
211  virtual void ProcessSearchSpaceChanges(void);
212 
213  private:
214  FullSearchOptimizer(const Self&); //purposely not implemented
215  void operator=(const Self&); //purposely not implemented
216 
217  unsigned long m_CurrentIteration;
218 
219  }; // end class
220 
221 } // end namespace itk
222 
223 
224 #endif
225 
virtual void StopOptimization(void)
virtual void RemoveSearchDimension(unsigned int param_nr)
Array< unsigned long > SearchSpaceSizeType
FixedArray< RangeValueType, 3 > RangeType
SearchSpaceSizeType m_SearchSpaceSize
SearchSpacePointType m_BestPointInSearchSpace
void operator=(const Self &)
ParameterValueType RangeValueType
virtual void SetMaximize(bool _arg)
MapContainer< unsigned int, RangeType > SearchSpaceType
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
virtual void UpdateCurrentPosition(void)
SmartPointer< Self > Pointer
SingleValuedNonLinearOptimizer Superclass
Superclass::CostFunctionPointer CostFunctionPointer
virtual unsigned int GetNumberOfSearchSpaceDimensions(void)
Array< ParameterValueType > SearchSpacePointType
virtual SearchSpacePointType IndexToPoint(const SearchSpaceIndexType &index)
SmartPointer< const Self > ConstPointer
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


Generated on 05-12-2013 for elastix by doxygen 1.8.5 elastix logo