18 #ifndef itkTransform_h
19 #define itkTransform_h
26 #include "vnl/vnl_vector_fixed.h"
27 #include "vnl/vnl_matrix_fixed.h"
80 template<
typename TParametersValueType,
81 unsigned int NInputDimensions = 3,
82 unsigned int NOutputDimensions = 3>
98 static constexpr
unsigned int InputSpaceDimension = NInputDimensions;
99 static constexpr
unsigned int OutputSpaceDimension = NOutputDimensions;
107 return NInputDimensions;
113 return NOutputDimensions;
167 NOutputDimensions, NInputDimensions>;
172 Self::OutputSpaceDimension,
173 Self::InputSpaceDimension>;
176 Self::OutputSpaceDimension,
177 Self::OutputSpaceDimension>;
179 Self::InputSpaceDimension,
180 Self::InputSpaceDimension>;
182 Self::OutputSpaceDimension,
183 Self::InputSpaceDimension>;
196 itkExceptionMacro(
"TransformVector(const InputVectorType &)"
197 "is unimplemented for " << this->GetNameOfClass() );
204 virtual OutputVectorType TransformVector(
205 const InputVectorType & vector,
206 const InputPointType & point )
const;
211 itkExceptionMacro(
"TransformVector( const InputVnlVectorType & ) is "
212 "unimplemented for " << this->GetNameOfClass() );
219 virtual OutputVnlVectorType TransformVector(
220 const InputVnlVectorType & vector,
221 const InputPointType & point )
const;
227 itkExceptionMacro(
"TransformVector( const InputVectorPixelType & ) is "
228 "unimplemented for " << this->GetNameOfClass() );
235 virtual OutputVectorPixelType TransformVector(
236 const InputVectorPixelType & vector,
237 const InputPointType & point )
const;
242 itkExceptionMacro(
"TransformCovariantVector( const InputCovariantVectorType & ) is "
243 "unimplemented for " << this->GetNameOfClass() );
251 virtual OutputCovariantVectorType TransformCovariantVector(
252 const InputCovariantVectorType & vector,
253 const InputPointType & point )
const;
260 itkExceptionMacro(
"TransformCovariantVector(const InputVectorPixelType &)"
261 "is unimplemented for " << this->GetNameOfClass() );
269 virtual OutputVectorPixelType TransformCovariantVector(
270 const InputVectorPixelType & vector,
271 const InputPointType & point )
const;
279 "TransformDiffusionTensor3D( const InputDiffusionTensor3DType & ) is "
280 "unimplemented for " << this->GetNameOfClass() );
288 virtual OutputDiffusionTensor3DType TransformDiffusionTensor3D(
289 const InputDiffusionTensor3DType & tensor,
290 const InputPointType & point )
const;
297 "TransformDiffusionTensor( const InputVectorPixelType & ) is "
298 "unimplemented for " << this->GetNameOfClass() );
301 virtual OutputVectorPixelType TransformDiffusionTensor3D(
302 const InputVectorPixelType & tensor,
303 const InputPointType & point )
const;
310 virtual OutputSymmetricSecondRankTensorType TransformSymmetricSecondRankTensor(
311 const InputSymmetricSecondRankTensorType & tensor,
312 const InputPointType & point )
const;
319 "TransformSymmetricSecondRankTensor( const InputSymmetricSecondRankTensorType & ) is "
320 "unimplemented for " << this->GetNameOfClass() );
328 "TransformSymmetricSecondRankTensor( const InputVectorPixelType & ) is "
329 "unimplemented for " << this->GetNameOfClass() );
338 virtual OutputVectorPixelType TransformSymmetricSecondRankTensor(
339 const InputVectorPixelType & tensor,
340 const InputPointType & point )
const;
349 void SetParameters(
const ParametersType &)
override = 0;
360 this->SetParameters(p);
367 void CopyInParameters(
const ParametersValueType *
const begin,
368 const ParametersValueType *
const end)
override;
374 void CopyInFixedParameters(
const FixedParametersValueType *
const begin,
375 const FixedParametersValueType *
const end)
override;
384 void SetFixedParameters(
const FixedParametersType &)
override = 0;
389 return m_FixedParameters;
399 virtual void UpdateTransformParameters(
const DerivativeType & update,
400 ParametersValueType factor = 1.0 );
412 return this->GetNumberOfParameters();
418 return this->m_Parameters.Size();
424 return this->m_FixedParameters.Size();
452 std::string GetTransformTypeAsString()
const override;
461 return Superclass::UnknownTransformCategory;
466 return ( this->GetTransformCategory() == Superclass::Linear );
503 virtual void ComputeJacobianWithRespectToParameters(
const InputPointType & itkNotUsed(p), JacobianType & itkNotUsed(jacobian) )
const = 0;
508 this->ComputeJacobianWithRespectToParameters(p, jacobian);
520 "ComputeJacobianWithRespectToPosition( InputPointType, JacobianType )"
521 " is unimplemented for " << this->GetNameOfClass() );
523 itkLegacyMacro(
virtual void ComputeJacobianWithRespectToPosition(
const InputPointType & x, JacobianType & jacobian )
const);
532 virtual void ComputeInverseJacobianWithRespectToPosition(
const InputPointType & x,
533 InverseJacobianPositionType & jacobian )
const;
534 itkLegacyMacro(
virtual void ComputeInverseJacobianWithRespectToPosition(
const InputPointType & x, JacobianType & jacobian )
const);
546 Transform(NumberOfParametersType NumberOfParameters);
547 #if defined(__GNUC__) && __GNUC__ < 6
550 ~Transform()
override =
default;
562 template <
typename TType>
565 std::string rval(
"other");
572 std::string rval(
"float");
579 std::string rval(
"double");
587 #ifndef ITK_MANUAL_INSTANTIATION
588 #include "itkTransform.hxx"
Array class with size defined at construction time.
Light weight base class for most itk classes.
Represent a symmetric tensor of second rank.
Represents an array whose length can be defined at run-time.
Array2D class representing a 2D array with size defined at construction time.
A templated class holding a n-Dimensional vector.
Class to hold and manage different parameter types used during optimization.
A templated class holding a geometric point in n-Dimensional space.
Represent a diffusion tensor as used in DTI images.
A templated class holding a n-Dimensional covariant vector.