ITK  4.13.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< typename TFixedImage, typename TMovingSpatialObject >
61 class ITK_TEMPLATE_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 ITK_OVERRIDE = 0;
155 
157  virtual unsigned int GetNumberOfParameters( void ) const ITK_OVERRIDE;
158 
160  virtual void Initialize(void);
161 
164  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
165 
167  itkSetObjectMacro(Transform, TransformType);
168 
169 protected:
170 
172  virtual ~ImageToSpatialObjectMetric() ITK_OVERRIDE {}
174  void operator=(const Self &) {}
175  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
176 
181 
185 };
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkImageToSpatialObjectMetric.hxx"
190 #endif
191 
192 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
TransformType::OutputPointType OutputPointType
Computes similarity between a moving spatial obejct and an Image to be registered.
Superclass::ParametersValueType CoordinateRepresentationType
This class is a base for the CostFunctions returning a single value.
TransformType::InputPointType InputPointType
Light weight base class for most itk classes.
TransformType::ParametersType TransformParametersType
vnl_vector_fixed< double, itkGetStaticConstMacro(ObjectDimension) > VectorType
TransformType::JacobianType TransformJacobianType
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(ObjectDimension), itkGetStaticConstMacro(ImageDimension) > TransformType
LinearInterpolateImageFunction< TFixedImage, CoordinateRepresentationType > InterpolatorType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45
Class to hold and manage different parameter types used during optimization.
FixedImageType::ConstPointer FixedImageConstPointer
Linearly interpolate an image at specified positions.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:59
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
MovingSpatialObjectType::Pointer MovingSpatialObjectPointer
MovingSpatialObjectConstPointer m_MovingSpatialObject
MovingSpatialObjectType::ConstPointer MovingSpatialObjectConstPointer