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;
387 virtual void UpdateTransformParameters(
const DerivativeType & update, TScalarType factor = 1.0 );
399 return this->GetNumberOfParameters();
405 return this->m_Parameters.Size();
416 bool GetInverse(
Self *itkNotUsed(inverseTransform) )
const
433 virtual std::string GetTransformTypeAsString()
const;
450 virtual bool IsLinear()
const
458 virtual bool HasLocalSupport()
const
462 #ifdef ITKV3_COMPATIBILITY
475 virtual const JacobianType & GetJacobian(
const InputPointType & x)
const
477 this->ComputeJacobianWithRespectToParameters(x, m_SharedLocalJacobian);
478 return m_SharedLocalJacobian;
521 "ComputeJacobianWithRespectToParamters( InputPointType, JacobianType"
522 " is unimplemented for " << this->GetNameOfClass() );
535 "ComputeJacobianWithRespectToPosition( InputPointType, JacobianType"
536 " is unimplemented for " << this->GetNameOfClass() );
545 virtual void ComputeInverseJacobianWithRespectToPosition(
const InputPointType & x, JacobianType & jacobian )
const;
556 Transform(NumberOfParametersType NumberOfParameters);
567 #ifdef ITKV3_COMPATIBILITY
576 void operator=(
const Self &);
578 template <
typename TType>
579 std::string GetTransformTypeAsString(TType *)
const
581 std::string rval(
"other");
586 std::string GetTransformTypeAsString(
float *)
const
588 std::string rval(
"float");
593 std::string GetTransformTypeAsString(
double *)
const
595 std::string rval(
"double");
604 #define ITK_TEMPLATE_Transform(_, EXPORT, TypeX, TypeY) \
607 _( 3 ( class EXPORT Transform<ITK_TEMPLATE_3 TypeX> ) ) \
608 namespace Templates \
610 typedef Transform<ITK_TEMPLATE_3 TypeX> Transform##TypeY; \
614 #if ITK_TEMPLATE_EXPLICIT
615 #include "Templates/itkTransform+-.h"
619 #include "itkTransform.hxx"