ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkImageToSpatialObjectMetric.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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 itkImageToSpatialObjectMetric_h
19#define itkImageToSpatialObjectMetric_h
20
24#include "vnl/vnl_vector_fixed.h"
25#include "itkTransform.h"
26
27namespace itk
28{
58
59template <typename TFixedImage, typename TMovingSpatialObject>
60class ITK_TEMPLATE_EXPORT ImageToSpatialObjectMetric : public SingleValuedCostFunction
61{
62public:
63 ITK_DISALLOW_COPY_AND_MOVE(ImageToSpatialObjectMetric);
64
69
71 using FixedImageType = TFixedImage;
72
74 using MovingSpatialObjectType = TMovingSpatialObject;
75
78
80 static constexpr unsigned int ImageDimension = FixedImageType::ImageDimension;
81
83 static constexpr unsigned int ObjectDimension = MovingSpatialObjectType::ObjectDimension;
84
87
93
96
98
100 using VectorType = vnl_vector_fixed<double, Self::ObjectDimension>;
101
104
107
109 using FixedImagePointer = typename FixedImageType::Pointer;
110
112 using MovingSpatialObjectPointer = typename MovingSpatialObjectType::Pointer;
113
115 using FixedImageConstPointer = typename FixedImageType::ConstPointer;
116
118 using MovingSpatialObjectConstPointer = typename MovingSpatialObjectType::ConstPointer;
119
123
125 itkOverrideGetNameOfClassMacro(ImageToSpatialObjectMetric);
126
128 itkSetConstObjectMacro(FixedImage, FixedImageType);
129 itkGetConstObjectMacro(FixedImage, FixedImageType);
131
133 itkSetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
134 itkGetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
136
138 itkSetObjectMacro(Interpolator, InterpolatorType);
139
141 itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
142
144 void
146 MeasureType & Value,
147 DerivativeType & Derivative) const override = 0;
148
150 unsigned int
151 GetNumberOfParameters() const override;
152
154 virtual void
156
159 itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
160
162 itkSetObjectMacro(Transform, TransformType);
163
164protected:
166 ~ImageToSpatialObjectMetric() override = default;
167
168 void
169 PrintSelf(std::ostream & os, Indent indent) const override;
170
175
179};
180} // end namespace itk
181
182#ifndef ITK_MANUAL_INSTANTIATION
183# include "itkImageToSpatialObjectMetric.hxx"
184#endif
185
186#endif
unsigned int GetNumberOfParameters() const override
typename FixedImageType::Pointer FixedImagePointer
typename TransformType::InputPointType InputPointType
typename MovingSpatialObjectType::Pointer MovingSpatialObjectPointer
Superclass::ParametersValueType CoordinateRepresentationType
typename MovingSpatialObjectType::ConstPointer MovingSpatialObjectConstPointer
Transform< CoordinateRepresentationType, Self::ObjectDimension, Self::ImageDimension > TransformType
typename TransformType::JacobianType TransformJacobianType
typename TransformType::Pointer TransformPointer
vnl_vector_fixed< double, Self::ObjectDimension > VectorType
LinearInterpolateImageFunction< TFixedImage, CoordinateRepresentationType > InterpolatorType
void PrintSelf(std::ostream &os, Indent indent) const override
typename TransformType::ParametersType TransformParametersType
typename InterpolatorType::Pointer InterpolatorPointer
~ImageToSpatialObjectMetric() override=default
typename FixedImageType::ConstPointer FixedImageConstPointer
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override=0
typename TransformType::OutputPointType OutputPointType
Control indentation during Print() invocation.
Definition itkIndent.h:50
Linearly interpolate an image at specified positions.
Array< ParametersValueType > DerivativeType
Superclass::ParametersValueType ParametersValueType
Superclass::ParametersType ParametersType
Implements transparent reference counting.
Transform points and vectors from an input space to an output space.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....