18 #ifndef sitkTransform_h
19 #define sitkTransform_h
34 #if ( ( SITK_ITK_VERSION_MAJOR == 4 ) && ( SITK_ITK_VERSION_MINOR < 5 ) )
37 template<
typename TScalar >
class TransformBaseTemplate;
41 template<
typename TScalar,
unsigned int NDimension>
class CompositeTransform;
46 class PimpleTransformBase;
96 template<
unsigned int NDimension>
98 : m_PimpleTransform( NULL )
100 sitkStaticAssert( NDimension == 2 || NDimension == 3,
"Only 2D and 3D transforms are supported" );
101 if ( compositeTransform == NULL )
105 this->InternalInitialization<NDimension>(
sitkComposite, compositeTransform );
159 unsigned int GetDimension(
void )
const;
166 void SetParameters (
const std::vector<double>& parameters );
167 std::vector<double> GetParameters(
void )
const ;
173 void SetFixedParameters (
const std::vector<double>& parameters );
174 std::vector<double> GetFixedParameters(
void )
const ;
178 SITK_RETURN_SELF_TYPE_HEADER AddTransform(
Transform t );
180 std::vector< double > TransformPoint(
const std::vector< double > &point )
const;
185 virtual bool IsLinear()
const;
187 virtual void SetIdentity();
199 virtual bool SetInverse();
210 std::string ToString(
void )
const;
214 virtual std::string GetName()
const;
223 void MakeUnique(
void );
228 explicit Transform( PimpleTransformBase *pimpleTransform );
233 virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
237 template<
unsigned int VDimension>
244 template<
typename TransformType >
245 void operator() (
void )
const
247 TransformType *t =
dynamic_cast<TransformType*
>(transform);
256 template<
class TransformType>
257 void InternalInitialization( TransformType *t );
261 template<
unsigned int >
262 void InternalBSplineInitialization(
Image & img );
264 template<
typename TDisplacementType >
265 void InternalDisplacementInitialization(
Image & img );
267 template <
class TMemberFunctionPo
inter >
270 typedef typename ::detail::FunctionTraits<TMemberFunctionPointer>::ClassType
ObjectType;
272 template<
typename TImageType >
273 TMemberFunctionPointer operator() (
void )
const
275 return &ObjectType::template InternalDisplacementInitialization< TImageType >;
295 #endif // sitkTransform_h
SITKCommon_EXPORT Transform ReadTransform(const std::string &filename)
SITKCommon_EXPORT void WriteTransform(const Transform &transform, const std::string &filename)
#define SITKCommon_EXPORT
The main Image class for SimpleITK.
#define sitkStaticAssert(expr, str)
#define sitkExceptionMacro(x)
TransformBaseTemplate< double > TransformBase