ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMultiGradientOptimizerv4.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkMultiGradientOptimizerv4_h
00019 #define __itkMultiGradientOptimizerv4_h
00020 #include "itkObjectToObjectOptimizerBase.h"
00021 #include "itkGradientDescentOptimizerv4.h"
00022 
00023 namespace itk
00024 {
00042 class ITK_EXPORT MultiGradientOptimizerv4
00043   : public GradientDescentOptimizerv4
00044 {
00045 public:
00047   typedef MultiGradientOptimizerv4       Self;
00048   typedef GradientDescentOptimizerv4     Superclass;
00049   typedef SmartPointer< Self >           Pointer;
00050   typedef SmartPointer< const Self >     ConstPointer;
00051 
00053   itkTypeMacro(MultiGradientOptimizerv4, GradientDescentOptimizerv4);
00054 
00056   itkNewMacro(Self);
00057 
00058   typedef itk::GradientDescentOptimizerv4            LocalOptimizerType;
00059   typedef itk::GradientDescentOptimizerv4::Pointer   LocalOptimizerPointer;
00060   typedef Superclass::ParametersType                 ParametersType;
00061   typedef ObjectToObjectOptimizerBase                OptimizerType;
00062   typedef OptimizerType::Pointer                     OptimizerPointer;
00063   typedef std::vector< LocalOptimizerPointer >       OptimizersListType;
00064   typedef OptimizersListType::size_type              OptimizersListSizeType;
00065 
00067   typedef std::string                            StopConditionReturnStringType;
00068 
00070   typedef std::ostringstream                     StopConditionDescriptionType;
00071 
00073   typedef Superclass::MetricType                    MetricType;
00074   typedef MetricType::Pointer                       MetricTypePointer;
00075 
00077   typedef MetricType::DerivativeType                DerivativeType;
00078 
00080   typedef Superclass::MeasureType                   MeasureType;
00081   typedef std::vector< MeasureType >                MetricValuesListType;
00082 
00084   typedef Superclass::InternalComputationValueType InternalComputationValueType;
00085 
00087   itkGetConstReferenceMacro(StopCondition, StopConditionType);
00088 
00090   itkSetMacro(NumberOfIterations, SizeValueType);
00091 
00093   itkGetConstReferenceMacro(NumberOfIterations, SizeValueType);
00094 
00096   itkGetConstMacro(CurrentIteration, SizeValueType);
00097 
00099   virtual void StartOptimization(void);
00100 
00103   virtual void StopOptimization(void);
00104 
00107   virtual void ResumeOptimization();
00108 
00110   virtual const StopConditionReturnStringType GetStopConditionDescription() const;
00111 
00113   OptimizersListType & GetOptimizersList();
00114 
00116   void SetOptimizersList(OptimizersListType & p);
00117 
00119   const MetricValuesListType & GetMetricValuesList() const;
00120 
00121 protected:
00122 
00124   MultiGradientOptimizerv4();
00125   virtual ~MultiGradientOptimizerv4();
00127 
00128   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00129 
00130   /* Common variables for optimization control and reporting */
00131   bool                          m_Stop;
00132   StopConditionType             m_StopCondition;
00133   StopConditionDescriptionType  m_StopConditionDescription;
00134   SizeValueType                 m_NumberOfIterations;
00135   SizeValueType                 m_CurrentIteration;
00136   OptimizersListType            m_OptimizersList;
00137   MetricValuesListType          m_MetricValuesList;
00138   MeasureType                   m_MinimumMetricValue;
00139   MeasureType                   m_MaximumMetricValue;
00140 
00141 private:
00142   MultiGradientOptimizerv4( const Self & ); //purposely not implemented
00143   void operator=( const Self& ); //purposely not implemented
00144 
00145 };
00146 
00147 } // end namespace itk
00148 
00149 #endif
00150