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 component 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 96 of file itkObjectToObjectMultiMetricv4.h.
|
using | ConstPointer = SmartPointer< const Self > |
|
using | MetricBaseConstPointer = typename MetricType::ConstPointer |
|
using | MetricBasePointer = typename MetricType::Pointer |
|
using | MetricQueueType = std::deque< MetricBasePointer > |
|
using | MetricType = Superclass |
|
using | MetricValueArrayType = Array< MeasureType > |
|
using | ObjectType = typename Superclass::ObjectType |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = ObjectToObjectMultiMetricv4 |
|
using | Superclass = ObjectToObjectMetric< TFixedDimension, TMovingDimension, TVirtualImage, TInternalComputationValueType > |
|
using | WeightsArrayType = Array< WeightValueType > |
|
using | WeightValueType = typename DerivativeType::ValueType |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | CoordinateRepresentationType = double |
|
using | DimensionType = SizeValueType |
|
using | FixedInputPointType = typename FixedTransformType::InputPointType |
|
using | FixedOutputPointType = typename FixedTransformType::OutputPointType |
|
using | FixedTransformJacobianType = typename FixedTransformType::JacobianType |
|
using | FixedTransformParametersType = typename FixedTransformType::ParametersType |
|
using | FixedTransformPointer = typename FixedTransformType::Pointer |
|
using | FixedTransformType = Transform< double, TVirtualImage::ImageDimension, TFixedDimension > |
|
using | InternalComputationValueType = double |
|
using | JacobianType = typename FixedTransformType::JacobianType |
|
using | MetricCategoryType = typename Superclass::MetricCategoryEnum |
|
using | MovingDisplacementFieldTransformType = DisplacementFieldTransform< CoordinateRepresentationType, Self::MovingDimension > |
|
using | MovingInputPointType = typename MovingTransformType::InputPointType |
|
using | MovingOutputPointType = typename MovingTransformType::OutputPointType |
|
using | MovingTransformJacobianType = typename MovingTransformType::JacobianType |
|
using | MovingTransformParametersType = typename MovingTransformType::ParametersType |
|
using | MovingTransformPointer = typename MovingTransformType::Pointer |
|
using | MovingTransformType = Transform< double, TVirtualImage::ImageDimension, TMovingDimension > |
|
using | ObjectType = typename Superclass::Object |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = ObjectToObjectMetric |
|
using | Superclass = ObjectToObjectMetricBaseTemplate< double > |
|
using | VirtualDirectionType = typename VirtualImageType::DirectionType |
|
using | VirtualImageConstPointer = typename VirtualImageType::ConstPointer |
|
using | VirtualImagePointer = typename VirtualImageType::Pointer |
|
using | VirtualImageType = Image< double, TFixedDimension > |
|
using | VirtualIndexType = typename VirtualImageType::IndexType |
|
using | VirtualOriginType = typename VirtualImageType::PointType |
|
using | VirtualPixelType = typename VirtualImageType::PixelType |
|
using | VirtualPointSetPointer = typename VirtualPointSetType::Pointer |
|
using | VirtualPointSetType = PointSet< VirtualPixelType, Self::VirtualDimension > |
|
using | VirtualPointType = typename VirtualImageType::PointType |
|
using | VirtualRadiusType = typename VirtualImageType::SizeType |
|
using | VirtualRegionType = typename VirtualImageType::RegionType |
|
using | VirtualSizeType = typename VirtualRegionType::SizeType |
|
using | VirtualSpacingType = typename VirtualImageType::SpacingType |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | CoordinateRepresentationType = double |
|
using | DerivativeValueType = typename DerivativeType::ValueType |
|
using | GradientSourceEnum = itk::ObjectToObjectMetricBaseTemplateEnums::GradientSource |
|
using | MetricCategoryEnum = itk::ObjectToObjectMetricBaseTemplateEnums::MetricCategory |
|
using | NumberOfParametersType = unsigned int |
|
using | ObjectConstPointer = typename ObjectType::ConstPointer |
|
using | ObjectType = Object |
|
using | ParametersValueType = double |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = ObjectToObjectMetricBaseTemplate |
|
using | Superclass = SingleValuedCostFunctionv4Template< double > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | DerivativeType = Array< double > |
|
using | MeasureType = double |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = SingleValuedCostFunctionv4Template |
|
using | Superclass = CostFunctionTemplate< double > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | ParametersType = OptimizerParameters< double > |
|
using | ParametersValueType = double |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = CostFunctionTemplate |
|
using | Superclass = Object |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = Object |
|
using | Superclass = LightObject |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = LightObject |
|
|
void | AddMetric (MetricType *metric) |
|
void | ClearMetricQueue () |
|
void | GetDerivative (DerivativeType &) const override |
|
MetricCategoryType | GetMetricCategory () const override |
|
const MetricQueueType & | GetMetricQueue () const |
|
virtual WeightsArrayType | GetMetricWeights () |
|
const char * | GetNameOfClass () const override |
|
SizeValueType | GetNumberOfMetrics () const |
|
MeasureType | GetValue () const override |
|
void | GetValueAndDerivative (MeasureType &firstValue, DerivativeType &derivativeResult) const override |
|
MetricValueArrayType | GetValueArray () const |
|
MeasureType | GetWeightedValue () const |
|
void | Initialize () override |
|
void | SetFixedObject (const ObjectType *) override |
|
void | SetFixedTransform (FixedTransformType *) override |
|
virtual void | SetMetricWeights (WeightsArrayType _arg) |
|
void | SetMovingObject (const ObjectType *) override |
|
void | SetMovingTransform (MovingTransformType *) override |
|
bool | SupportsArbitraryVirtualDomainSamples () const override |
|
OffsetValueType | ComputeParameterOffsetFromVirtualIndex (const VirtualIndexType &index, const NumberOfParametersType &numberOfLocalParameters) const |
|
OffsetValueType | ComputeParameterOffsetFromVirtualPoint (const VirtualPointType &point, const NumberOfParametersType &numberOfLocalParameters) const |
|
MetricCategoryType | GetMetricCategory () const override |
|
virtual FixedTransformType * | GetModifiableFixedTransform () |
|
virtual MovingTransformType * | GetModifiableMovingTransform () |
|
virtual VirtualImageType * | GetModifiableVirtualImage () |
|
const char * | GetNameOfClass () const override |
|
NumberOfParametersType | GetNumberOfLocalParameters () const override |
|
NumberOfParametersType | GetNumberOfParameters () const override |
|
virtual SizeValueType | GetNumberOfValidPoints () const |
|
const ParametersType & | GetParameters () const override |
|
const MovingTransformType * | GetTransform () |
|
VirtualDirectionType | GetVirtualDirection () const |
|
virtual const TimeStamp & | GetVirtualDomainTimeStamp () const |
|
VirtualOriginType | GetVirtualOrigin () const |
|
const VirtualRegionType & | GetVirtualRegion () const |
|
VirtualSpacingType | GetVirtualSpacing () const |
|
bool | HasLocalSupport () const override |
|
void | Initialize () override |
|
virtual void | SetFixedTransform (FixedTransformType *_arg) |
|
virtual void | SetMovingTransform (MovingTransformType *_arg) |
|
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 bool | SupportsArbitraryVirtualDomainSamples () const=0 |
|
void | UpdateTransformParameters (const DerivativeType &derivative, double factor) override |
|
bool | IsInsideVirtualDomain (const VirtualPointType &point) const |
|
bool | IsInsideVirtualDomain (const VirtualIndexType &index) const |
|
MeasureType | GetCurrentValue () const |
|
virtual void | GetDerivative (DerivativeType &) const=0 |
|
virtual GradientSourceEnum | GetGradientSource () const |
|
bool | GetGradientSourceIncludesFixed () const |
|
bool | GetGradientSourceIncludesMoving () const |
|
virtual MetricCategoryEnum | GetMetricCategory () const |
|
const char * | GetNameOfClass () const override |
|
virtual const ParametersType & | GetParameters () const=0 |
|
MeasureType | GetValue () const override=0 |
|
void | GetValueAndDerivative (MeasureType &value, DerivativeType &derivative) const override=0 |
|
virtual bool | HasLocalSupport () const=0 |
|
virtual void | Initialize ()=0 |
|
virtual void | SetGradientSource (GradientSourceEnum _arg) |
|
virtual void | SetParameters (ParametersType ¶ms)=0 |
|
virtual void | UpdateTransformParameters (const DerivativeType &derivative, ParametersValueType factor=NumericTraits< ParametersValueType >::OneValue())=0 |
|
virtual void | SetFixedObject (const ObjectType *_arg) |
|
virtual const ObjectType * | GetFixedObject () const |
|
virtual void | SetMovingObject (const ObjectType *_arg) |
|
virtual const ObjectType * | GetMovingObject () const |
|
const char * | GetNameOfClass () const override |
|
virtual MeasureType | GetValue () const=0 |
|
virtual void | GetValueAndDerivative (MeasureType &value, DerivativeType &derivative) const=0 |
|
const char * | GetNameOfClass () const override |
|
virtual unsigned int | GetNumberOfParameters () const=0 |
|
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
|
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
|
LightObject::Pointer | CreateAnother () const override |
|
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 |
|
const char * | GetNameOfClass () const override |
|
virtual const TimeStamp & | GetTimeStamp () const |
|
bool | HasObserver (const EventObject &event) const |
|
void | InvokeEvent (const EventObject &) |
|
void | InvokeEvent (const EventObject &) const |
|
virtual void | Modified () const |
|
void | Register () const override |
|
void | RemoveAllObservers () |
|
void | RemoveObserver (unsigned long tag) const |
|
void | SetDebug (bool debugFlag) const |
|
void | SetReferenceCount (int) override |
|
void | UnRegister () const noexcept override |
|
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
|
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
|
virtual void | SetObjectName (std::string _arg) |
|
virtual const std::string & | GetObjectName () const |
|
Pointer | Clone () const |
|
virtual Pointer | CreateAnother () const |
|
virtual void | Delete () |
|
virtual const char * | GetNameOfClass () const |
|
virtual int | GetReferenceCount () const |
|
void | Print (std::ostream &os, Indent indent=0) const |
|
virtual void | Register () const |
|
virtual void | SetReferenceCount (int) |
|
virtual void | UnRegister () const noexcept |
|
|
| ObjectToObjectMultiMetricv4 () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ~ObjectToObjectMultiMetricv4 () override=default |
|
const MovingDisplacementFieldTransformType * | GetMovingDisplacementFieldTransform () const |
|
| ObjectToObjectMetric () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
bool | TransformPhysicalPointToVirtualIndex (const VirtualPointType &, VirtualIndexType &) const |
|
void | TransformVirtualIndexToPhysicalPoint (const VirtualIndexType &, VirtualPointType &) const |
|
virtual void | VerifyDisplacementFieldSizeAndPhysicalSpace () |
|
bool | VerifyNumberOfValidPoints (MeasureType &value, DerivativeType &derivative) const |
|
| ~ObjectToObjectMetric () override=default |
|
| ObjectToObjectMetricBaseTemplate () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ~ObjectToObjectMetricBaseTemplate () override=default |
|
| SingleValuedCostFunctionv4Template ()=default |
|
| ~SingleValuedCostFunctionv4Template () override=default |
|
| CostFunctionTemplate ()=default |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ~CostFunctionTemplate () override=default |
|
| Object () |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
|
| ~Object () override |
|
virtual LightObject::Pointer | InternalClone () const |
|
| LightObject () |
|
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
|
virtual void | PrintSelf (std::ostream &os, Indent indent) const |
|
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
|
virtual | ~LightObject () |
|
template<unsigned int TFixedDimension, unsigned int TMovingDimension, typename TVirtualImage = Image<double, TFixedDimension>, class TInternalComputationValueType = double>
bool itk::ObjectToObjectMultiMetricv4< TFixedDimension, TMovingDimension, TVirtualImage, TInternalComputationValueType >::SupportsArbitraryVirtualDomainSamples |
( |
| ) |
const |
|
overridevirtual |