#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_DEF_UniformScaleLevelSet #define _INC_DEF_UniformScaleLevelSet #include "stdafx.h" #include "LevelSetDeformation.h" #include "itkSmartPointer.h" #include #include "itkImageRegionIterator.h" namespace mial { //! An example level set deformation that scales the deformable organism by adding a single user-provided value to each voxel of the level set. /*! \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_UniformScaleLevelSet: public LevelSetDeformation { public: //Smartpointers typedef Def_UniformScaleLevelSet Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; //typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); //! Example run method that scales a deformable organism by adding a user-provided constant value to each voxel of the level set. virtual bool run(typename Deformation::deformationIn* i,typename Deformation::DefArgSet* org, std::stringstream *s = NULL); typedef typename itk::ImageRegionIterator< typename LevelSetDeformation::DistanceImageType> IteratorType; typedef typename LevelSetDeformation::DefArgSet DefArgSet; typedef typename LevelSetDeformation::Error Error; //! 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 by adding its value to each voxel of the level set. 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_UniformScaleLevelSet(); }; } // end namespace mial #include "Def_UniformScaleLevelSet.cxx" #endif /* _INC_DEF_UniformScaleLevelSet*/