ITK  4.2.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 
127  itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
128 
130  itkSetConstObjectMacro(MovingImage, MovingImageType);
131 
133  itkGetConstObjectMacro(MovingImage, MovingImageType);
134 
136  itkSetObjectMacro(Transform, TransformType);
137 
139  itkGetObjectMacro(Transform, TransformType);
140 
142  itkSetObjectMacro(Interpolator, InterpolatorType);
143 
145  itkGetObjectMacro(Interpolator, InterpolatorType);
146 
148  itkGetConstObjectMacro(GradientImage, GradientImageType);
149 
151  itkGetConstReferenceMacro(NumberOfPixelsCounted, SizeValueType);
152 
154  void SetTransformParameters(const ParametersType & parameters) const;
155 
163  itkSetMacro(ComputeGradient, bool);
164  itkGetConstReferenceMacro(ComputeGradient, bool);
166 
168  unsigned int GetNumberOfParameters(void) const
169  { return m_Transform->GetNumberOfParameters(); }
170 
173  virtual void Initialize(void)
174  throw ( ExceptionObject );
175 
176 protected:
178  virtual ~PointSetToImageMetric() {}
179  void PrintSelf(std::ostream & os, Indent indent) const;
180 
182 
184 
186 
188 
190 
192 
194 private:
195  PointSetToImageMetric(const Self &); //purposely not implemented
196  void operator=(const Self &); //purposely not implemented
197 };
198 } // end namespace itk
199 
200 #ifndef ITK_MANUAL_INSTANTIATION
201 #include "itkPointSetToImageMetric.hxx"
202 #endif
203 
204 #endif
205