ITK  4.4.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  itkGetConstObjectMacro(FixedImage, FixedImageType);
139 
141  itkSetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
142  itkGetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
144 
146  itkSetObjectMacro(Interpolator, InterpolatorType);
147 
149  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
150 
152  virtual void GetValueAndDerivative(const ParametersType & parameters,
153  MeasureType & Value,
154  DerivativeType & Derivative) const = 0;
155 
157  virtual void Initialize(void)
158  throw ( ExceptionObject );
159 
162  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
163 
165  itkSetObjectMacro(Transform, TransformType);
166 
167 protected:
168 
170  virtual ~ImageToSpatialObjectMetric() {}
172  void operator=(const Self &) {}
173  void PrintSelf(std::ostream & os, Indent indent) const;
174 
179 
183 };
184 } // end namespace itk
185 
186 #ifndef ITK_MANUAL_INSTANTIATION
187 #include "itkImageToSpatialObjectMetric.hxx"
188 #endif
189 
190 #endif
191