18 #ifndef itkImageToImageMetricv4_h
19 #define itkImageToImageMetricv4_h
167 template<
typename TFixedImage,
typename TMovingImage,
typename TVirtualImage = TFixedImage,
168 typename TInternalComputationValueType = double,
169 typename TMetricTraits = DefaultImageToImageMetricTraitsv4< TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType >
172 :
public ObjectToObjectMetric<TFixedImage::ImageDimension, TMovingImage::ImageDimension, TVirtualImage, TInternalComputationValueType>
326 typedef typename FixedImageGradientFilterType::Pointer
328 typedef typename MovingImageGradientFilterType::Pointer
338 typedef typename MetricTraits::FixedImageGradientCalculatorType
340 typedef typename MetricTraits::MovingImageGradientCalculatorType
343 typedef typename FixedImageGradientCalculatorType::Pointer
345 typedef typename MovingImageGradientCalculatorType::Pointer
367 if( image != ITK_NULLPTR )
373 itkExceptionMacro(
"Incorrect object type. Should be an image." )
382 if( image != ITK_NULLPTR )
388 itkExceptionMacro(
"Incorrect object type. Should be an image." )
435 itkSetMacro(UseFixedSampledPointSet,
bool);
436 itkGetConstReferenceMacro(UseFixedSampledPointSet,
bool);
437 itkBooleanMacro(UseFixedSampledPointSet);
459 itkSetMacro(UseFixedImageGradientFilter,
bool);
460 itkGetConstReferenceMacro(UseFixedImageGradientFilter,
bool);
461 itkBooleanMacro(UseFixedImageGradientFilter);
465 itkSetMacro(UseMovingImageGradientFilter,
bool);
466 itkGetConstReferenceMacro(UseMovingImageGradientFilter,
bool);
467 itkBooleanMacro(UseMovingImageGradientFilter);
528 itkSetMacro(UseFloatingPointCorrection,
bool);
529 itkGetConstReferenceMacro(UseFloatingPointCorrection,
bool);
530 itkBooleanMacro(UseFloatingPointCorrection);
565 itkGetConstReferenceMacro(NumberOfSkippedFixedSampledPoints,
SizeValueType);
658 itkGetConstMacro( ComputeDerivative,
bool );
680 typename DefaultFixedImageGradientFilter::Pointer
682 typename DefaultMovingImageGradientFilter::Pointer
687 typename DefaultFixedImageGradientCalculator::Pointer
689 typename DefaultMovingImageGradientCalculator::Pointer
730 typename FixedTransformType::OutputPointType &mappedFixedPoint)
const
735 template <
typename TVirtualPo
int>
737 typename FixedTransformType::OutputPointType &mappedFixedPoint)
const
739 typename FixedTransformType::OutputPointType localVirtualPoint;
742 localVirtualPoint.CastFrom(virtualPoint);
744 mappedFixedPoint = this->
m_FixedTransform->TransformPoint( localVirtualPoint );
747 template <
typename TFixedImagePo
int>
749 TFixedImagePoint &mappedFixedPoint)
const
751 typename FixedTransformType::OutputPointType localMappedFixedPoint;
752 localMappedFixedPoint.CastFrom(mappedFixedPoint);
753 localMappedFixedPoint = this->
m_FixedTransform->TransformPoint( virtualPoint );
754 mappedFixedPoint.CastFrom(localMappedFixedPoint);
757 template <
typename TVirtualPo
int,
typename TFixedImagePo
int>
759 TFixedImagePoint &mappedFixedPoint)
const
761 typename FixedTransformType::OutputPointType localVirtualPoint;
762 typename FixedTransformType::OutputPointType localMappedFixedPoint;
764 localVirtualPoint.CastFrom(virtualPoint);
765 localMappedFixedPoint.CastFrom(mappedFixedPoint);
767 localMappedFixedPoint = this->
m_FixedTransform->TransformPoint( localVirtualPoint );
768 mappedFixedPoint.CastFrom(localMappedFixedPoint);
793 #ifdef ITK_USE_CONCEPT_CHECKING
798 #endif // ITK_USE_CONCEPT_CHECKING
804 #ifndef ITK_MANUAL_INSTANTIATION
805 #include "itkImageToImageMetricv4.hxx"
FixedImageMaskConstPointer m_FixedImageMask
MovingImagePixelType MovingPixelType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
void LocalTransformPoint(const typename FixedTransformType::OutputPointType &virtualPoint, typename FixedTransformType::OutputPointType &mappedFixedPoint) const
void LocalTransformPoint(const TVirtualPoint &virtualPoint, typename FixedTransformType::OutputPointType &mappedFixedPoint) const
MetricTraits::DefaultMovingImageGradientCalculator DefaultMovingImageGradientCalculator
Superclass::VirtualSpacingType VirtualSpacingType
virtual void ComputeMovingImageGradientFilterImage() const
Superclass::VirtualRegionType VirtualRegionType
Superclass::ParametersType ParametersType
SizeValueType GetNumberOfDomainPoints() const
Transform< TInternalComputationValueType, TVirtualImage::ImageDimension, TMovingDimension > MovingTransformType
SpatialObject< itkGetStaticConstMacro(MovingImageDimension) > MovingImageMaskType
MetricTraits::MovingRealType MovingRealType
virtual ThreadIdType GetMaximumNumberOfThreads() const
Superclass::VirtualPointSetType VirtualPointSetType
virtual void ComputeMovingImageGradientAtPoint(const MovingImagePointType &mappedPoint, MovingImageGradientType &gradient) const
ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_SparseGetValueAndDerivativeThreader
Superclass::DimensionType DimensionType
MovingTransformType::InputPointType MovingInputPointType
Light weight base class for most itk classes.
Superclass::MovingTransformJacobianType MovingTransformJacobianType
PointSet< typename FixedImageType::PixelType, itkGetStaticConstMacro(FixedImageDimension)> FixedSampledPointSetType
virtual void InitializeThread(const ThreadIdType)
bool TransformAndEvaluateFixedPoint(const VirtualPointType &virtualPoint, FixedImagePointType &mappedFixedPoint, FixedImagePixelType &mappedFixedPixelValue) const
Superclass::VirtualPointType VirtualOriginType
Superclass::JacobianType JacobianType
Superclass::MeasureType MeasureType
TPixelType::ValueType ValueType
LinearInterpolateImageFunction< FixedImageGradientImageType, CoordinateRepresentationType > FixedImageGradientInterpolatorType
FixedImagePixelType FixedPixelType
bool m_UseFixedSampledPointSet
Superclass::VirtualIndexType VirtualIndexType
Superclass::FixedTransformPointer FixedTransformPointer
MovingImageGradientFilterType::Pointer MovingImageGradientFilterPointer
virtual void ComputeFixedImageGradientFilterImage()
VirtualImageType::PixelType VirtualPixelType
MetricTraits::MovingGradientPixelType MovingGradientPixelType
virtual void SetMaximumNumberOfThreads(const ThreadIdType threads)
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Superclass::ParametersValueType ParametersValueType
Superclass::FixedTransformType FixedTransformType
DefaultFixedImageGradientCalculator::Pointer m_DefaultFixedImageGradientCalculator
Superclass::MovingTransformType MovingTransformType
Superclass::VirtualPixelType VirtualPixelType
MetricTraits::FixedGradientPixelType FixedGradientPixelType
SmartPointer< const Self > ConstPointer
MovingTransformType::ParametersType MovingTransformParametersType
TMovingImage MovingImageType
void operator=(const Self &)
MetricTraits::DefaultFixedImageGradientFilter DefaultFixedImageGradientFilter
DefaultMovingImageGradientFilter::Pointer m_DefaultMovingImageGradientFilter
FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
Transform< TInternalComputationValueType, TVirtualImage::ImageDimension, TFixedDimension > FixedTransformType
Superclass::VirtualImagePointer VirtualImagePointer
FixedTransformType::Pointer FixedTransformPointer
Class for partitioning of an ImageRegion.
virtual void SetFixedObject(const ObjectType *object) override
bool m_UseFloatingPointCorrection
virtual void SetMovingObject(const ObjectType *object) override
FixedImageGradientCalculatorPointer m_FixedImageGradientCalculator
TInternalComputationValueType ParametersValueType
SizeValueType m_NumberOfSkippedFixedSampledPoints
CovariantVector< typename VirtualImageGradientType::ValueType, VirtualImageDimension > VirtualImageComponentGradientType
MovingInterpolatorType::Pointer MovingInterpolatorPointer
virtual void InitializeDefaultMovingImageGradientFilter()
void LocalTransformPoint(const TVirtualPoint &virtualPoint, TFixedImagePoint &mappedFixedPoint) const
PixelTraits< FixedImagePixelType >::ValueType FixedImagePixelValueType
Superclass::DimensionType ImageDimensionType
DefaultFixedImageGradientFilter::Pointer m_DefaultFixedImageGradientFilter
bool m_HaveMadeGetValueWarning
MovingImageGradientFilterPointer m_MovingImageGradientFilter
Computes similarity between regions of two objects.
ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< VirtualImageDimension >, Self >::Pointer m_DenseGetValueAndDerivativeThreader
Superclass::NumberOfParametersType NumberOfParametersType
MetricTraits::FixedImageGradientType FixedImageGradientType
MovingImageType::ConstPointer MovingImageConstPointer
virtual void SetFixedImage(const FixedImageType *_arg)
virtual MeasureType GetValue() const override
Superclass::VirtualDirectionType VirtualDirectionType
MetricTraits::FixedImageGradientFilterType FixedImageGradientFilterType
virtual void Initialize(void) override
void LocalTransformPoint(const typename FixedTransformType::OutputPointType &virtualPoint, TFixedImagePoint &mappedFixedPoint) const
Superclass::MovingOutputPointType MovingOutputPointType
unsigned long SizeValueType
DerivativeType::ValueType DerivativeValueType
Superclass::ParametersType ParametersType
LinearInterpolateImageFunction< MovingImageGradientImageType, CoordinateRepresentationType > MovingImageGradientInterpolatorType
TInternalComputationValueType CoordinateRepresentationType
VirtualPointSetType::Pointer VirtualPointSetPointer
MetricTraits::FixedRealType FixedRealType
Superclass::MovingTransformParametersType MovingTransformParametersType
DerivativeType * m_DerivativeResult
Superclass::Object ObjectType
MetricTraits::DefaultMovingImageGradientFilter DefaultMovingImageGradientFilter
FixedTransformType::OutputPointType FixedOutputPointType
VirtualImageType::SpacingType VirtualSpacingType
VirtualImageType::IndexType VirtualIndexType
FixedImageGradientFilterType::Pointer FixedImageGradientFilterPointer
FixedImageType::PixelType FixedImagePixelType
MetricTraits::FixedImageGradientImageType FixedImageGradientImageType
SpatialObject< itkGetStaticConstMacro(FixedImageDimension) > FixedImageMaskType
FixedTransformType::ParametersType FixedTransformParametersType
FixedImageType::IndexType FixedImageIndexType
CovariantVector< typename MovingImageGradientType::ValueType, MovingImageDimension > MovingImageComponentGradientType
PixelTraits< MovingImagePixelType >::ValueType MovingImagePixelValueType
void MapFixedSampledPointSetToVirtual()
VirtualImageType::RegionType VirtualRegionType
MetricTraits m_MetricTraits
MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
bool m_UseFixedImageGradientFilter
Superclass::VirtualPointType VirtualPointType
Superclass::MetricCategoryType MetricCategoryType
SizeValueType m_NumberOfValidPoints
NumericTraits< MovingRealType >::ScalarRealType MovingScalarRealType
FixedImageGradientImageType::Pointer FixedImageGradientImagePointer
virtual ~ImageToImageMetricv4()
FixedTransformType::InputPointType FixedInputPointType
FixedImageGradientImagePointer m_FixedImageGradientImage
Superclass::VirtualPointSetPointer VirtualPointSetPointer
FixedInterpolatorPointer m_FixedInterpolator
FixedImageGradientCalculatorType::Pointer FixedImageGradientCalculatorPointer
VirtualPointSetPointer m_VirtualSampledPointSet
MovingImageGradientImagePointer m_MovingImageGradientImage
bool TransformAndEvaluateMovingPoint(const VirtualPointType &virtualPoint, MovingImagePointType &mappedMovingPoint, MovingImagePixelType &mappedMovingPixelValue) const
static const DimensionType VirtualDimension
FixedImageMaskType::Pointer FixedImageMaskPointer
virtual void GetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const override
MovingImageGradientCalculatorType::Pointer MovingImageGradientCalculatorPointer
Superclass::DerivativeType DerivativeType
Superclass::MeasureType MeasureType
TInternalComputationValueType InternalComputationValueType
VirtualImageType::DirectionType VirtualDirectionType
Implementation of the composite pattern.
MetricTraits::MovingImageGradientFilterType MovingImageGradientFilterType
Superclass::FixedTransformJacobianType FixedTransformJacobianType
MovingImageGradientInterpolatorType::Pointer m_MovingImageGradientInterpolator
Superclass::MetricCategoryType MetricCategoryType
Superclass::DerivativeType DerivativeType
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
FixedSampledPointSetConstPointer m_FixedSampledPointSet
static const DimensionType MovingImageDimension
static const DimensionType MovingDimension
MovingTransformType::JacobianType MovingTransformJacobianType
MovingImageMaskConstPointer m_MovingImageMask
Standard exception handling object.
virtual void InitializeForIteration() const
FixedImageType::Pointer FixedImagePointer
FixedTransformPointer m_FixedTransform
virtual MetricCategoryType GetMetricCategory() const override
Superclass::FixedTransformParametersType FixedTransformParametersType
MovingInterpolatorPointer m_MovingInterpolator
VirtualImageType::PointType VirtualPointType
ObjectToObjectMetric< TFixedImage::ImageDimension, TMovingImage::ImageDimension, TVirtualImage, TInternalComputationValueType > Superclass
MetricTraits::MovingImageGradientCalculatorType MovingImageGradientCalculatorType
Superclass::MovingTransformPointer MovingTransformPointer
Partitions an indexed container.
NumericTraits< FixedRealType >::ScalarRealType FixedScalarRealType
InterpolateImageFunction< MovingImageType, CoordinateRepresentationType > MovingInterpolatorType
DerivativeType::ValueType DerivativeValueType
virtual void SetMovingImage(const MovingImageType *_arg)
FixedImageConstPointer m_FixedImage
Linearly interpolate an image at specified positions.
unsigned int ThreadIdType
MovingImageType::IndexType MovingImageIndexType
MovingImageType::PixelType MovingImagePixelType
TInternalComputationValueType CoordinateRepresentationType
Superclass::MovingInputPointType MovingInputPointType
virtual void ComputeFixedImageGradientAtPoint(const FixedImagePointType &mappedPoint, FixedImageGradientType &gradient) const
InterpolateImageFunction< FixedImageType, CoordinateRepresentationType > FixedInterpolatorType
Base class for all image interpolaters.
bool m_UseMovingImageGradientFilter
SmartPointer< Self > Pointer
void PrintSelf(std::ostream &os, Indent indent) const override
virtual bool SupportsArbitraryVirtualDomainSamples(void) const override
VirtualRegionType::SizeType VirtualSizeType
MovingImageType::PointType MovingImagePointType
MetricTraits::VirtualImageGradientType VirtualImageGradientType
FixedTransformType::JacobianType JacobianType
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
MovingImageMaskType::Pointer MovingImageMaskPointer
Superclass::FixedOutputPointType FixedOutputPointType
virtual void FinalizeThread(const ThreadIdType)
FixedInterpolatorType::Pointer FixedInterpolatorPointer
DerivativeValueType m_FloatingPointCorrectionResolution
MovingTransformType::OutputPointType MovingOutputPointType
MetricTraits::MovingImageGradientType MovingImageGradientType
static const DimensionType FixedDimension
FixedSampledPointSetType::Pointer FixedSampledPointSetPointer
Control indentation during Print() invocation.
virtual void InitializeDefaultFixedImageGradientFilter()
MovingImageConstPointer m_MovingImage
MovingTransformType::Pointer MovingTransformPointer
PointSet< VirtualPixelType, itkGetStaticConstMacro(VirtualDimension)> VirtualPointSetType
TVirtualImage VirtualImageType
CovariantVector< typename FixedImageGradientType::ValueType, FixedImageDimension > FixedImageComponentGradientType
FixedImageType::ConstPointer FixedImageConstPointer
virtual void GetDerivative(DerivativeType &) const override
MovingImageType::Pointer MovingImagePointer
FixedImageGradientInterpolatorType::Pointer m_FixedImageGradientInterpolator
MovingImageType::RegionType MovingImageRegionType
virtual SizeValueType GetNumberOfValidPoints() const override
ImageToImageMetricv4 Self
static const DimensionType FixedImageDimension
FixedImageType::PointType FixedImagePointType
MovingImageGradientImageType::Pointer MovingImageGradientImagePointer
static const DimensionType VirtualImageDimension
Base class for most ITK classes.
#define itkConceptMacro(name, concept)
TFixedImage FixedImageType
A templated class holding a n-Dimensional covariant vector.
MetricTraits::MovingImageGradientImageType MovingImageGradientImageType
Superclass::VirtualSizeType VirtualRadiusType
MetricTraits::DefaultFixedImageGradientCalculator DefaultFixedImageGradientCalculator
virtual void GetValueAndDerivativeExecute() const
TMetricTraits MetricTraits
virtual ThreadIdType GetNumberOfThreadsUsed() const
Superclass::ObjectType ObjectType
Superclass::VirtualSizeType VirtualSizeType
Superclass::FixedInputPointType FixedInputPointType
FixedTransformType::JacobianType FixedTransformJacobianType
SizeValueType DimensionType
MovingImageGradientCalculatorPointer m_MovingImageGradientCalculator
DefaultMovingImageGradientCalculator::Pointer m_DefaultMovingImageGradientCalculator
Superclass::NumberOfParametersType NumberOfParametersType
MetricTraits::FixedImageGradientCalculatorType FixedImageGradientCalculatorType
FixedImageGradientFilterPointer m_FixedImageGradientFilter
Superclass::VirtualImageType VirtualImageType
Superclass::GradientSourceType GradientSourceType
FixedSampledPointSetType::ConstPointer FixedSampledPointSetConstPointer
VirtualImageType::Pointer VirtualImagePointer
Superclass::GradientSourceType GradientSourceType