From 47b13d7b1b389978ed3df0abb34039f5920115b4 Mon Sep 17 00:00:00 2001 From: delmon Date: Thu, 14 Apr 2011 08:15:32 +0000 Subject: [PATCH] itkv4 migration: + Some methods of itk::Transform are now virtual pure and need to be defined in any class that inherits from it. --- registration/clitkDeformationFieldTransform.h | 57 ++++++++++++++++++- registration/clitkPointListTransform.h | 57 ++++++++++++++++++- 2 files changed, 112 insertions(+), 2 deletions(-) diff --git a/registration/clitkDeformationFieldTransform.h b/registration/clitkDeformationFieldTransform.h index 273376b..0381501 100644 --- a/registration/clitkDeformationFieldTransform.h +++ b/registration/clitkDeformationFieldTransform.h @@ -59,7 +59,62 @@ namespace clitk void SetDeformationField (typename DeformationFieldType::Pointer p){m_DeformationField=p; m_Interpolator->SetInputImage(m_DeformationField);} void SetInterpolator (typename InterpolatorType::Pointer i){ m_Interpolator=i; m_Interpolator->SetInputImage(m_DeformationField);} OutputPointType TransformPoint(const InputPointType &point ) const; - + + // Methods needed to inherit from an itk::Transform which should not be used + // in this class + /** Type of the input parameters. */ + typedef typename Superclass::ParametersType ParametersType; + typedef typename Superclass::ParametersValueType ParametersValueType; + + /** Type of the Jacobian matrix. */ + typedef typename Superclass::JacobianType JacobianType; + + /** Standard vector type for this class. */ + typedef typename Superclass::InputVectorType InputVectorType; + typedef typename Superclass::OutputVectorType OutputVectorType; + + /** Standard covariant vector type for this class */ + typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType; + typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType; + + /** Standard vnl_vector type for this class. */ + typedef typename Superclass::InputVnlVectorType InputVnlVectorType; + typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType; + + void SetParameters(const ParametersType&) + { + itkExceptionMacro( << "DeformationFieldTransform doesn't declare SetParameters" ); + } + + void SetFixedParameters(const ParametersType&) + { + itkExceptionMacro( << "DeformationFieldTransform doesn't declare SetFixedParameters" ); + } + + virtual OutputVectorType TransformVector(const InputVectorType &) const + { + itkExceptionMacro(<< "Method not applicable for deformable transform." ); + return OutputVectorType(); + } + + virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const + { + itkExceptionMacro(<< "Method not applicable for deformable transform. "); + return OutputVnlVectorType(); + } + + virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const + { + itkExceptionMacro(<< "Method not applicable for deformable transfrom. "); + return OutputCovariantVectorType(); + } + + virtual const JacobianType& GetJacobian(const InputPointType &point ) const + { + itkExceptionMacro( << "DeformationFieldTransform doesn't declare GetJacobian" ); + return this->m_Jacobian; + } + protected: DeformationFieldTransform(); ~DeformationFieldTransform(){;} diff --git a/registration/clitkPointListTransform.h b/registration/clitkPointListTransform.h index 3146f80..9561f10 100644 --- a/registration/clitkPointListTransform.h +++ b/registration/clitkPointListTransform.h @@ -67,7 +67,62 @@ namespace clitk PointListType GetCorrespondingPointList(const InputPointType &inputPoint) const; OutputPointType TransformPoint(const InputPointType &point ) const; - + + // Methods needed to inherit from an itk::Transform which should not be used + // in this class + /** Type of the input parameters. */ + typedef typename Superclass::ParametersType ParametersType; + typedef typename Superclass::ParametersValueType ParametersValueType; + + /** Type of the Jacobian matrix. */ + typedef typename Superclass::JacobianType JacobianType; + + /** Standard vector type for this class. */ + typedef typename Superclass::InputVectorType InputVectorType; + typedef typename Superclass::OutputVectorType OutputVectorType; + + /** Standard covariant vector type for this class */ + typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType; + typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType; + + /** Standard vnl_vector type for this class. */ + typedef typename Superclass::InputVnlVectorType InputVnlVectorType; + typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType; + + void SetParameters(const ParametersType&) + { + itkExceptionMacro( << "PointListTransform doesn't declare SetParameters" ); + } + + void SetFixedParameters(const ParametersType&) + { + itkExceptionMacro( << "PointListTransform doesn't declare SetFixedParameters" ); + } + + virtual OutputVectorType TransformVector(const InputVectorType &) const + { + itkExceptionMacro(<< "Method not applicable for deformable transform." ); + return OutputVectorType(); + } + + virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const + { + itkExceptionMacro(<< "Method not applicable for deformable transform. "); + return OutputVnlVectorType(); + } + + virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const + { + itkExceptionMacro(<< "Method not applicable for deformable transfrom. "); + return OutputCovariantVectorType(); + } + + virtual const JacobianType& GetJacobian(const InputPointType &point ) const + { + itkExceptionMacro( << "PointListTransform doesn't declare GetJacobian" ); + return this->m_Jacobian; + } + protected: PointListTransform(); ~PointListTransform(){;} -- 2.47.1