ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkImageToSpatialObjectMetric.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 __itkImageToSpatialObjectMetric_h
19 #define __itkImageToSpatialObjectMetric_h
20 
24 #include "vnl/vnl_vector_fixed.h"
25 #include "itkTransform.h"
26 
27 namespace itk
28 {
60 template< class TFixedImage, class TMovingSpatialObject >
61 class ITK_EXPORT ImageToSpatialObjectMetric:
63 {
64 public:
69 
71  typedef TFixedImage FixedImageType;
72 
74  typedef TMovingSpatialObject MovingSpatialObjectType;
75 
77  typedef Superclass::ParametersValueType CoordinateRepresentationType;
78 
80  itkStaticConstMacro(ImageDimension, unsigned int,
81  FixedImageType::ImageDimension);
82 
84  itkStaticConstMacro(ObjectDimension, unsigned int,
85  MovingSpatialObjectType::ObjectDimension);
86 
89  itkGetStaticConstMacro(ObjectDimension),
90  itkGetStaticConstMacro(ImageDimension) > TransformType;
91 
97 
100  TFixedImage,
102 
104 
106  typedef vnl_vector_fixed< double,
107  itkGetStaticConstMacro(ObjectDimension) > VectorType;
108 
111 
113  typedef Superclass::DerivativeType DerivativeType;
114 
116  typedef typename FixedImageType::Pointer FixedImagePointer;
117 
119  typedef typename MovingSpatialObjectType::Pointer
121 
123  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
124 
126  typedef typename MovingSpatialObjectType::ConstPointer MovingSpatialObjectConstPointer;
127 
130  typedef Superclass::ParametersType ParametersType;
131 
133  itkTypeMacro(ImageToSpatialObjectMetric, Object);
134 
136  itkSetConstObjectMacro(FixedImage, FixedImageType);
137 
139  itkGetConstObjectMacro(FixedImage, FixedImageType);
140 
142  itkSetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
143 
145  itkGetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
146 
148  itkSetObjectMacro(Interpolator, InterpolatorType);
149 
151  itkGetObjectMacro(Interpolator, InterpolatorType);
152 
154  virtual void GetValueAndDerivative(const ParametersType & parameters,
155  MeasureType & Value,
156  DerivativeType & Derivative) const = 0;
157 
159  virtual void Initialize(void)
160  throw ( ExceptionObject );
161 
164  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
165 
167  itkSetObjectMacro(Transform, TransformType);
168 protected:
169 
171  virtual ~ImageToSpatialObjectMetric() {}
173  void operator=(const Self &) {}
174  void PrintSelf(std::ostream & os, Indent indent) const;
175 
180 
184 };
185 } // end namespace itk
186 
187 #ifndef ITK_MANUAL_INSTANTIATION
188 #include "itkImageToSpatialObjectMetric.hxx"
189 #endif
190 
191 #endif
192