18 #ifndef sitkTransform_h
19 #define sitkTransform_h
30 template<
typename TScalar >
class TransformBaseTemplate;
40 class PimpleTransformBase;
93 template<
unsigned int NDimension>
95 : m_PimpleTransform( nullptr )
97 static_assert( NDimension == 2 || NDimension == 3,
"Only 2D and 3D transforms are supported" );
98 if ( compositeTransform ==
nullptr )
102 this->InternalInitialization<NDimension>(
sitkComposite, compositeTransform );
156 unsigned int GetDimension( )
const;
163 void SetParameters (
const std::vector<double>& parameters );
164 std::vector<double> GetParameters( )
const;
168 unsigned int GetNumberOfParameters( )
const;
173 void SetFixedParameters (
const std::vector<double>& parameters );
174 std::vector<double> GetFixedParameters( )
const;
178 unsigned int GetNumberOfFixedParameters( )
const;
184 std::vector< double > TransformPoint(
const std::vector< double > &point )
const;
197 std::vector< double > TransformVector(
const std::vector< double > &vector,
const std::vector< double > &point)
const;
202 virtual bool IsLinear()
const;
204 virtual void SetIdentity();
216 virtual bool SetInverse();
227 std::string ToString( )
const;
231 virtual std::string GetName()
const;
254 explicit Transform( PimpleTransformBase *pimpleTransform );
259 virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
263 template<
unsigned int VDimension>
270 template<
typename TransformType >
271 void operator() ( )
const
273 TransformType *t =
dynamic_cast<TransformType*
>(transform);
282 template<
class TransformType>
283 void InternalInitialization( TransformType *t );
287 template<
unsigned int >
288 void InternalBSplineInitialization(
Image & img );
290 template<
typename TDisplacementType >
291 void InternalDisplacementInitialization(
Image & img );
293 template <
class TMemberFunctionPo
inter >
296 using ObjectType = typename ::detail::FunctionTraits<TMemberFunctionPointer>::ClassType;
298 template<
typename TImageType >
299 TMemberFunctionPointer operator() ( )
const
301 return &ObjectType::template InternalDisplacementInitialization< TImageType >;
321 #endif // sitkTransform_h