go home Home | Main Page | Topics | 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
59
60template <typename TFixedImage, typename 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::TransformJacobianType;
90 using typename Superclass::InterpolatorType;
91 using typename Superclass::InterpolatorPointer;
92 using typename Superclass::RealType;
93 using typename Superclass::GradientPixelType;
94 using typename Superclass::GradientImageType;
95 using typename Superclass::GradientImagePointer;
96 using typename Superclass::FixedImageMaskType;
100 using typename Superclass::MeasureType;
101 using typename Superclass::DerivativeType;
102 using typename Superclass::DerivativeValueType;
103 using typename Superclass::ParametersType;
104 using typename Superclass::FixedImagePixelType;
106 using typename Superclass::ImageSamplerType;
107 using typename Superclass::ImageSamplerPointer;
115
118 using SpatialJacobianType = typename TransformType::SpatialJacobianType;
119 using JacobianOfSpatialJacobianType = typename TransformType::JacobianOfSpatialJacobianType;
120 using SpatialHessianType = typename TransformType::SpatialHessianType;
121 using JacobianOfSpatialHessianType = typename TransformType::JacobianOfSpatialHessianType;
122 using InternalMatrixType = typename TransformType::InternalMatrixType;
123
125 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
126
128 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
129
131 virtual MeasureType
132 GetValueSingleThreaded(const ParametersType & parameters) const;
133
134 MeasureType
135 GetValue(const ParametersType & parameters) const override;
136
138 void
139 GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const override;
140
142 void
143 GetValueAndDerivative(const ParametersType & parameters,
144 MeasureType & Value,
145 DerivativeType & Derivative) const override;
146
148 void
149 GetValueAndDerivativeSingleThreaded(const ParametersType & parameters,
150 MeasureType & measure,
151 DerivativeType & derivative) const;
152
154 itkSetMacro(AirValue, RealType);
155 itkGetConstMacro(AirValue, RealType);
156
158 itkSetMacro(TissueValue, RealType);
159 itkGetConstMacro(TissueValue, RealType);
160
161protected:
164
165 void
166 PrintSelf(std::ostream & os, Indent indent) const override;
167
169
171 using typename Superclass::FixedImageIndexType;
174 using typename Superclass::FixedImagePointType;
180
184 void
185 EvaluateTransformJacobianInnerProduct(const TransformJacobianType & jacobian,
186 const MovingImageDerivativeType & movingImageDerivative,
187 DerivativeType & imageJacobian) const override;
188
191 void
192 UpdateValueAndDerivativeTerms(const RealType fixedImageValue,
193 const RealType movingImageValue,
194 const DerivativeType & imageJacobian,
195 const NonZeroJacobianIndicesType & nzji,
196 const RealType spatialJacobianDeterminant,
197 const DerivativeType & jacobianOfSpatialJacobianDeterminant,
198 MeasureType & measure,
199 DerivativeType & deriv) const;
200
206 void
208 const JacobianOfSpatialJacobianType & jacobianOfSpatialJacobian,
209 const SpatialJacobianType & inverseSpatialJacobian,
210 DerivativeType & jacobianOfSpatialJacobianDeterminant) const;
211
213 void
214 ThreadedGetValue(ThreadIdType threadID) const override;
215
217 void
218 AfterThreadedGetValue(MeasureType & value) const override;
219
221 void
222 ThreadedGetValueAndDerivative(ThreadIdType threadId) const override;
223
225 void
226 AfterThreadedGetValueAndDerivative(MeasureType & measure, DerivativeType & derivative) const override;
227
228private:
230 RealType m_AirValue{ -1000.0 };
231
233 RealType m_TissueValue{ 55.0 };
234
235}; // end class SumSquaredTissueVolumeDifferenceImageToImageMetric
236
237} // end namespace itk
238
239#ifndef ITK_MANUAL_INSTANTIATION
240# include "itkSumSquaredTissueVolumeDifferenceImageToImageMetric.hxx"
241#endif
242
243#endif // end #ifndef itkSumSquaredTissueVolumeDifferenceImageToImageMetric_h
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
typename FixedImageType::PixelType FixedImagePixelType
typename DerivativeType::ValueType DerivativeValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
AdvancedTransform< ScalarType, FixedImageDimension, MovingImageDimension > AdvancedTransformType
typename FixedImageType::IndexType FixedImageIndexType
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
ImageSamplerBase< FixedImageType > ImageSamplerType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void EvaluateJacobianOfSpatialJacobianDeterminantInnerProduct(const JacobianOfSpatialJacobianType &jacobianOfSpatialJacobian, const SpatialJacobianType &inverseSpatialJacobian, DerivativeType &jacobianOfSpatialJacobianDeterminant) const
virtual MeasureType GetValueSingleThreaded(const ParametersType &parameters) 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
void ThreadedGetValue(ThreadIdType threadID) const override
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
MeasureType GetValue(const ParametersType &parameters) const override
void ThreadedGetValueAndDerivative(ThreadIdType threadId) const override
void PrintSelf(std::ostream &os, Indent indent) const override
void GetValueAndDerivativeSingleThreaded(const ParametersType &parameters, MeasureType &measure, DerivativeType &derivative) const
void AfterThreadedGetValueAndDerivative(MeasureType &measure, DerivativeType &derivative) const override
itkOverrideGetNameOfClassMacro(SumSquaredTissueVolumeDifferenceImageToImageMetric)


Generated on 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo