template<unsigned int TFixedDimension, unsigned int TMovingDimension, typename TVirtualImage = Image<double, TFixedDimension>, class TInternalComputationValueType = double>
class itk::ObjectToObjectMultiMetricv4< TFixedDimension, TMovingDimension, TVirtualImage, TInternalComputationValueType >
This class takes one ore more ObjectToObject metrics and assigns weights to their derivatives to compute a single result.
This class takes N ObjectToObject-derived component metrics and assigns a weight to each of the metrics' derivatives. It then computes a weighted measure of the metric. The GetValue() and GetValueAndDerivative() methods compute the measure and derivative using the following calculation:
metric value = Sum_j ( w_j * M_j ) (see important note below)
and the GetDerivative() method computes the derivative by computing:
derivative = Sum_j ( w_j * dM_j / ||dM_j|| ) * ( Sum_j( ||dM_j|| ) / J )
- Note
- The metric value is unit-less, and thus it is difficult to compute a combined metric. This metric returns the metric value in three ways: 1) GetValue() returns the computed value of only the first component metric. This result is stored in m_Value and also returned by GetCurrentValue(). 2) GetValueArray() returns an itkArray of metric values, one for each component metric. It only has meaning after a call to GetValue(), GetDerivative() or GetValueAndDerivative(). 3) GetWeightedValue() returns a combined metric value of all component metrics, using the assigned weights. It only has meaning after a call to GetValue(), GetDerivative() or GetValueAndDerivative().
The assigned weights are normalized internally to sum to one before use, and the weights default to 1/N, where N is the number of component metrics.
- Note
- Each component metric must use the same transform parameters object. That is, each metric must be evaluating the same parameters by evaluating the same transform. Except, if a component transform is a CompositeTransform, in which case it must be set to optimize a single transform, and that transform must be the same as the transform in other component metrics.
-
Each component metric must be setup independently, except for the metric transforms which can optionally be set from this class. That is, each component's images or point sets, fixed transforms and options must be set independently. The only methods in this metric for setting up the component metrics is SetMovingTransform(). The corresponding Set accesor is also available. When Set{Fixed/Moving}Transform() is not used this metric's m_{Fixed/Moving}Transform member is assigned to the fixed/moving transform assigned to the first component metric.
Each component will be initialized by this metric in the call to Initialize().
- Note
- When used with an itkRegistrationParameterScalesEstimator estimator, and the multi-metric holds one or more point-set metrics, the user must assign a virtual domain point set for sampling to ensure proper sampling within the point set metrics. In order to generate valid shift estimations, such a virtual domain point set must include mapped points from the fixed point set. See RegistrationParameterScalesEstimator::SetVirtualDomainPointSet() and PointSetToPointSetMetricv4::GetVirtualTransformedPointSet(). If there are two different point sets, then the virtual domain point set should be a union of the two for completeness.
-
If the user does not explicitly assign a virtual domain, then the first valid virtual domain found in the component metrics will be used a virtual domain for this multi-metric, which will be queried by classes such as registration parameter estimators. Each componenet metric will still use its own virtual domain for internal calculations when evaluated, so it is possible to use different virtual domains for each metric if desired. If no component metric has a virtual domain defined, then by default the virtual domain is unbounded. When the transform is high dimensional (e.g. DisplacementFieldTransform) then there must be a virtual domain that matches the space of the transform field. Note that when used with a DisplacementFieldTransform, both Image and PointSet metrics will automatically create a matching virtual domain during initialization if one has not been assigned by the user.
Definition at line 93 of file itkObjectToObjectMultiMetricv4.h.
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef
Superclass::CoordinateRepresentationType | CoordinateRepresentationType |
|
typedef Superclass::DerivativeType | DerivativeType |
|
typedef
Superclass::DerivativeValueType | DerivativeValueType |
|
typedef
Superclass::FixedTransformType | FixedTransformType |
|
typedef Superclass::MeasureType | MeasureType |
|
typedef MetricType::ConstPointer | MetricBaseConstPointer |
|
typedef MetricType::Pointer | MetricBasePointer |
|
typedef
Superclass::MetricCategoryType | MetricCategoryType |
|
typedef std::deque
< MetricBasePointer > | MetricQueueType |
|
typedef Superclass | MetricType |
|
typedef Array< MeasureType > | MetricValueArrayType |
|
typedef
Superclass::MovingTransformType | MovingTransformType |
|
typedef
Superclass::NumberOfParametersType | NumberOfParametersType |
|
typedef Superclass::ObjectType | ObjectType |
|
typedef Superclass::ParametersType | ParametersType |
|
typedef
Superclass::ParametersValueType | ParametersValueType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef ObjectToObjectMultiMetricv4 | Self |
|
typedef ObjectToObjectMetric
< TFixedDimension,
TMovingDimension,
TVirtualImage,
TInternalComputationValueType > | Superclass |
|
typedef Array< WeightValueType > | WeightsArrayType |
|
typedef DerivativeType::ValueType | WeightValueType |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef
TInternalComputationValueType | CoordinateRepresentationType |
|
typedef Superclass::DerivativeType | DerivativeType |
|
typedef
Superclass::DerivativeValueType | DerivativeValueType |
|
typedef SizeValueType | DimensionType |
|
typedef
FixedTransformType::InputPointType | FixedInputPointType |
|
typedef
FixedTransformType::OutputPointType | FixedOutputPointType |
|
typedef
FixedTransformType::JacobianType | FixedTransformJacobianType |
|
typedef
FixedTransformType::ParametersType | FixedTransformParametersType |
|
typedef FixedTransformType::Pointer | FixedTransformPointer |
|
typedef Transform
< TInternalComputationValueType,
TVirtualImage::ImageDimension,
TFixedDimension > | FixedTransformType |
|
typedef
Superclass::GradientSourceType | GradientSourceType |
|
typedef
TInternalComputationValueType | InternalComputationValueType |
|
typedef
FixedTransformType::JacobianType | JacobianType |
|
typedef Superclass::MeasureType | MeasureType |
|
typedef
Superclass::MetricCategoryType | MetricCategoryType |
|
typedef
DisplacementFieldTransform
< CoordinateRepresentationType,
itkGetStaticConstMacro(MovingDimension) > | MovingDisplacementFieldTransformType |
|
typedef
MovingTransformType::InputPointType | MovingInputPointType |
|
typedef
MovingTransformType::OutputPointType | MovingOutputPointType |
|
typedef
MovingTransformType::JacobianType | MovingTransformJacobianType |
|
typedef
MovingTransformType::ParametersType | MovingTransformParametersType |
|
typedef
MovingTransformType::Pointer | MovingTransformPointer |
|
typedef Transform
< TInternalComputationValueType,
TVirtualImage::ImageDimension,
TMovingDimension > | MovingTransformType |
|
typedef
Superclass::NumberOfParametersType | NumberOfParametersType |
|
typedef Superclass::Object | ObjectType |
|
typedef Superclass::ParametersType | ParametersType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef ObjectToObjectMetric | Self |
|
typedef
ObjectToObjectMetricBaseTemplate
< TInternalComputationValueType > | Superclass |
|
typedef
VirtualImageType::DirectionType | VirtualDirectionType |
|
typedef
VirtualImageType::ConstPointer | VirtualImageConstPointer |
|
typedef VirtualImageType::Pointer | VirtualImagePointer |
|
typedef TVirtualImage | VirtualImageType |
|
typedef VirtualImageType::IndexType | VirtualIndexType |
|
typedef VirtualImageType::PointType | VirtualOriginType |
|
typedef VirtualImageType::PixelType | VirtualPixelType |
|
typedef
VirtualPointSetType::Pointer | VirtualPointSetPointer |
|
typedef PointSet
< VirtualPixelType,
itkGetStaticConstMacro(VirtualDimension)> | VirtualPointSetType |
|
typedef VirtualImageType::PointType | VirtualPointType |
|
typedef VirtualImageType::SizeType | VirtualRadiusType |
|
typedef
VirtualImageType::RegionType | VirtualRegionType |
|
typedef VirtualRegionType::SizeType | VirtualSizeType |
|
typedef
VirtualImageType::SpacingType | VirtualSpacingType |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef
TInternalComputationValueType | CoordinateRepresentationType |
|
typedef Superclass::DerivativeType | DerivativeType |
|
typedef DerivativeType::ValueType | DerivativeValueType |
|
enum | GradientSourceType {
GRADIENT_SOURCE_FIXED =0,
GRADIENT_SOURCE_MOVING,
GRADIENT_SOURCE_BOTH
} |
|
typedef Superclass::MeasureType | MeasureType |
|
enum | MetricCategoryType {
UNKNOWN_METRIC = 0,
OBJECT_METRIC = 1,
IMAGE_METRIC = 2,
POINT_SET_METRIC = 3,
MULTI_METRIC = 4
} |
|
typedef unsigned int | NumberOfParametersType |
|
typedef ObjectType::ConstPointer | ObjectConstPointer |
|
typedef Object | ObjectType |
|
typedef Superclass::ParametersType | ParametersType |
|
typedef
TInternalComputationValueType | ParametersValueType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef
ObjectToObjectMetricBaseTemplate | Self |
|
typedef
SingleValuedCostFunctionv4Template
< TInternalComputationValueType > | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef Array
< TInternalComputationValueType > | DerivativeType |
|
typedef
TInternalComputationValueType | MeasureType |
|
typedef Superclass::ParametersType | ParametersType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef
SingleValuedCostFunctionv4Template | Self |
|
typedef CostFunctionTemplate
< TInternalComputationValueType > | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef OptimizerParameters
< TInternalComputationValueType > | ParametersType |
|
typedef
TInternalComputationValueType | ParametersValueType |
|
typedef SmartPointer< Self > | Pointer |
|
typedef CostFunctionTemplate | Self |
|
typedef Object | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef SmartPointer< Self > | Pointer |
|
typedef Object | Self |
|
typedef LightObject | Superclass |
|
typedef SmartPointer< const Self > | ConstPointer |
|
typedef SmartPointer< Self > | Pointer |
|
typedef LightObject | Self |
|
|
void | AddMetric (MetricType *metric) |
|
void | ClearMetricQueue () |
|
virtual ::itk::LightObject::Pointer | CreateAnother () const |
|
virtual void | GetDerivative (DerivativeType &) const override |
|
virtual MetricCategoryType | GetMetricCategory () const override |
|
const MetricQueueType & | GetMetricQueue () const |
|
virtual WeightsArrayType | GetMetricWeights () |
|
virtual const char * | GetNameOfClass () const |
|
SizeValueType | GetNumberOfMetrics () const |
|
MeasureType | GetValue () const override |
|
void | GetValueAndDerivative (MeasureType &value, DerivativeType &derivative) const override |
|
MetricValueArrayType | GetValueArray () const |
|
MeasureType | GetWeightedValue () const |
|
void | Initialize (void) override throw ( itk::ExceptionObject ) |
|
virtual void | SetFixedObject (const ObjectType *) override |
|
virtual void | SetFixedTransform (FixedTransformType *) override |
|
virtual void | SetMetricWeights (WeightsArrayType _arg) |
|
virtual void | SetMovingObject (const ObjectType *) override |
|
virtual void | SetMovingTransform (MovingTransformType *) override |
|
virtual bool | SupportsArbitraryVirtualDomainSamples (void) const override |
|
OffsetValueType | ComputeParameterOffsetFromVirtualIndex (const VirtualIndexType &index, const NumberOfParametersType &numberOfLocalParameters) const |
|
OffsetValueType | ComputeParameterOffsetFromVirtualPoint (const VirtualPointType &point, const NumberOfParametersType &numberOfLocalParameters) const |
|
virtual const FixedTransformType * | GetFixedTransform () const |
|
virtual FixedTransformType * | GetModifiableFixedTransform () |
|
virtual MovingTransformType * | GetModifiableMovingTransform () |
|
virtual VirtualImageType * | GetModifiableVirtualImage () |
|
virtual const MovingTransformType * | GetMovingTransform () const |
|
virtual NumberOfParametersType | GetNumberOfLocalParameters () const override |
|
virtual NumberOfParametersType | GetNumberOfParameters () const override |
|
virtual SizeValueType | GetNumberOfValidPoints () const |
|
virtual const ParametersType & | GetParameters () const override |
|
const MovingTransformType * | GetTransform () |
|
VirtualDirectionType | GetVirtualDirection () const |
|
virtual const TimeStamp & | GetVirtualDomainTimeStamp () const |
|
virtual const VirtualImageType * | GetVirtualImage () const |
|
VirtualOriginType | GetVirtualOrigin () const |
|
const VirtualRegionType & | GetVirtualRegion () const |
|
VirtualSpacingType | GetVirtualSpacing () const |
|
virtual bool | HasLocalSupport () const override |
|
virtual void | SetFixedTransform (FixedTransformType *_arg) |
|
virtual void | SetMovingTransform (MovingTransformType *_arg) |
|
virtual void | SetParameters (ParametersType ¶ms) override |
|
void | SetTransform (MovingTransformType *transform) |
|
void | SetVirtualDomain (const VirtualSpacingType &spacing, const VirtualOriginType &origin, const VirtualDirectionType &direction, const VirtualRegionType ®ion) |
|
void | SetVirtualDomainFromImage (const VirtualImageType *virtualImage) |
|
virtual void | UpdateTransformParameters (const DerivativeType &derivative, TInternalComputationValueTypefactor) override |
|
bool | IsInsideVirtualDomain (const VirtualPointType &point) const |
|
bool | IsInsideVirtualDomain (const VirtualIndexType &index) const |
|
MeasureType | GetCurrentValue () const |
|
virtual GradientSourceType | GetGradientSource () const |
|
bool | GetGradientSourceIncludesFixed () const |
|
bool | GetGradientSourceIncludesMoving () const |
|
virtual void | GetValueAndDerivative (MeasureType &value, DerivativeType &derivative) const override=0 |
|
virtual void | SetGradientSource (GradientSourceType _arg) |
|
virtual const ObjectType * | GetFixedObject () const |
|
virtual const ObjectType * | GetMovingObject () const |
|
virtual void | GetValueAndDerivative (MeasureType &value, DerivativeType &derivative) const =0 |
|
unsigned long | AddObserver (const EventObject &event, Command *) |
|
unsigned long | AddObserver (const EventObject &event, Command *) const |
|
virtual void | DebugOff () const |
|
virtual void | DebugOn () const |
|
Command * | GetCommand (unsigned long tag) |
|
bool | GetDebug () const |
|
MetaDataDictionary & | GetMetaDataDictionary () |
|
const MetaDataDictionary & | GetMetaDataDictionary () const |
|
virtual ModifiedTimeType | GetMTime () const |
|
virtual const TimeStamp & | GetTimeStamp () const |
|
bool | HasObserver (const EventObject &event) const |
|
void | InvokeEvent (const EventObject &) |
|
void | InvokeEvent (const EventObject &) const |
|
virtual void | Modified () const |
|
virtual void | Register () const override |
|
void | RemoveAllObservers () |
|
void | RemoveObserver (unsigned long tag) |
|
void | SetDebug (bool debugFlag) const |
|
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
|
virtual void | SetReferenceCount (int) override |
|
virtual void | UnRegister () const noexceptoverride |
|
virtual void | SetObjectName (std::string _arg) |
|
virtual const std::string & | GetObjectName () const |
|
virtual void | Delete () |
|
virtual int | GetReferenceCount () const |
|
| itkCloneMacro (Self) |
|
void | Print (std::ostream &os, Indent indent=0) const |
|