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 
15 #ifndef __itkDeformationFieldInterpolatingTransform_h
16 #define __itkDeformationFieldInterpolatingTransform_h
17 
18 #include <iostream>
19 #include "itkAdvancedTransform.h"
20 #include "itkExceptionObject.h"
21 #include "itkImage.h"
22 #include "itkVectorInterpolateImageFunction.h"
23 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
24 
25 
26 namespace itk
27 {
28 
40  template <
41  class TScalarType=double, // Data type for scalars (float or double)
42  unsigned int NDimensions=3, // Number of input dimensions
43  class TComponentType=double> // ComponentType of the deformation field
45  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
46  {
47  public:
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 
77 
78  typedef typename Superclass
81  typedef typename Superclass
84  typedef typename Superclass
87 
88  typedef TComponentType DeformationFieldComponentType;
89  typedef Vector<DeformationFieldComponentType,
90  itkGetStaticConstMacro(OutputSpaceDimension) > DeformationFieldVectorType;
91  typedef Image< DeformationFieldVectorType,
92  itkGetStaticConstMacro(InputSpaceDimension) > DeformationFieldType;
93 
94  typedef VectorInterpolateImageFunction<
96  typedef VectorNearestNeighborInterpolateImageFunction<
98 
102  virtual void SetParameters( const ParametersType & )
103  {
104  itkExceptionMacro( << "ERROR: SetParameters() is not implemented "
105  << "for DeformationFieldInterpolatingTransform.\n"
106  << "Use SetDeformationField() instead.\n"
107  << "Note that this transform is NOT suited for image registration.\n"
108  << "Just use it as an (initial) fixed transform that is not optimized." );
109  }
110 
112  virtual void SetFixedParameters( const ParametersType & )
113  {
114  // This transform has no fixed parameters.
115  }
116 
118  virtual const ParametersType & GetFixedParameters( void ) const
119  {
120  // This transform has no fixed parameters.
121  return this->m_FixedParameters;
122  }
123 
127  OutputPointType TransformPoint( const InputPointType & point ) const;
128 
131  {
132  itkExceptionMacro(
133  << "TransformVector(const InputVectorType &) is not implemented "
134  << "for DeformationFieldInterpolatingTransform" );
135  }
137  {
138  itkExceptionMacro(
139  << "TransformVector(const InputVnlVectorType &) is not implemented "
140  << "for DeformationFieldInterpolatingTransform" );
141  }
143  {
144  itkExceptionMacro(
145  << "TransformCovariantVector(const InputCovariantVectorType &) is not implemented "
146  << "for DeformationFieldInterpolatingTransform" );
147  }
148 
151  void SetIdentity( void );
152 
154  virtual void SetDeformationField( DeformationFieldType * _arg );
155  itkGetObjectMacro( DeformationField, DeformationFieldType );
156 
159  itkGetObjectMacro( DeformationFieldInterpolator, DeformationFieldInterpolatorType );
160 
161  virtual bool IsLinear( void ) const { return false; };
162 
164  virtual void GetJacobian(
165  const InputPointType & ipp, JacobianType & j,
166  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
167  {
168  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
169  }
170 
171  virtual void GetSpatialJacobian(
172  const InputPointType & ipp, SpatialJacobianType & sj ) const
173  {
174  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
175  }
176  virtual void GetSpatialHessian(
177  const InputPointType & ipp, SpatialHessianType & sh ) const
178  {
179  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
180  }
183  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
184  {
185  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
186  }
188  const InputPointType & ipp, SpatialJacobianType & sj,
190  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
191  {
192  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
193  }
195  const InputPointType & ipp, JacobianOfSpatialHessianType & jsh,
196  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
197  {
198  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
199  }
201  const InputPointType & ipp, SpatialHessianType & sh,
203  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
204  {
205  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
206  }
207 
208  protected:
211 
213  typedef typename DeformationFieldInterpolatorType::ContinuousIndexType
215  typedef typename DeformationFieldInterpolatorType::OutputType InterpolatorOutputType;
216 
218  void PrintSelf(std::ostream &os, Indent indent) const;
219 
220  typename DeformationFieldType::Pointer m_DeformationField;
221  typename DeformationFieldType::Pointer m_ZeroDeformationField;
222  typename DeformationFieldInterpolatorType::Pointer m_DeformationFieldInterpolator;
223 
224  private:
225  DeformationFieldInterpolatingTransform(const Self&); //purposely not implemented
226  void operator=(const Self&); //purposely not implemented
227 
228  }; //class DeformationFieldInterpolatingTransform
229 
230 
231 } // namespace itk
232 
233 
234 #ifndef ITK_MANUAL_INSTANTIATION
235 #include "itkDeformationFieldInterpolatingTransform.txx"
236 #endif
237 
238 #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
DeformationFieldInterpolatorType::Pointer m_DeformationFieldInterpolator
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
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Vector< DeformationFieldComponentType, itkGetStaticConstMacro(OutputSpaceDimension) > DeformationFieldVectorType
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
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
virtual void SetDeformationFieldInterpolator(DeformationFieldInterpolatorType *_arg)
Image< DeformationFieldVectorType, itkGetStaticConstMacro(InputSpaceDimension) > DeformationFieldType
virtual void GetJacobianOfSpatialHessian(const InputPointType &ipp, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Transform that interpolates a given deformation field.
VectorNearestNeighborInterpolateImageFunction< DeformationFieldType, ScalarType > DefaultDeformationFieldInterpolatorType
virtual void GetJacobianOfSpatialJacobian(const InputPointType &ipp, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
virtual void GetJacobian(const InputPointType &ipp, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
DeformationFieldInterpolatorType::ContinuousIndexType InputContinuousIndexType


Generated on 04-01-2014 for elastix by doxygen 1.8.5 elastix logo