go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkSumSquaredTissueVolumeDifferenceImageToImageMetric.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkSumSquaredTissueVolumeDifferenceImageToImageMetric_h
19#define itkSumSquaredTissueVolumeDifferenceImageToImageMetric_h
20
22
23namespace itk
24{
25
60template <class TFixedImage, class TMovingImage>
62 : public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
63{
64public:
66
70 using Pointer = SmartPointer<Self>;
71 using ConstPointer = SmartPointer<const Self>;
72
74 itkNewMacro(Self);
75
78
80 using typename Superclass::CoordinateRepresentationType;
81 using typename Superclass::MovingImageType;
82 using typename Superclass::MovingImagePixelType;
83 using typename Superclass::MovingImageConstPointer;
84 using typename Superclass::FixedImageType;
85 using typename Superclass::FixedImageConstPointer;
86 using typename Superclass::FixedImageRegionType;
87 using typename Superclass::InputPointType;
88 using typename Superclass::OutputPointType;
89 using typename Superclass::TransformParametersType;
90 using typename Superclass::TransformJacobianType;
91 using typename Superclass::InterpolatorType;
92 using typename Superclass::InterpolatorPointer;
93 using typename Superclass::RealType;
94 using typename Superclass::GradientPixelType;
95 using typename Superclass::GradientImageType;
96 using typename Superclass::GradientImagePointer;
97 using typename Superclass::GradientImageFilterType;
98 using typename Superclass::GradientImageFilterPointer;
99 using typename Superclass::FixedImageMaskType;
100 using typename Superclass::FixedImageMaskPointer;
101 using typename Superclass::MovingImageMaskType;
102 using typename Superclass::MovingImageMaskPointer;
103 using typename Superclass::MeasureType;
104 using typename Superclass::DerivativeType;
105 using typename Superclass::DerivativeValueType;
106 using typename Superclass::ParametersType;
107 using typename Superclass::FixedImagePixelType;
109 using typename Superclass::ImageSamplerType;
110 using typename Superclass::ImageSamplerPointer;
118
121 using SpatialJacobianType = typename TransformType::SpatialJacobianType;
122 using JacobianOfSpatialJacobianType = typename TransformType::JacobianOfSpatialJacobianType;
123 using SpatialHessianType = typename TransformType::SpatialHessianType;
124 using JacobianOfSpatialHessianType = typename TransformType::JacobianOfSpatialHessianType;
125 using InternalMatrixType = typename TransformType::InternalMatrixType;
126
128 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
129
131 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
132
134 virtual MeasureType
135 GetValueSingleThreaded(const TransformParametersType & parameters) const;
136
137 MeasureType
138 GetValue(const TransformParametersType & parameters) const override;
139
141 void
142 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
143
145 void
146 GetValueAndDerivative(const TransformParametersType & parameters,
147 MeasureType & Value,
148 DerivativeType & Derivative) const override;
149
151 void
152 GetValueAndDerivativeSingleThreaded(const TransformParametersType & parameters,
153 MeasureType & measure,
154 DerivativeType & derivative) const;
155
157 itkSetMacro(AirValue, RealType);
158 itkGetConstMacro(AirValue, RealType);
159
161 itkSetMacro(TissueValue, RealType);
162 itkGetConstMacro(TissueValue, RealType);
163
164protected:
167
168 void
169 PrintSelf(std::ostream & os, Indent indent) const override;
170
174 using typename Superclass::FixedImageIndexType;
177 using typename Superclass::FixedImagePointType;
184
188 void
189 EvaluateTransformJacobianInnerProduct(const TransformJacobianType & jacobian,
190 const MovingImageDerivativeType & movingImageDerivative,
191 DerivativeType & imageJacobian) const override;
192
195 void
196 UpdateValueAndDerivativeTerms(const RealType fixedImageValue,
197 const RealType movingImageValue,
198 const DerivativeType & imageJacobian,
199 const NonZeroJacobianIndicesType & nzji,
200 const RealType spatialJacobianDeterminant,
201 const DerivativeType & jacobianOfSpatialJacobianDeterminant,
202 MeasureType & measure,
203 DerivativeType & deriv) const;
204
211 bool
213 const RealType spatialJacobianDeterminant,
214 SpatialJacobianType & inverseSpatialJacobian) const;
215
221 void
223 const JacobianOfSpatialJacobianType & jacobianOfSpatialJacobian,
224 const SpatialJacobianType & inverseSpatialJacobian,
225 DerivativeType & jacobianOfSpatialJacobianDeterminant) const;
226
228 void
229 ThreadedGetValue(ThreadIdType threadID) override;
230
232 void
233 AfterThreadedGetValue(MeasureType & value) const override;
234
236 void
237 ThreadedGetValueAndDerivative(ThreadIdType threadId) override;
238
240 void
241 AfterThreadedGetValueAndDerivative(MeasureType & measure, DerivativeType & derivative) const override;
242
243private:
245 RealType m_AirValue;
246
249
250}; // end class SumSquaredTissueVolumeDifferenceImageToImageMetric
251
252} // end namespace itk
253
254#ifndef ITK_MANUAL_INSTANTIATION
255# include "itkSumSquaredTissueVolumeDifferenceImageToImageMetric.hxx"
256#endif
257
258#endif // end #ifndef itkSumSquaredTissueVolumeDifferenceImageToImageMetric_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
typename FixedImageType::PixelType FixedImagePixelType
typename DerivativeType::ValueType DerivativeValueType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename FixedImageType::IndexType FixedImageIndexType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Transform maps points, vectors and covariant vectors from an input space to an output space.
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.
Compute sum of square tissue volume difference between two images.
MeasureType GetValue(const TransformParametersType &parameters) const override
virtual MeasureType GetValueSingleThreaded(const TransformParametersType &parameters) const
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void EvaluateJacobianOfSpatialJacobianDeterminantInnerProduct(const JacobianOfSpatialJacobianType &jacobianOfSpatialJacobian, const SpatialJacobianType &inverseSpatialJacobian, DerivativeType &jacobianOfSpatialJacobianDeterminant) const
ITK_DISALLOW_COPY_AND_MOVE(SumSquaredTissueVolumeDifferenceImageToImageMetric)
void UpdateValueAndDerivativeTerms(const RealType fixedImageValue, const RealType movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, const RealType spatialJacobianDeterminant, const DerivativeType &jacobianOfSpatialJacobianDeterminant, MeasureType &measure, DerivativeType &deriv) const
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
void AfterThreadedGetValue(MeasureType &value) const override
bool EvaluateInverseSpatialJacobian(const SpatialJacobianType &spatialJacobian, const RealType spatialJacobianDeterminant, SpatialJacobianType &inverseSpatialJacobian) const
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
void ThreadedGetValue(ThreadIdType threadID) override
void PrintSelf(std::ostream &os, Indent indent) const override
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
void GetValueAndDerivativeSingleThreaded(const TransformParametersType &parameters, MeasureType &measure, DerivativeType &derivative) const
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
void AfterThreadedGetValueAndDerivative(MeasureType &measure, DerivativeType &derivative) const override
void ThreadedGetValueAndDerivative(ThreadIdType threadId) override


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo