go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkScaledSingleValuedNonLinearOptimizer.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 #ifndef __ScaledSingleValuedNonLinearOptimizer_h
00016 #define __ScaledSingleValuedNonLinearOptimizer_h
00017 
00018 #include "itkSingleValuedNonLinearOptimizer.h"
00019 #include "itkScaledSingleValuedCostFunction.h"
00020 
00021 namespace itk
00022 {
00059   class ScaledSingleValuedNonLinearOptimizer :
00060     public SingleValuedNonLinearOptimizer
00061   {
00062   public:
00063 
00065     typedef ScaledSingleValuedNonLinearOptimizer  Self;
00066     typedef SingleValuedNonLinearOptimizer        Superclass;
00067     typedef SmartPointer<Self>                    Pointer;
00068     typedef SmartPointer<const Self>              ConstPointer;
00069 
00071     itkNewMacro( Self );
00072 
00074     itkTypeMacro( ScaledSingleValuedNonLinearOptimizer,
00075       SingleValuedNonLinearOptimizer );
00076 
00078     typedef Superclass::MeasureType               MeasureType;
00079     typedef Superclass::ParametersType            ParametersType;
00080     typedef Superclass::DerivativeType            DerivativeType;
00081     typedef Superclass::CostFunctionType          CostFunctionType;
00082 
00083     typedef NonLinearOptimizer::ScalesType        ScalesType;
00084     typedef ScaledSingleValuedCostFunction        ScaledCostFunctionType;
00085     typedef ScaledCostFunctionType::Pointer       ScaledCostFunctionPointer;
00086 
00094     virtual void InitializeScales(void);
00095 
00097     virtual void SetCostFunction(CostFunctionType *costFunction);
00098 
00102     virtual void SetUseScales( bool arg );
00103     bool GetUseScales( void ) const;
00104 
00106     itkGetConstReferenceMacro( ScaledCurrentPosition, ParametersType );
00107 
00111     virtual const ParametersType & GetCurrentPosition( void ) const;
00112 
00114     itkGetConstObjectMacro( ScaledCostFunction, ScaledCostFunctionType );
00115 
00120     itkBooleanMacro( Maximize );
00121     virtual void SetMaximize( bool _arg );
00122     itkGetConstMacro( Maximize, bool );
00123 
00124   protected:
00125 
00127     ScaledSingleValuedNonLinearOptimizer();
00129     virtual ~ScaledSingleValuedNonLinearOptimizer() {};
00130 
00132     void PrintSelf( std::ostream & os, Indent indent ) const;
00133 
00135     ParametersType                  m_ScaledCurrentPosition;
00136     ScaledCostFunctionPointer       m_ScaledCostFunction;
00137 
00139     virtual void SetScaledCurrentPosition( const ParametersType & parameters );
00140 
00152     virtual void  SetCurrentPosition ( const ParametersType &param );
00153 
00157     virtual MeasureType GetScaledValue(
00158       const ParametersType & parameters ) const;
00159 
00164     virtual void GetScaledDerivative(
00165       const ParametersType & parameters,
00166       DerivativeType & derivative ) const;
00167 
00169     virtual void GetScaledValueAndDerivative(
00170       const ParametersType & parameters,
00171       MeasureType & value,
00172       DerivativeType & derivative ) const;
00173 
00174   private:
00175 
00177     ScaledSingleValuedNonLinearOptimizer( const Self& );  // purposely not implemented
00179     void operator=( const Self& );                        // purposely not implemented
00180 
00185     mutable ParametersType          m_UnscaledCurrentPosition;
00186     bool                            m_Maximize;
00187 
00188   }; // end class ScaledSingleValuedNonLinearOptimizer
00189 
00190 
00191 } // end namespace itk
00192 
00193 #endif //#ifndef __ScaledSingleValuedNonLinearOptimizer_h
00194 


Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo