#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_DEF_UniformScale #define _INC_DEF_UniformScale #include "stdafx.h" #include "SpringMassDeformation.h" #include "itkSmartPointer.h" #include namespace mial { //! An example spring-mass deformation that scales the organism by increasing the rest lengths of all its springs. /*! \param DataType the type of container \param nDims the dimensionality of the deformation \param MType The matrix type used \param VType The vector type used */ template, class VType = vnl_vector > class Def_UniformScale: public SpringMassDeformation { public: //Smartpointers typedef Def_UniformScale Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; //typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); //! Example run method that scales a deformable organism by increasing the rest lengths of all its springs. virtual bool run(typename Deformation::deformationIn* i,typename Deformation::DefArgSet* org, std::stringstream *s = NULL); typedef typename SpringMassDeformation::Error Error; typedef typename SpringMassDeformation::DefArgSet DefArgSet; //! A structure defining the inputs for the deformation. /*! Since structures support public inheritance derived class must inherit from this class in their definitions of deformationIn. */ struct deformationIn: public Deformation::deformationIn{ //Smartpointers typedef deformationIn Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; //typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); //Define all custom here //! The amount to scale each spring by. double scaleAmount; //! fills the structure using a stream as input. (Unmarshalls the data). /*! Stream is expected as "scaleAmount" \param args the stream to be read. */ bool fillFromStream(std::stringstream &args){args >> scaleAmount;return false;} protected: deformationIn(){}; }; protected: Def_UniformScale(); }; } // end namespace mial #include "Def_UniformScale.cxx" #endif /* _INC_DEF_UniformScale*/