Class defining a real-valued functional on a multi-dimensional domain. More...
#include <cmtkFunctional.h>
Public Types | |
typedef Functional | Self |
This class. | |
typedef SmartPointer< Self > | SmartPtr |
Smart pointer to Functional. | |
typedef Types::Combined < Types::Coordinate, Types::DataItem >::Type | ReturnType |
Functional return type. | |
typedef Vector< Types::Coordinate > | ParameterVectorType |
Parameter vector type. | |
typedef Types::Coordinate | ParameterType |
Functional return type. | |
Public Member Functions | |
virtual void | SetParamVector (ParameterVectorType &) |
Set parameter vector. | |
virtual void | GetParamVector (ParameterVectorType &) |
Return parameter vector. | |
virtual Self::ReturnType | Evaluate () |
Evaluate functional. | |
virtual Self::ReturnType | EvaluateAt (ParameterVectorType &v) |
Evaluate functional with new parameter vector. | |
virtual Self::ReturnType | EvaluateAlongGradientAt (ParameterVectorType &v) |
Evaluate functional with new parameter vector along previously computed gradient direction. | |
virtual Self::ReturnType | EvaluateWithGradient (ParameterVectorType &v, ParameterVectorType &g, const Types::Coordinate step=1) |
Evaluate functional and also return its gradient. | |
virtual size_t | ParamVectorDim () const =0 |
Return dimension of the parameter vector. | |
virtual size_t | VariableParamVectorDim () const |
Return dimension of the parmater vector's variable part. | |
virtual | ~Functional () |
Virtual destructor. | |
virtual Types::Coordinate | GetParamStep (const size_t, const Types::Coordinate mmStep=1) const |
Get stepping for one parameter. | |
virtual bool | Wiggle () |
Wiggle a little. |
Class defining a real-valued functional on a multi-dimensional domain.
Definition at line 56 of file cmtkFunctional.h.
Functional return type.
Definition at line 77 of file cmtkFunctional.h.
Parameter vector type.
Definition at line 74 of file cmtkFunctional.h.
Functional return type.
We set this to float (rather than double) because with double we get different results using different CPUs, even between Pentium4 Nocoma and Core2/Xeon using the exact same compiled bainary. That is not good for regression testing, nor is it for consistent results.
Reimplemented in cmtk::EntropyMinimizationIntensityCorrectionFunctionalDevice< NOrderAdd, NOrderMul >, cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >, and cmtk::VoxelMatchingAffineFunctionalTemplate< VM >.
Definition at line 71 of file cmtkFunctional.h.
typedef Functional cmtk::Functional::Self |
This class.
Reimplemented in cmtk::EntropyMinimizationIntensityCorrectionFunctionalDevice< NOrderAdd, NOrderMul >, cmtk::ImagePairAffineRegistrationFunctionalDevice, cmtk::ImageSymmetryPlaneFunctionalDevice, cmtk::CongealingFunctional< TXform >, cmtk::FunctionalAffine2D, cmtk::GroupwiseRegistrationFunctionalBase, cmtk::GroupwiseRegistrationFunctionalXformTemplate< TXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplate< AffineXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplate< SplineWarpXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplateBase< TXform >, cmtk::GroupwiseRegistrationRMIFunctional< TXform >, cmtk::ImagePairAffineRegistrationFunctional, cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >, cmtk::ImagePairNonrigidRegistrationFunctional, cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >, cmtk::ImagePairRegistrationFunctional, cmtk::ImagePairSymmetricNonrigidRegistrationFunctional, cmtk::ImagePairSymmetricNonrigidRegistrationFunctionalTemplate< VM, W >, cmtk::ImageSymmetryPlaneFunctional, cmtk::ImageSymmetryPlaneFunctionalBase, cmtk::MultiChannelHistogramRegistrationFunctional< TDataType, TInterpolator, THashKeyType, NBitsPerChannel >, cmtk::MultiChannelRegistrationFunctional< TInterpolator >, cmtk::MultiChannelRegistrationFunctionalBase, cmtk::MultiChannelRMIRegistrationFunctional< TRealType, TDataType, TInterpolator >, cmtk::ParallelElasticFunctional< VM >, cmtk::SplineWarpCongealingFunctional, cmtk::SplineWarpGroupwiseRegistrationRMIFunctional, cmtk::SymmetricElasticFunctional, cmtk::SymmetricElasticFunctional_Template< VM >, cmtk::SymmetryPlaneFunctional, cmtk::VoxelMatchingAffineFunctional, cmtk::VoxelMatchingAffineFunctionalTemplate< VM >, cmtk::VoxelMatchingElasticFunctional, cmtk::VoxelMatchingElasticFunctional_WarpTemplate< W >, cmtk::VoxelMatchingElasticFunctional_Template< VM >, cmtk::VoxelMatchingFunctional, cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >, cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase, cmtk::CongealingFunctional< SplineWarpXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplateBase< SplineWarpXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplateBase< AffineXform >, cmtk::GroupwiseRegistrationRMIFunctional< SplineWarpXform >, and cmtk::VoxelMatchingElasticFunctional_WarpTemplate< SplineWarpXform >.
Definition at line 60 of file cmtkFunctional.h.
typedef SmartPointer<Self> cmtk::Functional::SmartPtr |
Smart pointer to Functional.
Reimplemented in cmtk::EntropyMinimizationIntensityCorrectionFunctionalDevice< NOrderAdd, NOrderMul >, cmtk::ImagePairAffineRegistrationFunctionalDevice, cmtk::ImageSymmetryPlaneFunctionalDevice, cmtk::CongealingFunctional< TXform >, cmtk::FunctionalAffine2D, cmtk::GroupwiseRegistrationFunctionalBase, cmtk::GroupwiseRegistrationFunctionalXformTemplate< TXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplate< AffineXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplate< SplineWarpXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplateBase< TXform >, cmtk::GroupwiseRegistrationRMIFunctional< TXform >, cmtk::ImagePairAffineRegistrationFunctional, cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >, cmtk::ImagePairNonrigidRegistrationFunctional, cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >, cmtk::ImagePairSymmetricNonrigidRegistrationFunctional, cmtk::ImagePairSymmetricNonrigidRegistrationFunctionalTemplate< VM, W >, cmtk::ImageSymmetryPlaneFunctional, cmtk::ImageSymmetryPlaneFunctionalBase, cmtk::MultiChannelHistogramRegistrationFunctional< TDataType, TInterpolator, THashKeyType, NBitsPerChannel >, cmtk::MultiChannelRegistrationFunctional< TInterpolator >, cmtk::MultiChannelRegistrationFunctionalBase, cmtk::MultiChannelRMIRegistrationFunctional< TRealType, TDataType, TInterpolator >, cmtk::SplineWarpCongealingFunctional, cmtk::SplineWarpGroupwiseRegistrationRMIFunctional, cmtk::SymmetricElasticFunctional, cmtk::SymmetricElasticFunctional_Template< VM >, cmtk::SymmetryPlaneFunctional, cmtk::VoxelMatchingAffineFunctional, cmtk::VoxelMatchingAffineFunctionalTemplate< VM >, cmtk::VoxelMatchingElasticFunctional, cmtk::VoxelMatchingElasticFunctional_WarpTemplate< W >, cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >, cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase, cmtk::CongealingFunctional< SplineWarpXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplateBase< SplineWarpXform >, cmtk::GroupwiseRegistrationFunctionalXformTemplateBase< AffineXform >, cmtk::GroupwiseRegistrationRMIFunctional< SplineWarpXform >, and cmtk::VoxelMatchingElasticFunctional_WarpTemplate< SplineWarpXform >.
Definition at line 63 of file cmtkFunctional.h.
virtual cmtk::Functional::~Functional | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 132 of file cmtkFunctional.h.
virtual Self::ReturnType cmtk::Functional::Evaluate | ( | ) | [inline, virtual] |
Evaluate functional.
Reimplemented in cmtk::ImagePairAffineRegistrationFunctionalDevice, cmtk::ImageSymmetryPlaneFunctionalDevice, cmtk::CongealingFunctional< TXform >, cmtk::FunctionalAffine2D, cmtk::GroupwiseRegistrationRMIFunctional< TXform >, cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >, cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >, cmtk::ImagePairSymmetricNonrigidRegistrationFunctionalTemplate< VM, W >, cmtk::ImageSymmetryPlaneFunctional, cmtk::ImageSymmetryPlaneFunctionalBase, cmtk::ParallelElasticFunctional< VM >, cmtk::SplineWarpCongealingFunctional, cmtk::SplineWarpGroupwiseRegistrationRMIFunctional, cmtk::SymmetricElasticFunctional_Template< VM >, cmtk::SymmetryPlaneFunctional, cmtk::VoxelMatchingAffineFunctionalTemplate< VM >, cmtk::VoxelMatchingElasticFunctional_Template< VM >, cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase, cmtk::CongealingFunctional< SplineWarpXform >, and cmtk::GroupwiseRegistrationRMIFunctional< SplineWarpXform >.
Definition at line 94 of file cmtkFunctional.h.
virtual Self::ReturnType cmtk::Functional::EvaluateAlongGradientAt | ( | ParameterVectorType & | v ) | [inline, virtual] |
Evaluate functional with new parameter vector along previously computed gradient direction.
By default this function simply calls Evaluate(), but derived classes can override it to provide more computationally efficient, i.e., restricted, implementations.
Definition at line 112 of file cmtkFunctional.h.
virtual Self::ReturnType cmtk::Functional::EvaluateAt | ( | ParameterVectorType & | v ) | [inline, virtual] |
Evaluate functional with new parameter vector.
Definition at line 97 of file cmtkFunctional.h.
virtual Types::Coordinate cmtk::Functional::GetParamStep | ( | const | size_t, |
const Types::Coordinate | mmStep = 1 |
||
) | const [inline, virtual] |
Get stepping for one parameter.
This function serves to make sure that optimizers optimize all parameters with approximately equal impact. If a parameter has smaller impact than another, it should return a smaller value here.
Reimplemented in cmtk::FunctionalAffine2D, cmtk::GroupwiseRegistrationFunctionalBase, cmtk::ImagePairAffineRegistrationFunctional, cmtk::ImagePairNonrigidRegistrationFunctional, cmtk::ImagePairSymmetricNonrigidRegistrationFunctionalTemplate< VM, W >, cmtk::ImageSymmetryPlaneFunctionalBase, cmtk::SymmetricElasticFunctional_Template< VM >, cmtk::SymmetryPlaneFunctional, cmtk::VoxelMatchingAffineFunctional, cmtk::VoxelMatchingElasticFunctional_WarpTemplate< W >, cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >, and cmtk::VoxelMatchingElasticFunctional_WarpTemplate< SplineWarpXform >.
Definition at line 139 of file cmtkFunctional.h.
virtual void cmtk::Functional::GetParamVector | ( | ParameterVectorType & | ) | [inline, virtual] |
virtual size_t cmtk::Functional::ParamVectorDim | ( | ) | const [pure virtual] |
Return dimension of the parameter vector.
Implemented in cmtk::FunctionalAffine2D, cmtk::GroupwiseRegistrationFunctionalBase, cmtk::ImagePairAffineRegistrationFunctional, cmtk::ImagePairNonrigidRegistrationFunctional, cmtk::ImagePairSymmetricNonrigidRegistrationFunctionalTemplate< VM, W >, cmtk::ImageSymmetryPlaneFunctionalBase, cmtk::SymmetricElasticFunctional_Template< VM >, cmtk::SymmetryPlaneFunctional, cmtk::VoxelMatchingAffineFunctional, cmtk::VoxelMatchingElasticFunctional_WarpTemplate< W >, cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >, and cmtk::VoxelMatchingElasticFunctional_WarpTemplate< SplineWarpXform >.
Referenced by cmtk::SplineWarpGroupwiseRegistrationRMIFunctional::EvaluateLocalGradientThreadFunc(), and cmtk::SplineWarpCongealingFunctional::EvaluateLocalGradientThreadFunc().
virtual void cmtk::Functional::SetParamVector | ( | ParameterVectorType & | ) | [inline, virtual] |
virtual size_t cmtk::Functional::VariableParamVectorDim | ( | ) | const [inline, virtual] |
Return dimension of the parmater vector's variable part.
For example, the rotation center of a rigid body transformation is not considered variable. Therefore it should not be used for gradient computation. By default this function returns the total parameter vector length.
Reimplemented in cmtk::FunctionalAffine2D, cmtk::GroupwiseRegistrationFunctionalBase, cmtk::ImagePairAffineRegistrationFunctional, cmtk::ImagePairNonrigidRegistrationFunctional, cmtk::ImagePairSymmetricNonrigidRegistrationFunctionalTemplate< VM, W >, cmtk::ImageSymmetryPlaneFunctionalBase, cmtk::SymmetricElasticFunctional_Template< VM >, cmtk::SymmetryPlaneFunctional, cmtk::VoxelMatchingAffineFunctional, cmtk::VoxelMatchingElasticFunctional_WarpTemplate< W >, and cmtk::VoxelMatchingElasticFunctional_WarpTemplate< SplineWarpXform >.
Definition at line 126 of file cmtkFunctional.h.
virtual bool cmtk::Functional::Wiggle | ( | ) | [inline, virtual] |
Wiggle a little.
If the functional is not time-invariant, e.g., due to randomization, then the optimizer can tell it to re-organize itself for example for a repeated search.
Reimplemented in cmtk::CongealingFunctional< TXform >, cmtk::GroupwiseRegistrationFunctionalBase, cmtk::GroupwiseRegistrationFunctionalXformTemplate< SplineWarpXform >, cmtk::GroupwiseRegistrationRMIFunctional< TXform >, cmtk::CongealingFunctional< SplineWarpXform >, and cmtk::GroupwiseRegistrationRMIFunctional< SplineWarpXform >.
Definition at line 154 of file cmtkFunctional.h.