#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_Org_EulerSchedule #define _INC_Org_EulerSchedule #include "itkOrganism.h" #include "itkImageToImageFilter.h" #include "itkImage.h" #include "itkNumericTraits.h" #include "itkImageRegionIterator.h" //#include "itkImage.h" #include #include "Phys_Euler.h" #include "Ctrl_ScheduleDriven.h" #include "Beh_SearchForObject.h" #include "Beh_TranslateAll.h" #include "Def_Translation.h" #include "Beh_UniformScale.h" #include "Def_UniformScale.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_Euler 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_TranslateAll Def_TranslateAll Beh_SearchForObject 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_EulerSchedule : public ItkOrganism { public: /** Extract dimension from input and output image. */ itkStaticConstMacro(InputImageDimension, unsigned int,TInputImage::ImageDimension); itkStaticConstMacro(OutputImageDimension, unsigned int,TOutputImage::ImageDimension); typedef Org_EulerSchedule Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(Org_EulerSchedule, ItkOrganism); typedef Geom_MeshSpatialObject GeometricType; typedef Phys_Euler PhysLayerType; typedef Sense_Gradient gradientSensorType; //! Set the schedule virtual bool setSchedule(std::string scheduleFileName){return cgL->setSchedule(scheduleFileName);}; //! Set the topology virtual bool setTopology(std::string fName){ return geomLayer->readTopologyFromFile(fName);}; //! SetUp the organism virtual void setUp() { input->sigma = 1.0; input->imageIn = this->GetInput(); gradientSensor->run(input); gradientSensor->run(input); typename gradientSensorType::sensorOut::Pointer output = (typename gradientSensorType::sensorOut *) ( gradientSensor->getOutput()).GetPointer(); physLayer->setExternalForces((void *) &(output->imageOut)); beh0->image = this->GetInput(); beh0->geomLayer = geomLayer; } protected: typename Ctrl_ScheduleDriven::Pointer cgL; typename GeometricType::Pointer geomLayer; typename PhysLayerType::Pointer physLayer; typename gradientSensorType::sensorIn::Pointer input; typename gradientSensorType::Pointer gradientSensor; typename Beh_SearchForObject::Pointer beh0; Org_EulerSchedule(); virtual ~Org_EulerSchedule() {} // void PrintSelf(std::ostream& os, Indent indent) const; }; }//end mial namespace #include "Org_EulerSchedule.cxx" #endif /* _INC_Org_EulerSchedule*/