#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_Org_LevelSetSchedule #define _INC_Org_LevelSetSchedule #include "itkOrganism.h" #include "itkImageToImageFilter.h" #include "itkImage.h" #include "itkNumericTraits.h" #include "itkImageRegionIterator.h" //#include "itkImage.h" #include #include "Phys_LevelSet.h" #include "Ctrl_ScheduleDriven.h" #include "Beh_UniformScale.h" #include "Def_UniformScaleLevelSet.h" #include "Sense_Gradient.h" #include "Geom_MeshSpatialObject.h" using namespace mial; namespace itk { //! A derived class that implements an itkOrganism that posses built in Phys_LevelSet and Ctrl_Schedule layers, along with corresponding behaviors and deformations. /*! This class contains built in layers, and is therefore an example of a complete deformable organism. Though additional behaviors/deformations can still be added the following are provided. Beh_UniformScale Def_UniformScale \param TInputImage the input image type \param TOutputImage the output image type \param TExternalForceImage the type of image used for external forces \param DataType The data type to use (eg. DataType) \param nDims The dimensionality of the organism */ template class ITK_EXPORT Org_LevelSetSchedule : public ItkOrganism { public: /** Extract dimension from input and output image. */ itkStaticConstMacro(InputImageDimension, unsigned int,TInputImage::ImageDimension); itkStaticConstMacro(OutputImageDimension, unsigned int,TOutputImage::ImageDimension); typedef Org_LevelSetSchedule Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(Org_LevelSetSchedule, ItkOrganism); typedef Geom_MeshSpatialObject GeometricType; typedef Phys_LevelSet PhysLayerType; //! Set the schedule virtual bool setSchedule(std::string scheduleFileName){return cgL->setSchedule(scheduleFileName);}; //! Set the topology from a binary image virtual void setTopologyFromBinaryImage(typename GeometricType::BinaryImageType::Pointer img){geomLayer->generateTopologyFromBinaryImage(img);}; virtual void writeObjectToFile(std::string fname){geomLayer->writeObjectToFile(fname);}; //! Set the toplogy from a file virtual bool setTopology(std::string fName){ return geomLayer->readTopologyFromFile(fName);}; virtual void setUp() { //itk::Image tp = this->GetInput(); //const TInputImage* tp = this->GetInput(); physLayer->setInput(this->GetInput()); physLayer->setNumIterations(20); } protected: typename Ctrl_ScheduleDriven::Pointer cgL; typename GeometricType::Pointer geomLayer; typename PhysLayerType::Pointer physLayer; Org_LevelSetSchedule(); virtual ~Org_LevelSetSchedule() {} // void PrintSelf(std::ostream& os, Indent indent) const; }; }//end mial namespace #include "Org_LevelSetSchedule.cxx" #endif /* _INC_Org_LevelSetSchedule*/