go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkDeformationFieldInterpolatingTransform.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 #ifndef __itkDeformationFieldInterpolatingTransform_h
15 #define __itkDeformationFieldInterpolatingTransform_h
16 
17 #include <iostream>
18 #include "itkAdvancedTransform.h"
19 #include "itkExceptionObject.h"
20 #include "itkImage.h"
21 #include "itkVectorInterpolateImageFunction.h"
22 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
23 
24 namespace itk
25 {
26 
38 template<
39 class TScalarType = double, // Data type for scalars (float or double)
40 unsigned int NDimensions = 3, // Number of input dimensions
41 class TComponentType = double >
42 // ComponentType of the deformation field
44  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
45 {
46 public:
47 
51  typedef SmartPointer< Self > Pointer;
52  typedef SmartPointer< const Self > ConstPointer;
53 
55  itkNewMacro( Self );
56 
59 
61  itkStaticConstMacro( InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension );
62  itkStaticConstMacro( OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension );
63 
82 
84 
85  typedef TComponentType DeformationFieldComponentType;
86  typedef Vector< DeformationFieldComponentType,
87  itkGetStaticConstMacro( OutputSpaceDimension ) > DeformationFieldVectorType;
88  typedef Image< DeformationFieldVectorType,
89  itkGetStaticConstMacro( InputSpaceDimension ) > DeformationFieldType;
90  typedef typename DeformationFieldType::Pointer DeformationFieldPointer;
91 
92  typedef VectorInterpolateImageFunction<
94  typedef typename DeformationFieldInterpolatorType::Pointer DeformationFieldInterpolatorPointer;
95  typedef VectorNearestNeighborInterpolateImageFunction<
97 
101  virtual void SetParameters( const ParametersType & )
102  {
103  itkExceptionMacro( << "ERROR: SetParameters() is not implemented "
104  << "for DeformationFieldInterpolatingTransform.\n"
105  << "Use SetDeformationField() instead.\n"
106  << "Note that this transform is NOT suited for image registration.\n"
107  << "Just use it as an (initial) fixed transform that is not optimized." );
108  }
109 
110 
112  virtual void SetFixedParameters( const ParametersType & )
113  {
114  // This transform has no fixed parameters.
115  }
116 
117 
119  virtual const ParametersType & GetFixedParameters( void ) const
120  {
121  // This transform has no fixed parameters.
122  return this->m_FixedParameters;
123  }
124 
125 
129  OutputPointType TransformPoint( const InputPointType & point ) const;
130 
133  {
134  itkExceptionMacro(
135  << "TransformVector(const InputVectorType &) is not implemented "
136  << "for DeformationFieldInterpolatingTransform" );
137  }
138 
139 
141  {
142  itkExceptionMacro(
143  << "TransformVector(const InputVnlVectorType &) is not implemented "
144  << "for DeformationFieldInterpolatingTransform" );
145  }
146 
147 
149  {
150  itkExceptionMacro(
151  << "TransformCovariantVector(const InputCovariantVectorType &) is not implemented "
152  << "for DeformationFieldInterpolatingTransform" );
153  }
154 
155 
158  void SetIdentity( void );
159 
161  virtual void SetDeformationField( DeformationFieldType * _arg );
162 
163  itkGetObjectMacro( DeformationField, DeformationFieldType );
164 
167 
168  itkGetObjectMacro( DeformationFieldInterpolator, DeformationFieldInterpolatorType );
169 
170  virtual bool IsLinear( void ) const { return false; }
171 
173  virtual void GetJacobian(
174  const InputPointType & ipp, JacobianType & j,
175  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
176  {
177  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
178  }
179 
180 
181  virtual void GetSpatialJacobian(
182  const InputPointType & ipp, SpatialJacobianType & sj ) const
183  {
184  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
185  }
186 
187 
188  virtual void GetSpatialHessian(
189  const InputPointType & ipp, SpatialHessianType & sh ) const
190  {
191  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
192  }
193 
194 
197  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
198  {
199  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
200  }
201 
202 
204  const InputPointType & ipp, SpatialJacobianType & sj,
206  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
207  {
208  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
209  }
210 
211 
213  const InputPointType & ipp, JacobianOfSpatialHessianType & jsh,
214  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
215  {
216  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
217  }
218 
219 
221  const InputPointType & ipp, SpatialHessianType & sh,
223  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
224  {
225  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
226  }
227 
228 
229 protected:
230 
233 
235  typedef typename DeformationFieldInterpolatorType::ContinuousIndexType
237  typedef typename DeformationFieldInterpolatorType::OutputType InterpolatorOutputType;
238 
240  void PrintSelf( std::ostream & os, Indent indent ) const;
241 
245 
246 private:
247 
248  DeformationFieldInterpolatingTransform( const Self & ); // purposely not implemented
249  void operator=( const Self & ); // purposely not implemented
250 
251 };
252 
253 } // namespace itk
254 
255 #ifndef ITK_MANUAL_INSTANTIATION
256 #include "itkDeformationFieldInterpolatingTransform.hxx"
257 #endif
258 
259 #endif /* __itkDeformationFieldInterpolatingTransform_h */
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
DeformationFieldInterpolatorType::OutputType InterpolatorOutputType
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const
OutputPointType TransformPoint(const InputPointType &point) const
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
DeformationFieldInterpolatorType::Pointer DeformationFieldInterpolatorPointer
virtual const ParametersType & GetFixedParameters(void) const
itkStaticConstMacro(InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension)
void PrintSelf(std::ostream &os, Indent indent) const
virtual void GetSpatialHessian(const InputPointType &ipp, SpatialHessianType &sh) const
virtual void GetJacobianOfSpatialJacobian(const InputPointType &ipp, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Image< DeformationFieldVectorType, itkGetStaticConstMacro(InputSpaceDimension) > DeformationFieldType
VectorInterpolateImageFunction< DeformationFieldType, ScalarType > DeformationFieldInterpolatorType
Transform maps points, vectors and covariant vectors from an input space to an output space...
virtual void GetSpatialJacobian(const InputPointType &ipp, SpatialJacobianType &sj) const
virtual void GetJacobianOfSpatialHessian(const InputPointType &ipp, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
virtual void SetDeformationField(DeformationFieldType *_arg)
virtual OutputVectorType TransformVector(const InputVectorType &) const
virtual void SetDeformationFieldInterpolator(DeformationFieldInterpolatorType *_arg)
virtual void GetJacobianOfSpatialHessian(const InputPointType &ipp, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Transform that interpolates a given deformation field.
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
VectorNearestNeighborInterpolateImageFunction< DeformationFieldType, ScalarType > DefaultDeformationFieldInterpolatorType
virtual void GetJacobianOfSpatialJacobian(const InputPointType &ipp, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Vector< DeformationFieldComponentType, itkGetStaticConstMacro(OutputSpaceDimension) > DeformationFieldVectorType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
virtual void GetJacobian(const InputPointType &ipp, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
DeformationFieldInterpolatorType::ContinuousIndexType InputContinuousIndexType


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo