ITK  4.4.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< class TFixedPointSet, class TMovingImage >
49 {
50 public:
56 
58  typedef Superclass::ParametersValueType CoordinateRepresentationType;
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 
115  typedef Superclass::MeasureType MeasureType;
116 
118  typedef Superclass::DerivativeType DerivativeType;
119 
121  typedef Superclass::ParametersType ParametersType;
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  unsigned int GetNumberOfParameters(void) const
167  { return m_Transform->GetNumberOfParameters(); }
168 
171  virtual void Initialize(void)
172  throw ( ExceptionObject );
173 
174 protected:
176  virtual ~PointSetToImageMetric() {}
177  void PrintSelf(std::ostream & os, Indent indent) const;
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
204