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;
97 template<
unsigned int NDimension>
101 sitkStaticAssert( NDimension == 2 || NDimension == 3,
"Only 2D and 3D transforms are supported" );
106 this->InternalInitialization<NDimension>(
sitkComposite, compositeTransform );
160 unsigned int GetDimension(
void )
const;
167 void SetParameters (
const std::vector<double>& parameters );
168 std::vector<double> GetParameters(
void )
const;
172 unsigned int GetNumberOfParameters(
void )
const;
177 void SetFixedParameters (
const std::vector<double>& parameters );
178 std::vector<double> GetFixedParameters(
void )
const;
182 unsigned int GetNumberOfFixedParameters(
void )
const;
185 SITK_RETURN_SELF_TYPE_HEADER AddTransform(
Transform t );
197 SITK_RETURN_SELF_TYPE_HEADER FlattenTransform();
203 std::vector< double > TransformPoint(
const std::vector< double > &point )
const;
216 std::vector< double > TransformVector(
const std::vector< double > &vector,
const std::vector< double > &point)
const;
221 virtual bool IsLinear()
const;
223 virtual void SetIdentity();
235 virtual bool SetInverse();
246 std::string ToString(
void )
const;
250 virtual std::string GetName()
const;
259 void MakeUnique(
void );
264 explicit Transform( PimpleTransformBase *pimpleTransform );
269 virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
273 template<
unsigned int VDimension>
280 template<
typename TransformType >
281 void operator() (
void )
const
283 TransformType *t =
dynamic_cast<TransformType*
>(transform);
292 template<
class TransformType>
293 void InternalInitialization( TransformType *t );
297 template<
unsigned int >
298 void InternalBSplineInitialization(
Image & img );
300 template<
typename TDisplacementType >
301 void InternalDisplacementInitialization(
Image & img );
303 template <
class TMemberFunctionPo
inter >
306 typedef typename ::detail::FunctionTraits<TMemberFunctionPointer>::ClassType
ObjectType;
308 template<
typename TImageType >
309 TMemberFunctionPointer operator() (
void )
const
311 return &ObjectType::template InternalDisplacementInitialization< TImageType >;
331 #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 Image class for SimpleITK.
#define sitkStaticAssert(expr, str)
#define sitkExceptionMacro(x)
TransformBaseTemplate< double > TransformBase