ITK  4.6.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 >
49 {
50 public:
56 
59 
62 
64  typedef TMovingImage MovingImageType;
65  typedef typename TMovingImage::PixelType MovingImagePixelType;
66  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
67 
69  typedef TFixedPointSet FixedPointSetType;
70  typedef typename FixedPointSetType::ConstPointer FixedPointSetConstPointer;
71 
73  itkStaticConstMacro(MovingImageDimension, unsigned int,
74  TMovingImage::ImageDimension);
75  itkStaticConstMacro(FixedPointSetDimension, unsigned int,
76  TFixedPointSet::PointDimension);
78 
79  typedef typename FixedPointSetType::PointsContainer::ConstIterator PointIterator;
80  typedef typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator;
81 
84  itkGetStaticConstMacro(MovingImageDimension),
85  itkGetStaticConstMacro(FixedPointSetDimension) > TransformType;
86 
92 
97 
100  typedef CovariantVector< RealType,
101  itkGetStaticConstMacro(MovingImageDimension) > GradientPixelType;
102  typedef Image< GradientPixelType,
103  itkGetStaticConstMacro(MovingImageDimension) > GradientImageType;
109 
111 
113 
116 
119 
122 
124  itkSetConstObjectMacro(FixedPointSet, FixedPointSetType);
125  itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
127 
129  itkSetConstObjectMacro(MovingImage, MovingImageType);
130  itkGetConstObjectMacro(MovingImage, MovingImageType);
132 
134  itkSetObjectMacro(Transform, TransformType);
135 
137  itkGetModifiableObjectMacro(Transform, TransformType);
138 
140  itkSetObjectMacro(Interpolator, InterpolatorType);
141 
143  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
144 
146  itkGetModifiableObjectMacro(GradientImage, GradientImageType);
147 
149  itkGetConstReferenceMacro(NumberOfPixelsCounted, SizeValueType);
150 
152  void SetTransformParameters(const ParametersType & parameters) const;
153 
161  itkSetMacro(ComputeGradient, bool);
162  itkGetConstReferenceMacro(ComputeGradient, bool);
164 
166  virtual unsigned int GetNumberOfParameters(void) const ITK_OVERRIDE
167  { return m_Transform->GetNumberOfParameters(); }
168 
171  virtual void Initialize(void)
172  throw ( ExceptionObject );
173 
174 protected:
176  virtual ~PointSetToImageMetric() {}
177  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
178 
180 
182 
184 
186 
188 
190 
192 
193 private:
194  PointSetToImageMetric(const Self &); //purposely not implemented
195  void operator=(const Self &); //purposely not implemented
196 };
197 } // end namespace itk
198 
199 #ifndef ITK_MANUAL_INSTANTIATION
200 #include "itkPointSetToImageMetric.hxx"
201 #endif
202 
203 #endif
FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
This class is a base for the CostFunctions returning a single value.
FixedPointSetType::PointsContainer::ConstIterator PointIterator
Light weight base class for most itk classes.
static const unsigned int FixedPointSetDimension
Superclass::ParametersValueType CoordinateRepresentationType
TransformType::Pointer TransformPointer
TransformType::JacobianType TransformJacobianType
Superclass::DerivativeType DerivativeType
Image< GradientPixelType, itkGetStaticConstMacro(MovingImageDimension) > GradientImageType
GradientRecursiveGaussianImageFilter< MovingImageType, GradientImageType > GradientImageFilterType
Computes the gradient of an image by convolution with the first derivative of a Gaussian.
TransformType::OutputPointType OutputPointType
TransformType::ParametersType TransformParametersType
Superclass::ParametersType ParametersType
Definition: itkTransform.h:118
InterpolateImageFunction< MovingImageType, CoordinateRepresentationType > InterpolatorType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
CovariantVector< RealType, itkGetStaticConstMacro(MovingImageDimension) > GradientPixelType
NumericTraits< MovingImagePixelType >::RealType RealType
virtual unsigned int GetNumberOfParameters(void) const ITK_OVERRIDE
Superclass::MeasureType MeasureType
Computes similarity between a point set and an image.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
Array< ParametersValueType > DerivativeType
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:44
MovingImageType::ConstPointer MovingImageConstPointer
TMovingImage::PixelType MovingImagePixelType
SingleValuedCostFunction Superclass
SmartPointer< const Self > ConstPointer
Standard exception handling object.
void SetTransformParameters(const ParametersType &parameters) const
Superclass::ParametersType ParametersType
Base class for all image interpolaters.
FixedPointSetConstPointer m_FixedPointSet
GradientImageFilterType::Pointer GradientImageFilterPointer
virtual void Initialize(void)
Superclass::ParametersValueType ParametersValueType
SmartPointer< GradientImageType > GradientImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
InterpolatorType::Pointer InterpolatorPointer
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
TransformType::InputPointType InputPointType
MovingImageConstPointer m_MovingImage
Superclass::ParametersType ParametersType
void operator=(const Self &)
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
static const unsigned int MovingImageDimension
A templated class holding a n-Dimensional covariant vector.
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(MovingImageDimension), itkGetStaticConstMacro(FixedPointSetDimension) > TransformType
Templated n-dimensional image class.
Definition: itkImage.h:75
FixedPointSetType::ConstPointer FixedPointSetConstPointer