Loading...
Searching...
No Matches
itkVarianceOverLastDimensionImageMetric.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 itkVarianceOverLastDimensionImageMetric_h
#define itkVarianceOverLastDimensionImageMetric_h
#include "itkSmoothingRecursiveGaussianImageFilter.h"
#include "itkImageRandomCoordinateSampler.h"
#include "itkNearestNeighborInterpolateImageFunction.h"
#include "itkAdvancedImageToImageMetric.h"
namespace itk
{
template <class TFixedImage, class TMovingImage>
class ITK_TEMPLATE_EXPORT VarianceOverLastDimensionImageMetric
: public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(VarianceOverLastDimensionImageMetric);
using Self = VarianceOverLastDimensionImageMetric;
using Superclass = AdvancedImageToImageMetric<TFixedImage, TMovingImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
using typename Superclass::FixedImageRegionType;
using FixedImageSizeType = typename FixedImageRegionType::SizeType;
itkNewMacro(Self);
itkTypeMacro(VarianceOverLastDimensionImageMetric, AdvancedImageToImageMetric);
itkSetMacro(SampleLastDimensionRandomly, bool);
itkSetMacro(NumSamplesLastDimension, unsigned int);
itkSetMacro(NumAdditionalSamplesFixed, unsigned int);
itkSetMacro(ReducedDimensionIndex, unsigned int);
itkSetMacro(UseZeroAverageDisplacementConstraint, bool);
itkSetMacro(GridSize, FixedImageSizeType);
itkSetMacro(TransformIsStackTransform, bool);
itkGetConstMacro(SampleLastDimensionRandomly, bool);
itkGetConstMacro(NumSamplesLastDimension, int);
using typename Superclass::CoordinateRepresentationType;
using typename Superclass::MovingImageType;
using typename Superclass::MovingImagePixelType;
using typename Superclass::MovingImageConstPointer;
using typename Superclass::FixedImageType;
using typename Superclass::FixedImageConstPointer;
using typename Superclass::TransformType;
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::DerivativeValueType;
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;
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
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;
protected:
VarianceOverLastDimensionImageMetric();
~VarianceOverLastDimensionImageMetric() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
using typename Superclass::FixedImageIndexType;
using typename Superclass::FixedImageIndexValueType;
using typename Superclass::MovingImageIndexType;
using typename Superclass::FixedImagePointType;
using FixedImageContinuousIndexType =
typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
using typename Superclass::MovingImagePointType;
using typename Superclass::MovingImageContinuousIndexType;
using typename Superclass::BSplineInterpolatorType;
using typename Superclass::MovingImageDerivativeType;
using typename Superclass::NonZeroJacobianIndicesType;
void
EvaluateTransformJacobianInnerProduct(const TransformJacobianType & jacobian,
const MovingImageDerivativeType & movingImageDerivative,
DerivativeType & imageJacobian) const override;
private:
void
SampleRandom(const int n, const int m, std::vector<int> & numbers) const;
bool m_SampleLastDimensionRandomly{ false };
unsigned int m_NumSamplesLastDimension{ 10 };
unsigned int m_NumAdditionalSamplesFixed{};
unsigned int m_ReducedDimensionIndex{};
bool m_UseZeroAverageDisplacementConstraint{ true };
float m_InitialVariance{};
FixedImageSizeType m_GridSize{};
bool m_TransformIsStackTransform{ false };
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkVarianceOverLastDimensionImageMetric.hxx"
#endif
#endif // end #ifndef itkVarianceOverLastDimensionImageMetric_h
itk::AdvancedImageToImageMetric::MovingImagePointType
typename TransformType::OutputPointType MovingImagePointType
Definition itkAdvancedImageToImageMetric.h:338
itk::AdvancedImageToImageMetric::ImageSampleContainerPointer
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Definition itkAdvancedImageToImageMetric.h:145
itk::AdvancedImageToImageMetric::MovingImageRegionType
typename MovingImageType::RegionType MovingImageRegionType
Definition itkAdvancedImageToImageMetric.h:138
itk::AdvancedImageToImageMetric::NonZeroJacobianIndicesType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Definition itkAdvancedImageToImageMetric.h:356
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::DerivativeValueType
typename DerivativeType::ValueType DerivativeValueType
Definition itkAdvancedImageToImageMetric.h:133
itk::AdvancedImageToImageMetric::FixedImageIndexValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
Definition itkAdvancedImageToImageMetric.h:335
itk::AdvancedImageToImageMetric::MovingImageIndexType
typename MovingImageType::IndexType MovingImageIndexType
Definition itkAdvancedImageToImageMetric.h:336
itk::AdvancedImageToImageMetric::ImageSampleContainerType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
Definition itkAdvancedImageToImageMetric.h:144
itk::AdvancedImageToImageMetric::FixedImageMaskType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
Definition itkAdvancedImageToImageMetric.h:124
itk::AdvancedImageToImageMetric::FixedImageIndexType
typename FixedImageType::IndexType FixedImageIndexType
Definition itkAdvancedImageToImageMetric.h:334
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::MovingImageDerivativeType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Definition itkAdvancedImageToImageMetric.h:353
itk::AdvancedImageToImageMetric::MovingImageLimiterType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
Definition itkAdvancedImageToImageMetric.h:151
itk::AdvancedImageToImageMetric::MovingImageLimiterOutputType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
Definition itkAdvancedImageToImageMetric.h:153
itk::AdvancedImageToImageMetric::FixedImagePointType
typename TransformType::InputPointType FixedImagePointType
Definition itkAdvancedImageToImageMetric.h:337
itk::AdvancedImageToImageMetric::FixedImageLimiterOutputType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Definition itkAdvancedImageToImageMetric.h:150
itk::AdvancedImageToImageMetric::FixedImageMaskPointer
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
Definition itkAdvancedImageToImageMetric.h:125
itk::AdvancedImageToImageMetric::BSplineInterpolatorType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
Definition itkAdvancedImageToImageMetric.h:342
itk::AdvancedImageToImageMetric::ImageSamplerPointer
typename ImageSamplerType::Pointer ImageSamplerPointer
Definition itkAdvancedImageToImageMetric.h:143
itk::AdvancedImageToImageMetric::MovingImageContinuousIndexType
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Definition itkAdvancedImageToImageMetric.h:339
itk::AdvancedImageToImageMetric::MovingImageMaskType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
Definition itkAdvancedImageToImageMetric.h:127
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_TransformIsStackTransform
bool m_TransformIsStackTransform
Definition itkVarianceOverLastDimensionImageMetric.h:201
itk::VarianceOverLastDimensionImageMetric::itkStaticConstMacro
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
itk::VarianceOverLastDimensionImageMetric::~VarianceOverLastDimensionImageMetric
~VarianceOverLastDimensionImageMetric() override=default
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::FixedImageContinuousIndexType
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
Definition itkVarianceOverLastDimensionImageMetric.h:164
itk::VarianceOverLastDimensionImageMetric::SampleRandom
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
itk::VarianceOverLastDimensionImageMetric::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::VarianceOverLastDimensionImageMetric::VarianceOverLastDimensionImageMetric
VarianceOverLastDimensionImageMetric()
itk::VarianceOverLastDimensionImageMetric::Initialize
void Initialize() override
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_NumAdditionalSamplesFixed
unsigned int m_NumAdditionalSamplesFixed
Definition itkVarianceOverLastDimensionImageMetric.h:188
itk::VarianceOverLastDimensionImageMetric::GetValue
MeasureType GetValue(const TransformParametersType &parameters) const override
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Pointer
SmartPointer< Self > Pointer
Definition itkVarianceOverLastDimensionImageMetric.h:61
itk::VarianceOverLastDimensionImageMetric::EvaluateTransformJacobianInnerProduct
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Superclass
AdvancedImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType > Superclass
Definition itkVarianceOverLastDimensionImageMetric.h:60
itk::VarianceOverLastDimensionImageMetric::GetDerivative
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Self
VarianceOverLastDimensionImageMetric Self
Definition itkVarianceOverLastDimensionImageMetric.h:59
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_ReducedDimensionIndex
unsigned int m_ReducedDimensionIndex
Definition itkVarianceOverLastDimensionImageMetric.h:189
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::MovingImageDerivativeType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkVarianceOverLastDimensionImageMetric.h:62
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_UseZeroAverageDisplacementConstraint
bool m_UseZeroAverageDisplacementConstraint
Definition itkVarianceOverLastDimensionImageMetric.h:192
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_NumSamplesLastDimension
unsigned int m_NumSamplesLastDimension
Definition itkVarianceOverLastDimensionImageMetric.h:187
itk::VarianceOverLastDimensionImageMetric::itkStaticConstMacro
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_InitialVariance
float m_InitialVariance
Definition itkVarianceOverLastDimensionImageMetric.h:195
itk::VarianceOverLastDimensionImageMetric::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(VarianceOverLastDimensionImageMetric)
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_SampleLastDimensionRandomly
bool m_SampleLastDimensionRandomly
Definition itkVarianceOverLastDimensionImageMetric.h:186
itk::VarianceOverLastDimensionImageMetric::GetValueAndDerivative
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_GridSize
FixedImageSizeType m_GridSize
Definition itkVarianceOverLastDimensionImageMetric.h:198
itk::VarianceOverLastDimensionImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::FixedImageSizeType
typename FixedImageRegionType::SizeType FixedImageSizeType
Definition itkVarianceOverLastDimensionImageMetric.h:65
itkAdvancedImageToImageMetric.h
itkImageRandomCoordinateSampler.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |