18 #ifndef __itkTransform_h
19 #define __itkTransform_h
26 #include "vnl/vnl_vector_fixed.h"
79 template <
class TScalarType,
80 unsigned int NInputDimensions = 3,
81 unsigned int NOutputDimensions = 3>
95 itkStaticConstMacro(InputSpaceDimension,
unsigned int, NInputDimensions);
96 itkStaticConstMacro(OutputSpaceDimension,
unsigned int, NOutputDimensions);
103 unsigned int GetInputSpaceDimension(
void)
const
105 return NInputDimensions;
109 unsigned int GetOutputSpaceDimension(
void)
const
111 return NOutputDimensions;
152 typedef vnl_vector_fixed<TScalarType, NOutputDimensions>
167 typedef Matrix<TScalarType,
168 itkGetStaticConstMacro(OutputSpaceDimension),
172 itkGetStaticConstMacro(OutputSpaceDimension),
173 itkGetStaticConstMacro(OutputSpaceDimension)>
176 itkGetStaticConstMacro(InputSpaceDimension),
177 itkGetStaticConstMacro(InputSpaceDimension)>
180 itkGetStaticConstMacro(OutputSpaceDimension),
181 itkGetStaticConstMacro(InputSpaceDimension)>
195 itkExceptionMacro(
"TransformVector(const InputVectorType &)"
196 "is unimplemented for " << this->GetNameOfClass() );
203 virtual OutputVectorType TransformVector(
204 const InputVectorType & vector,
205 const InputPointType & point )
const;
210 itkExceptionMacro(
"TransformVector( const InputVnlVectorType & ) is "
211 "unimplemented for " << this->GetNameOfClass() );
218 virtual OutputVnlVectorType TransformVector(
219 const InputVnlVectorType & vector,
220 const InputPointType & point )
const;
226 itkExceptionMacro(
"TransformVector( const InputVectorPixelType & ) is "
227 "unimplemented for " << this->GetNameOfClass() );
234 virtual OutputVectorPixelType TransformVector(
235 const InputVectorPixelType & vector,
236 const InputPointType & point )
const;
241 itkExceptionMacro(
"TransformCovariantVector( const InputCovariantVectorType & ) is "
242 "unimplemented for " << this->GetNameOfClass() );
250 virtual OutputCovariantVectorType TransformCovariantVector(
251 const InputCovariantVectorType & vector,
252 const InputPointType & point )
const;
259 itkExceptionMacro(
"TransformCovariantVector(const InputVectorPixelType &)"
260 "is unimplemented for " << this->GetNameOfClass() );
268 virtual OutputVectorPixelType TransformCovariantVector(
269 const InputVectorPixelType & vector,
270 const InputPointType & point )
const;
278 "TransformDiffusionTensor3D( const InputDiffusionTensor3DType & ) is "
279 "unimplemented for " << this->GetNameOfClass() );
287 virtual OutputDiffusionTensor3DType TransformDiffusionTensor3D(
288 const InputDiffusionTensor3DType & tensor,
289 const InputPointType & point )
const;
296 "TransformDiffusionTensor( const InputVectorPixelType & ) is "
297 "unimplemented for " << this->GetNameOfClass() );
300 virtual OutputVectorPixelType TransformDiffusionTensor3D(
301 const InputVectorPixelType & tensor,
302 const InputPointType & point )
const;
309 virtual OutputSymmetricSecondRankTensorType TransformSymmetricSecondRankTensor(
310 const InputSymmetricSecondRankTensorType & tensor,
311 const InputPointType & point )
const;
318 "TransformSymmetricSecondRankTensor( const InputSymmetricSecondRankTensorType & ) is "
319 "unimplemented for " << this->GetNameOfClass() );
327 "TransformSymmetricSecondRankTensor( const InputVectorPixelType & ) is "
328 "unimplemented for " << this->GetNameOfClass() );
337 virtual OutputVectorPixelType TransformSymmetricSecondRankTensor(
338 const InputVectorPixelType & tensor,
339 const InputPointType & point )
const;
348 virtual void SetParameters(
const ParametersType &) = 0;
359 this->SetParameters(p);
369 virtual void SetFixedParameters(
const ParametersType &) = 0;
374 return m_FixedParameters;
384 virtual void UpdateTransformParameters(
const DerivativeType & update, TScalarType factor = 1.0 );
396 return this->GetNumberOfParameters();
402 return this->m_Parameters.Size();
413 bool GetInverse(
Self *itkNotUsed(inverseTransform) )
const
430 virtual std::string GetTransformTypeAsString()
const;
437 return UnknownTransformCategory;
440 virtual bool IsLinear()
const
442 return ( this->GetTransformCategory() == Linear );
446 #ifdef ITKV3_COMPATIBILITY
458 virtual const JacobianType & GetJacobian(
const InputPointType & x)
const
460 this->ComputeJacobianWithRespectToParameters(x, m_SharedLocalJacobian);
461 return m_SharedLocalJacobian;
504 "ComputeJacobianWithRespectToParamters( InputPointType, JacobianType"
505 " is unimplemented for " << this->GetNameOfClass() );
518 "ComputeJacobianWithRespectToPosition( InputPointType, JacobianType"
519 " is unimplemented for " << this->GetNameOfClass() );
528 virtual void ComputeInverseJacobianWithRespectToPosition(
const InputPointType & x, JacobianType & jacobian )
const;
539 Transform(NumberOfParametersType NumberOfParameters);
550 #ifdef ITKV3_COMPATIBILITY
560 void operator=(
const Self &);
562 template <
typename TType>
563 std::string GetTransformTypeAsString(TType *)
const
565 std::string rval(
"other");
570 std::string GetTransformTypeAsString(
float *)
const
572 std::string rval(
"float");
577 std::string GetTransformTypeAsString(
double *)
const
579 std::string rval(
"double");
587 #ifndef ITK_MANUAL_INSTANTIATION
588 #include "itkTransform.hxx"