18 #ifndef itkImageToImageMetric_h
19 #define itkImageToImageMetric_h
50 template<
typename TFixedImage,
typename TMovingImage >
81 TMovingImage::ImageDimension);
84 TFixedImage::ImageDimension);
171 itkGetConstReferenceMacro(NumberOfPixelsCounted,
SizeValueType);
197 itkGetConstReferenceMacro(UseFixedImageIndexes,
bool);
201 itkGetConstReferenceMacro(NumberOfThreads,
ThreadIdType);
236 itkGetConstReferenceMacro(NumberOfFixedImageSamples,
SizeValueType);
259 itkGetConstReferenceMacro(UseFixedImageSamplesIntensityThreshold,
bool);
276 itkGetConstReferenceMacro(UseAllPixels,
bool);
284 itkGetConstReferenceMacro(UseSequentialSampling,
bool);
315 itkSetMacro(UseCachingOfBSplineWeights,
bool);
316 itkGetConstReferenceMacro(UseCachingOfBSplineWeights,
bool);
317 itkBooleanMacro(UseCachingOfBSplineWeights);
333 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
430 FixedImageType ::ImageDimension,
484 bool & sampleWithinSupportRegion,
485 double & movingImageValue,
490 bool & sampleWithinSupportRegion,
491 double & movingImageValue,
539 bool itkNotUsed(withinSampleThread) )
const
545 double itkNotUsed(movingImageValue) )
const
549 bool itkNotUsed(withinSampleThread) )
const
568 bool itkNotUsed(withinSampleThread) )
const
574 double itkNotUsed(movingImageValue),
579 bool itkNotUsed(withinSampleThread) )
const
589 void operator=(const
Self &) ITK_DELETE_FUNCTION;
595 #ifndef ITK_MANUAL_INSTANTIATION
596 #include "itkImageToImageMetric.hxx"
virtual bool GetValueAndDerivativeThreadProcessSample(ThreadIdType, SizeValueType, const MovingImagePointType &, double, const ImageDerivativesType &) const
virtual void GetValueThreadPostProcess(ThreadIdType, bool) const
unsigned int * m_ThreaderNumberOfMovingImageSamples
TransformType::OutputPointType OutputPointType
virtual void GetValueThreadPreProcess(ThreadIdType, bool) const
BSplineTransformIndexArrayType m_BSplineTransformIndices
static ITK_THREAD_RETURN_TYPE GetValueMultiThreaded(void *arg)
This class is a base for the CostFunctions returning a single value.
FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
TransformPointer m_Transform
static ITK_THREAD_RETURN_TYPE GetValueAndDerivativeMultiThreadedPreProcess(void *arg)
std::vector< FixedImageIndexType > FixedImageIndexContainer
void GetValueMultiThreadedPreProcessInitiate() const
bool m_WithinThreadPostProcess
virtual void MultiThreadingInitialize(void)
static const unsigned int FixedImageDimension
BSplineTransformType::WeightsType BSplineTransformWeightsType
MovingImageMaskConstPointer m_MovingImageMask
Superclass::ParametersValueType CoordinateRepresentationType
static ITK_THREAD_RETURN_TYPE GetValueMultiThreadedPreProcess(void *arg)
virtual void ComputeGradient()
TransformType::InputPointType InputPointType
virtual void GetValueAndDerivativeThreadPreProcess(ThreadIdType, bool) const
virtual void GetValueThread(ThreadIdType threadId) const
void SetNumberOfSpatialSamples(SizeValueType num)
signed long IndexValueType
Array2D< WeightsValueType > BSplineTransformWeightsArrayType
void SetFixedImageIndexes(const FixedImageIndexContainer &indexes)
BSplineParametersOffsetType m_BSplineParametersOffset
virtual void SetFixedImageRegion(const FixedImageRegionType reg)
FixedImageIndexContainer m_FixedImageIndexes
TransformType::Pointer TransformPointer
FixedArray< SizeValueType, FixedImageType::ImageDimension > BSplineParametersOffsetType
CovariantVector< double, itkGetStaticConstMacro(MovingImageDimension) > ImageDerivativesType
TransformPointer * m_ThreaderTransform
SizeValueType GetNumberOfSpatialSamples(void)
bool m_UseFixedImageIndexes
BSplineTransformType::Pointer m_BSplineTransform
BSplineTransformWeightsArrayType m_BSplineTransformWeightsArray
NumericTraits< MovingImagePixelType >::RealType RealType
BSplineTransformIndicesArrayType m_BSplineTransformIndicesArray
void SetNumberOfThreads(ThreadIdType numberOfThreads)
std::vector< MovingImagePointType > MovingImagePointArrayType
FixedImageType::IndexType FixedImageIndexType
BSplineTransformWeightsType m_BSplineTransformWeights
FixedImagePointType point
Computes the gradient of an image by convolution with the first derivative of a Gaussian.
Superclass::DerivativeType DerivativeType
MovingImageType::ConstPointer MovingImageConstPointer
Calculate the derivative by central differencing.
virtual void Initialize(void)
MultiThreader MultiThreaderType
SizeValueType m_NumberOfPixelsCounted
TransformType::OutputPointType MovingImagePointType
MultiThreaderParameterType m_ThreaderParameter
unsigned long SizeValueType
void GetValueMultiThreadedInitiate() const
#define ITK_THREAD_RETURN_TYPE
MovingImageConstPointer m_MovingImage
void Fill(const ValueType &)
const TransformPointer * GetThreaderTransform()
Simulate a standard C array with copy semnatics.
FixedImageSampleContainer m_FixedImageSamples
MovingImagePointArrayType m_BSplinePreTransformPointsArray
ImageToImageMetric * metric
virtual void TransformPoint(unsigned int sampleNumber, MovingImagePointType &mappedPoint, bool &sampleWithinSupportRegion, double &movingImageValue, ThreadIdType threadId) const
TMovingImage::PixelType MovingImagePixelType
virtual void ComputeImageDerivatives(const MovingImagePointType &mappedPoint, ImageDerivativesType &gradient, ThreadIdType threadId) const
CentralDifferenceImageFunction< MovingImageType, CoordinateRepresentationType > DerivativeFunctionType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
TFixedImage FixedImageType
Array< ParametersValueType > DerivativeType
FixedImageIndexType::IndexValueType FixedImageIndexValueType
Array2D class representing a 2D array with size defined at construction time.
SizeValueType m_NumberOfParameters
void SetUseSequentialSampling(bool sequentialSampling)
BooleanArrayType m_WithinBSplineSupportRegionArray
Class to hold and manage different parameter types used during optimization.
SpatialObject< itkGetStaticConstMacro(FixedImageDimension) > FixedImageMaskType
TMovingImage MovingImageType
Superclass::ParametersType ParametersType
BSplineBaseTransform< CoordinateRepresentationType, FixedImageType::ImageDimension, itkGetStaticConstMacro(DeformationSplineOrder) > BSplineTransformType
SmartPointer< const Self > ConstPointer
Implementation of the composite pattern.
FixedImageConstPointer m_FixedImage
Standard exception handling object.
virtual void SampleFullFixedImageRegion(FixedImageSampleContainer &samples) const
InterpolatorPointer m_Interpolator
ThreadIdType m_NumberOfThreads
BSplineTransformIndexArrayType::ValueType IndexValueType
GradientImagePointer m_GradientImage
void SetFixedImageSamplesIntensityThreshold(const FixedImagePixelType &thresh)
MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
virtual bool GetValueThreadProcessSample(ThreadIdType, SizeValueType, const MovingImagePointType &, double) const
BSplineTransformWeightsType * m_ThreaderBSplineTransformWeights
virtual void PreComputeTransformValues()
void SetUseFixedImageIndexes(bool useIndex)
unsigned int ThreadIdType
void GetValueAndDerivativeMultiThreadedPreProcessInitiate() const
std::vector< FixedImageSamplePoint > FixedImageSampleContainer
void GetValueAndDerivativeMultiThreadedInitiate() const
Superclass::ParametersType ParametersType
SmartPointer< GradientImageType > GradientImagePointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType > BSplineInterpolatorType
SingleValuedCostFunction Superclass
Image< GradientPixelType, itkGetStaticConstMacro(MovingImageDimension) > GradientImageType
SizeValueType GetNumberOfMovingImageSamples(void)
Base class for all image interpolaters.
SpatialObject< itkGetStaticConstMacro(MovingImageDimension) > MovingImageMaskType
BSplineInterpolatorType::Pointer m_BSplineInterpolator
bool m_UseSequentialSampling
InterpolatorType::Pointer InterpolatorPointer
virtual void SampleFixedImageRegion(FixedImageSampleContainer &samples) const
TransformType::JacobianType TransformJacobianType
FixedImageMaskConstPointer m_FixedImageMask
DerivativeFunctionType::Pointer m_DerivativeCalculator
FixedImageMaskType::Pointer FixedImageMaskPointer
virtual unsigned int GetNumberOfParameters(void) const override
FixedImageRegionType m_FixedImageRegion
MovingImageMaskType::Pointer MovingImageMaskPointer
void UseAllPixelsOff(void)
virtual void SynchronizeTransforms() const
bool m_UseCachingOfBSplineWeights
FixedImagePixelType m_FixedImageSamplesIntensityThreshold
bool m_UseFixedImageSamplesIntensityThreshold
BSplineTransformWeightsType::ValueType WeightsValueType
static ITK_THREAD_RETURN_TYPE GetValueAndDerivativeMultiThreadedPostProcess(void *arg)
Superclass::ParametersValueType ParametersValueType
InterpolateImageFunction< MovingImageType, CoordinateRepresentationType > InterpolatorType
bool m_TransformIsBSpline
Control indentation during Print() invocation.
FixedImageType::ConstPointer FixedImageConstPointer
TFixedImage::PixelType FixedImagePixelType
static ITK_THREAD_RETURN_TYPE GetValueMultiThreadedPostProcess(void *arg)
TransformType::InputPointType FixedImagePointType
virtual const SizeValueType & GetNumberOfFixedImageSamples() const
virtual void SetNumberOfFixedImageSamples(SizeValueType numSamples)
void SetUseFixedImageSamplesIntensityThreshold(bool useThresh)
void GetValueAndDerivativeMultiThreadedPostProcessInitiate() const
virtual void GetValueAndDerivativeThreadPostProcess(ThreadIdType, bool) const
Evaluates the B-Spline interpolation of an image. Spline order may be from 0 to 5.
BSplineTransformIndexArrayType * m_ThreaderBSplineTransformIndices
Array2D< IndexValueType > BSplineTransformIndicesArrayType
void SetTransformParameters(const ParametersType ¶meters) const
Superclass::MeasureType MeasureType
CovariantVector< RealType, itkGetStaticConstMacro(MovingImageDimension) > GradientPixelType
static const unsigned int MovingImageDimension
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(MovingImageDimension), itkGetStaticConstMacro(FixedImageDimension) > TransformType
SizeValueType m_NumBSplineWeights
virtual void SampleFixedImageIndexes(FixedImageSampleContainer &samples) const
Computes similarity between regions of two images.
virtual const SizeValueType & GetNumberOfPixelsCounted() const
MovingImageType::IndexType MovingImageIndexType
bool m_WithinThreadPreProcess
A templated class holding a geometric point in n-Dimensional space.
bool m_InterpolatorIsBSpline
A templated class holding a n-Dimensional covariant vector.
virtual void GetValueAndDerivativeThread(ThreadIdType threadId) const
TransformType::ParametersType TransformParametersType
GradientRecursiveGaussianImageFilter< MovingImageType, GradientImageType > GradientImageFilterType
static ITK_THREAD_RETURN_TYPE GetValueAndDerivativeMultiThreaded(void *arg)
Templated n-dimensional image class.
SmartPointer< Self > Pointer
MultiThreaderType::Pointer m_Threader
void GetValueMultiThreadedPostProcessInitiate() const
FixedImageType::RegionType FixedImageRegionType
std::vector< bool > BooleanArrayType
virtual ~ImageToImageMetric()
virtual void TransformPointWithDerivatives(unsigned int sampleNumber, MovingImagePointType &mappedPoint, bool &sampleWithinSupportRegion, double &movingImageValue, ImageDerivativesType &gradient, ThreadIdType threadId) const
static const unsigned int DeformationSplineOrder
BSplineTransformType::ParameterIndexArrayType BSplineTransformIndexArrayType
GradientImageFilterType::Pointer GradientImageFilterPointer
void SetUseAllPixels(bool useAllPixels)
SizeValueType m_NumberOfFixedImageSamples
void UseAllPixelsOn(void)