ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkPointSetToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkPointSetToImageMetric_h
19 #define itkPointSetToImageMetric_h
20 
21 #include "itkImageBase.h"
22 #include "itkTransform.h"
25 #include "itkMacro.h"
27 
28 namespace itk
29 {
47 template< typename TFixedPointSet, typename TMovingImage >
48 class ITK_TEMPLATE_EXPORT PointSetToImageMetric:public SingleValuedCostFunction
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_ASSIGN(PointSetToImageMetric);
52 
58 
60  using CoordinateRepresentationType = Superclass::ParametersValueType;
61 
64 
66  using MovingImageType = TMovingImage;
67  using MovingImagePixelType = typename TMovingImage::PixelType;
68  using MovingImageConstPointer = typename MovingImageType::ConstPointer;
69 
71  using FixedPointSetType = TFixedPointSet;
72  using FixedPointSetConstPointer = typename FixedPointSetType::ConstPointer;
73 
75  static constexpr unsigned int MovingImageDimension = TMovingImage::ImageDimension;
76  static constexpr unsigned int FixedPointSetDimension = TFixedPointSet::PointDimension;
77 
78  using PointIterator = typename FixedPointSetType::PointsContainer::ConstIterator;
79  using PointDataIterator = typename FixedPointSetType::PointDataContainer::ConstIterator;
80 
83  Self::MovingImageDimension,
84  Self::FixedPointSetDimension >;
85 
91 
96 
100  Self::MovingImageDimension >;
102  Self::MovingImageDimension >;
106 
108 
110 
112  using MeasureType = Superclass::MeasureType;
113 
115  using DerivativeType = Superclass::DerivativeType;
116 
118  using ParametersType = Superclass::ParametersType;
119 
121  itkSetConstObjectMacro(FixedPointSet, FixedPointSetType);
122  itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
124 
126  itkSetConstObjectMacro(MovingImage, MovingImageType);
127  itkGetConstObjectMacro(MovingImage, MovingImageType);
129 
131  itkSetObjectMacro(Transform, TransformType);
132 
134  itkGetModifiableObjectMacro(Transform, TransformType);
135 
137  itkSetObjectMacro(Interpolator, InterpolatorType);
138 
140  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
141 
143  itkGetModifiableObjectMacro(GradientImage, GradientImageType);
144 
146  itkGetConstReferenceMacro(NumberOfPixelsCounted, SizeValueType);
147 
149  void SetTransformParameters(const ParametersType & parameters) const;
150 
158  itkSetMacro(ComputeGradient, bool);
159  itkGetConstReferenceMacro(ComputeGradient, bool);
161 
163  unsigned int GetNumberOfParameters() const override
164  { return m_Transform->GetNumberOfParameters(); }
165 
168  virtual void Initialize();
169 
170 protected:
172  ~PointSetToImageMetric() override = default;
173  void PrintSelf(std::ostream & os, Indent indent) const override;
174 
176 
178 
180 
182 
184 
186 
188 };
189 } // end namespace itk
190 
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkPointSetToImageMetric.hxx"
193 #endif
194 
195 #endif
Array class with size defined at construction time.
Definition: itkArray.h:46
typename Superclass::ParametersType ParametersType
Definition: itkTransform.h:119
This class is a base for the CostFunctions returning a single value.
typename FixedPointSetType::ConstPointer FixedPointSetConstPointer
Light weight base class for most itk classes.
typename TransformType::Pointer TransformPointer
Define numeric traits for std::vector.
unsigned long SizeValueType
Definition: itkIntTypes.h:83
typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
Computes the gradient of an image by convolution with the first derivative of a Gaussian.
Superclass::ParametersValueType CoordinateRepresentationType
Computes similarity between a point set and an image.
typename TransformType::ParametersType TransformParametersType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45
Base class for all image interpolaters.
FixedPointSetConstPointer m_FixedPointSet
typename InterpolatorType::Pointer InterpolatorPointer
typename NumericTraits< MovingImagePixelType >::RealType RealType
typename GradientImageFilterType::Pointer GradientImageFilterPointer
typename TransformType::JacobianType TransformJacobianType
typename TransformType::InputPointType InputPointType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
MovingImageConstPointer m_MovingImage
typename FixedPointSetType::PointsContainer::ConstIterator PointIterator
typename MovingImageType::ConstPointer MovingImageConstPointer
typename TMovingImage::PixelType MovingImagePixelType
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
A templated class holding a n-Dimensional covariant vector.
unsigned int GetNumberOfParameters() const override
Templated n-dimensional image class.
Definition: itkImage.h:75
typename TransformType::OutputPointType OutputPointType