Loading...
Searching...
No Matches
itkPatternIntensityImageToImageMetric.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkPatternIntensityImageToImageMetric_h
#define itkPatternIntensityImageToImageMetric_h
#include "itkAdvancedImageToImageMetric.h"
#include "itkPoint.h"
#include "itkCastImageFilter.h"
#include "itkResampleImageFilter.h"
#include "itkMultiplyImageFilter.h"
#include "itkSubtractImageFilter.h"
#include "itkOptimizer.h"
#include "itkRescaleIntensityImageFilter.h"
#include "itkAdvancedCombinationTransform.h"
#include "itkAdvancedRayCastInterpolateImageFunction.h"
namespace itk
{
template <class TFixedImage, class TMovingImage>
class ITK_TEMPLATE_EXPORT PatternIntensityImageToImageMetric
: public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(PatternIntensityImageToImageMetric);
using Self = PatternIntensityImageToImageMetric;
using Superclass = AdvancedImageToImageMetric<TFixedImage, TMovingImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(PatternIntensityImageToImageMetric, ImageToImageMetric);
using typename Superclass::CoordinateRepresentationType;
using typename Superclass::MovingImageType;
using typename Superclass::MovingImagePixelType;
using typename Superclass::MovingImagePointer;
using typename Superclass::MovingImageConstPointer;
using typename Superclass::FixedImageType;
using typename Superclass::FixedImageConstPointer;
using typename Superclass::FixedImageRegionType;
using typename Superclass::TransformType;
using ScalarType = typename TransformType::ScalarType;
using typename Superclass::TransformPointer;
using typename Superclass::InputPointType;
using typename Superclass::OutputPointType;
using typename Superclass::TransformParametersType;
using typename Superclass::TransformJacobianType;
using typename Superclass::InterpolatorType;
using typename Superclass::InterpolatorPointer;
using typename Superclass::RealType;
using typename Superclass::GradientPixelType;
using typename Superclass::GradientImageType;
using typename Superclass::GradientImagePointer;
using typename Superclass::FixedImageMaskType;
using typename Superclass::FixedImageMaskPointer;
using typename Superclass::MovingImageMaskType;
using typename Superclass::MovingImageMaskPointer;
using typename Superclass::MeasureType;
using typename Superclass::DerivativeType;
using typename Superclass::ParametersType;
using typename Superclass::FixedImagePixelType;
using typename Superclass::MovingImageRegionType;
using typename Superclass::ImageSamplerType;
using typename Superclass::ImageSamplerPointer;
using typename Superclass::ImageSampleContainerType;
using typename Superclass::ImageSampleContainerPointer;
using typename Superclass::FixedImageLimiterType;
using typename Superclass::MovingImageLimiterType;
using typename Superclass::FixedImageLimiterOutputType;
using typename Superclass::MovingImageLimiterOutputType;
using typename Superclass::MovingImageDerivativeScalesType;
using ScalesType = typename Optimizer::ScalesType;
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
using TransformedMovingImageType = itk::Image<FixedImagePixelType, Self::FixedImageDimension>;
using CombinationTransformType = typename itk::AdvancedCombinationTransform<ScalarType, FixedImageDimension>;
using CombinationTransformPointer = typename CombinationTransformType::Pointer;
using RayCastInterpolatorType = typename itk::AdvancedRayCastInterpolateImageFunction<MovingImageType, ScalarType>;
using RayCastInterpolatorPointer = typename RayCastInterpolatorType::Pointer;
using TransformMovingImageFilterType = itk::ResampleImageFilter<MovingImageType, TransformedMovingImageType>;
using TransformMovingImageFilterPointer = typename TransformMovingImageFilterType::Pointer;
using RescaleIntensityImageFilterType =
itk::RescaleIntensityImageFilter<TransformedMovingImageType, TransformedMovingImageType>;
using RescaleIntensityImageFilterPointer = typename RescaleIntensityImageFilterType::Pointer;
using DifferenceImageFilterType =
itk::SubtractImageFilter<FixedImageType, TransformedMovingImageType, TransformedMovingImageType>;
using DifferenceImageFilterPointer = typename DifferenceImageFilterType::Pointer;
using MultiplyImageFilterType =
itk::MultiplyImageFilter<TransformedMovingImageType, TransformedMovingImageType, TransformedMovingImageType>;
using MultiplyImageFilterPointer = typename MultiplyImageFilterType::Pointer;
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
MeasureType
GetValue(const TransformParametersType & parameters) const override;
void
GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
void
GetValueAndDerivative(const TransformParametersType & parameters,
MeasureType & Value,
DerivativeType & Derivative) const override;
void
Initialize() override;
itkSetMacro(Scales, ScalesType);
itkGetConstReferenceMacro(Scales, ScalesType);
itkSetMacro(NoiseConstant, double);
itkGetConstReferenceMacro(NoiseConstant, double);
itkSetMacro(OptimizeNormalizationFactor, bool);
itkGetConstReferenceMacro(OptimizeNormalizationFactor, bool);
protected:
PatternIntensityImageToImageMetric() = default;
~PatternIntensityImageToImageMetric() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
MeasureType
ComputePIFixed() const;
MeasureType
ComputePIDiff(const TransformParametersType & parameters, float scalingfactor) const;
private:
TransformMovingImageFilterPointer m_TransformMovingImageFilter{ TransformMovingImageFilterType::New() };
DifferenceImageFilterPointer m_DifferenceImageFilter{ DifferenceImageFilterType::New() };
RescaleIntensityImageFilterPointer m_RescaleImageFilter{ RescaleIntensityImageFilterType::New() };
MultiplyImageFilterPointer m_MultiplyImageFilter{ MultiplyImageFilterType::New() };
double m_NoiseConstant{ 10000 }; // = sigma * sigma = 100*100 if not specified
unsigned int m_NeighborhoodRadius{ 3 };
double m_DerivativeDelta{ 0.001 };
double m_NormalizationFactor{ 1.0 };
double m_Rescalingfactor{ 1.0 };
bool m_OptimizeNormalizationFactor{ false };
ScalesType m_Scales{};
MeasureType m_FixedMeasure{ 0 };
CombinationTransformPointer m_CombinationTransform{ CombinationTransformType::New() };
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkPatternIntensityImageToImageMetric.hxx"
#endif
#endif // end #ifndef itkPatternIntensityImageToImageMetric_h
itk::AdvancedCombinationTransform
This class combines two transforms: an 'initial transform' with a 'current transform'.
Definition itkAdvancedCombinationTransform.h:57
itk::AdvancedImageToImageMetric::ImageSampleContainerPointer
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Definition itkAdvancedImageToImageMetric.h:145
itk::AdvancedImageToImageMetric::MovingImageRegionType
typename MovingImageType::RegionType MovingImageRegionType
Definition itkAdvancedImageToImageMetric.h:138
itk::AdvancedImageToImageMetric::MovingImageDerivativeScalesType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
Definition itkAdvancedImageToImageMetric.h:139
itk::AdvancedImageToImageMetric::FixedImagePixelType
typename FixedImageType::PixelType FixedImagePixelType
Definition itkAdvancedImageToImageMetric.h:137
itk::AdvancedImageToImageMetric::ImageSampleContainerType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
Definition itkAdvancedImageToImageMetric.h:144
itk::AdvancedImageToImageMetric::MovingImagePointer
typename MovingImageType::Pointer MovingImagePointer
Definition itkAdvancedImageToImageMetric.h:104
itk::AdvancedImageToImageMetric::FixedImageMaskType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
Definition itkAdvancedImageToImageMetric.h:124
itk::AdvancedImageToImageMetric::MovingImageMaskPointer
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
Definition itkAdvancedImageToImageMetric.h:128
itk::AdvancedImageToImageMetric::FixedImageLimiterType
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Definition itkAdvancedImageToImageMetric.h:148
itk::AdvancedImageToImageMetric::AdvancedImageToImageMetric
AdvancedImageToImageMetric()
itk::AdvancedImageToImageMetric::ImageSamplerType
ImageSamplerBase< FixedImageType > ImageSamplerType
Definition itkAdvancedImageToImageMetric.h:142
itk::AdvancedImageToImageMetric::MovingImageLimiterType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
Definition itkAdvancedImageToImageMetric.h:151
itk::AdvancedImageToImageMetric::MovingImageLimiterOutputType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
Definition itkAdvancedImageToImageMetric.h:153
itk::AdvancedImageToImageMetric::FixedImageLimiterOutputType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Definition itkAdvancedImageToImageMetric.h:150
itk::AdvancedImageToImageMetric::FixedImageMaskPointer
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
Definition itkAdvancedImageToImageMetric.h:125
itk::AdvancedImageToImageMetric::ImageSamplerPointer
typename ImageSamplerType::Pointer ImageSamplerPointer
Definition itkAdvancedImageToImageMetric.h:143
itk::AdvancedImageToImageMetric::MovingImageMaskType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
Definition itkAdvancedImageToImageMetric.h:127
itk::AdvancedRayCastInterpolateImageFunction
Projective interpolation of an image at specified positions.
Definition itkAdvancedRayCastInterpolateImageFunction.h:58
itk::PatternIntensityImageToImageMetric::itkStaticConstMacro
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::MultiplyImageFilterPointer
typename MultiplyImageFilterType::Pointer MultiplyImageFilterPointer
Definition itkPatternIntensityImageToImageMetric.h:124
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_DerivativeDelta
double m_DerivativeDelta
Definition itkPatternIntensityImageToImageMetric.h:184
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::MultiplyImageFilterType
itk::MultiplyImageFilter< TransformedMovingImageType, TransformedMovingImageType, TransformedMovingImageType > MultiplyImageFilterType
Definition itkPatternIntensityImageToImageMetric.h:122
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_FixedMeasure
MeasureType m_FixedMeasure
Definition itkPatternIntensityImageToImageMetric.h:189
itk::PatternIntensityImageToImageMetric::ComputePIDiff
MeasureType ComputePIDiff(const TransformParametersType &parameters, float scalingfactor) const
itk::PatternIntensityImageToImageMetric::~PatternIntensityImageToImageMetric
~PatternIntensityImageToImageMetric() override=default
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::RescaleIntensityImageFilterPointer
typename RescaleIntensityImageFilterType::Pointer RescaleIntensityImageFilterPointer
Definition itkPatternIntensityImageToImageMetric.h:117
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_MultiplyImageFilter
MultiplyImageFilterPointer m_MultiplyImageFilter
Definition itkPatternIntensityImageToImageMetric.h:181
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_OptimizeNormalizationFactor
bool m_OptimizeNormalizationFactor
Definition itkPatternIntensityImageToImageMetric.h:187
itk::PatternIntensityImageToImageMetric::GetValueAndDerivative
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::CombinationTransformPointer
typename CombinationTransformType::Pointer CombinationTransformPointer
Definition itkPatternIntensityImageToImageMetric.h:110
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_NoiseConstant
double m_NoiseConstant
Definition itkPatternIntensityImageToImageMetric.h:182
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_CombinationTransform
CombinationTransformPointer m_CombinationTransform
Definition itkPatternIntensityImageToImageMetric.h:190
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Self
PatternIntensityImageToImageMetric Self
Definition itkPatternIntensityImageToImageMetric.h:52
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::DifferenceImageFilterPointer
typename DifferenceImageFilterType::Pointer DifferenceImageFilterPointer
Definition itkPatternIntensityImageToImageMetric.h:121
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::RayCastInterpolatorType
typename itk::AdvancedRayCastInterpolateImageFunction< MovingImageType, ScalarType > RayCastInterpolatorType
Definition itkPatternIntensityImageToImageMetric.h:111
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_NeighborhoodRadius
unsigned int m_NeighborhoodRadius
Definition itkPatternIntensityImageToImageMetric.h:183
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_Scales
ScalesType m_Scales
Definition itkPatternIntensityImageToImageMetric.h:188
itk::PatternIntensityImageToImageMetric::Initialize
void Initialize() override
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::DifferenceImageFilterType
itk::SubtractImageFilter< FixedImageType, TransformedMovingImageType, TransformedMovingImageType > DifferenceImageFilterType
Definition itkPatternIntensityImageToImageMetric.h:119
itk::PatternIntensityImageToImageMetric::PatternIntensityImageToImageMetric
PatternIntensityImageToImageMetric()=default
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_TransformMovingImageFilter
TransformMovingImageFilterPointer m_TransformMovingImageFilter
Definition itkPatternIntensityImageToImageMetric.h:178
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::TransformMovingImageFilterType
itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType > TransformMovingImageFilterType
Definition itkPatternIntensityImageToImageMetric.h:113
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_RescaleImageFilter
RescaleIntensityImageFilterPointer m_RescaleImageFilter
Definition itkPatternIntensityImageToImageMetric.h:180
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::ScalarType
typename TransformType::ScalarType ScalarType
Definition itkPatternIntensityImageToImageMetric.h:73
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::TransformMovingImageFilterPointer
typename TransformMovingImageFilterType::Pointer TransformMovingImageFilterPointer
Definition itkPatternIntensityImageToImageMetric.h:114
itk::PatternIntensityImageToImageMetric::GetValue
MeasureType GetValue(const TransformParametersType &parameters) const override
itk::PatternIntensityImageToImageMetric::ComputePIFixed
MeasureType ComputePIFixed() const
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Pointer
SmartPointer< Self > Pointer
Definition itkPatternIntensityImageToImageMetric.h:54
itk::PatternIntensityImageToImageMetric::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(PatternIntensityImageToImageMetric)
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_DifferenceImageFilter
DifferenceImageFilterPointer m_DifferenceImageFilter
Definition itkPatternIntensityImageToImageMetric.h:179
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::ScalesType
typename Optimizer::ScalesType ScalesType
Definition itkPatternIntensityImageToImageMetric.h:103
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::RescaleIntensityImageFilterType
itk::RescaleIntensityImageFilter< TransformedMovingImageType, TransformedMovingImageType > RescaleIntensityImageFilterType
Definition itkPatternIntensityImageToImageMetric.h:115
itk::PatternIntensityImageToImageMetric::GetDerivative
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
itk::PatternIntensityImageToImageMetric::itkStaticConstMacro
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itk::PatternIntensityImageToImageMetric::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::TransformedMovingImageType
itk::Image< FixedImagePixelType, Self::FixedImageDimension > TransformedMovingImageType
Definition itkPatternIntensityImageToImageMetric.h:108
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkPatternIntensityImageToImageMetric.h:55
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::CombinationTransformType
typename itk::AdvancedCombinationTransform< ScalarType, FixedImageDimension > CombinationTransformType
Definition itkPatternIntensityImageToImageMetric.h:109
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_Rescalingfactor
double m_Rescalingfactor
Definition itkPatternIntensityImageToImageMetric.h:186
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::RayCastInterpolatorPointer
typename RayCastInterpolatorType::Pointer RayCastInterpolatorPointer
Definition itkPatternIntensityImageToImageMetric.h:112
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Superclass
AdvancedImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType > Superclass
Definition itkPatternIntensityImageToImageMetric.h:53
itk::PatternIntensityImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_NormalizationFactor
double m_NormalizationFactor
Definition itkPatternIntensityImageToImageMetric.h:185
itkAdvancedCombinationTransform.h
itkAdvancedImageToImageMetric.h
itkAdvancedRayCastInterpolateImageFunction.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |