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  * Copyright UMC Utrecht and contributors
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 __itkDeformationFieldInterpolatingTransform_h
19 #define __itkDeformationFieldInterpolatingTransform_h
20 
21 #include <iostream>
22 #include "itkAdvancedTransform.h"
23 #include "itkExceptionObject.h"
24 #include "itkImage.h"
25 #include "itkVectorInterpolateImageFunction.h"
26 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
27 
28 namespace itk
29 {
30 
42 template<
43 class TScalarType = double, // Data type for scalars (float or double)
44 unsigned int NDimensions = 3, // Number of input dimensions
45 class TComponentType = double >
46 // ComponentType of the deformation field
48  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
49 {
50 public:
51 
56  typedef SmartPointer< const Self > ConstPointer;
57 
59  itkNewMacro( Self );
60 
63 
65  itkStaticConstMacro( InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension );
66  itkStaticConstMacro( OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension );
67 
86 
88 
89  typedef TComponentType DeformationFieldComponentType;
90  typedef Vector< DeformationFieldComponentType,
91  itkGetStaticConstMacro( OutputSpaceDimension ) > DeformationFieldVectorType;
93  itkGetStaticConstMacro( InputSpaceDimension ) > DeformationFieldType;
94  typedef typename DeformationFieldType::Pointer DeformationFieldPointer;
95 
96  typedef VectorInterpolateImageFunction<
98  typedef typename DeformationFieldInterpolatorType::Pointer DeformationFieldInterpolatorPointer;
99  typedef VectorNearestNeighborInterpolateImageFunction<
101 
105  virtual void SetParameters( const ParametersType & )
106  {
107  itkExceptionMacro( << "ERROR: SetParameters() is not implemented "
108  << "for DeformationFieldInterpolatingTransform.\n"
109  << "Use SetDeformationField() instead.\n"
110  << "Note that this transform is NOT suited for image registration.\n"
111  << "Just use it as an (initial) fixed transform that is not optimized." );
112  }
113 
114 
116  virtual void SetFixedParameters( const ParametersType & )
117  {
118  // This transform has no fixed parameters.
119  }
120 
121 
123  virtual const ParametersType & GetFixedParameters( void ) const
124  {
125  // This transform has no fixed parameters.
126  return this->m_FixedParameters;
127  }
128 
129 
133  OutputPointType TransformPoint( const InputPointType & point ) const;
134 
136  virtual OutputVectorType TransformVector( const InputVectorType & ) const
137  {
138  itkExceptionMacro(
139  << "TransformVector(const InputVectorType &) is not implemented "
140  << "for DeformationFieldInterpolatingTransform" );
141  }
142 
143 
144  virtual OutputVnlVectorType TransformVector( const InputVnlVectorType & ) const
145  {
146  itkExceptionMacro(
147  << "TransformVector(const InputVnlVectorType &) is not implemented "
148  << "for DeformationFieldInterpolatingTransform" );
149  }
150 
151 
152  virtual OutputCovariantVectorType TransformCovariantVector( const InputCovariantVectorType & ) const
153  {
154  itkExceptionMacro(
155  << "TransformCovariantVector(const InputCovariantVectorType &) is not implemented "
156  << "for DeformationFieldInterpolatingTransform" );
157  }
158 
159 
162  void SetIdentity( void );
163 
165  virtual void SetDeformationField( DeformationFieldType * _arg );
166 
167  itkGetObjectMacro( DeformationField, DeformationFieldType );
168 
170  virtual void SetDeformationFieldInterpolator( DeformationFieldInterpolatorType * _arg );
171 
172  itkGetObjectMacro( DeformationFieldInterpolator, DeformationFieldInterpolatorType );
173 
174  virtual bool IsLinear( void ) const { return false; }
175 
177  virtual void GetJacobian(
178  const InputPointType & ipp, JacobianType & j,
179  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
180  {
181  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
182  }
183 
184 
185  virtual void GetSpatialJacobian(
186  const InputPointType & ipp, SpatialJacobianType & sj ) const
187  {
188  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
189  }
190 
191 
192  virtual void GetSpatialHessian(
193  const InputPointType & ipp, SpatialHessianType & sh ) const
194  {
195  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
196  }
197 
198 
200  const InputPointType & ipp, JacobianOfSpatialJacobianType & jsj,
201  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
202  {
203  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
204  }
205 
206 
208  const InputPointType & ipp, SpatialJacobianType & sj,
209  JacobianOfSpatialJacobianType & jsj,
210  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
211  {
212  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
213  }
214 
215 
217  const InputPointType & ipp, JacobianOfSpatialHessianType & jsh,
218  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
219  {
220  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
221  }
222 
223 
225  const InputPointType & ipp, SpatialHessianType & sh,
226  JacobianOfSpatialHessianType & jsh,
227  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
228  {
229  itkExceptionMacro( << "Not implemented for DeformationFieldInterpolatingTransform" );
230  }
231 
232 
233 protected:
234 
237 
239  typedef typename DeformationFieldInterpolatorType::ContinuousIndexType
241  typedef typename DeformationFieldInterpolatorType::OutputType InterpolatorOutputType;
242 
244  void PrintSelf( std::ostream & os, Indent indent ) const;
245 
246  DeformationFieldPointer m_DeformationField;
247  DeformationFieldPointer m_ZeroDeformationField;
248  DeformationFieldInterpolatorPointer m_DeformationFieldInterpolator;
249 
250 private:
251 
252  DeformationFieldInterpolatingTransform( const Self & ); // purposely not implemented
253  void operator=( const Self & ); // purposely not implemented
254 
255 };
256 
257 } // namespace itk
258 
259 #ifndef ITK_MANUAL_INSTANTIATION
260 #include "itkDeformationFieldInterpolatingTransform.hxx"
261 #endif
262 
263 #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 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo