#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_DEF_TRANSLATION #define _INC_DEF_TRANSLATION #include "stdafx.h" #include "SpringMassDeformation.h" #include "itkSmartPointer.h" #include namespace mial { //! An example spring-mass deformation that translates the mesh. /*! \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_Translation: public SpringMassDeformation { public: //Smartpointers typedef Def_Translation Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; //typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); //! An implementation of the run method that places translation forces on all nodes in the mesh. 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 amplitude of the translation in each dimension. Added directly as a force to all nodes of the spring-mass system. double amplitude[nDims]; //! A method for converting stream-based arguments into the structures members (marshalling). /*! Stream is expected as "amplitudeX amplitudeY amplitudeZ(3D only)" */ bool fillFromStream(std::stringstream &args){for(int i=0;i> amplitude[i];}return false;} protected: deformationIn(){}; }; protected: Def_Translation(); }; } // end namespace mial #include "Def_Translation.cxx" #endif /* _INC_DEF_TRANSLATION*/