#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_ItkOrganism #define _INC_ItkOrganism #include "Organism.h" #include "itkImageToImageFilter.h" #include "itkImage.h" #include "itkNumericTraits.h" #include "itkImageRegionIterator.h" using namespace mial; namespace itk { //! A derived class that implements a deformable organism as an itk::ImageToImageFilter. /*! Those wishing to create new deformable organisms with image inputs/outputs should inherit directly from this class. Building a new organism essentially involves inheriting from this class, and placing customized layers directly in the organisms constructor. See Org_EulerSchedule and Org_LevelSetSchedule for details. \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. float) \param nDims The dimensionality of the organism */ template class ITK_EXPORT ItkOrganism : public Organism,public ImageToImageFilter< TInputImage, TOutputImage > { public: /** Extract dimension from input and output image. */ itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension); itkStaticConstMacro(OutputImageDimension, unsigned int,TOutputImage::ImageDimension); /** Convenient typedefs for simplifying declarations. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; typedef TExternalForceImage ExternalForceImageType; /** Standard class typedefs. */ typedef ItkOrganism Self; typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ItkOrganism, ImageToImageFilter); /** Image typedef support. */ typedef typename InputImageType::PixelType InputPixelType; typedef typename OutputImageType::PixelType OutputPixelType; typedef typename NumericTraits::RealType InputRealType; typedef typename InputImageType::RegionType InputImageRegionType; typedef typename OutputImageType::RegionType OutputImageRegionType; typedef typename InputImageType::SizeType InputSizeType; virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError); typedef typename Organism::GeometricType GeometricType; protected: ItkOrganism(); virtual ~ItkOrganism() {} // void PrintSelf(std::ostream& os, Indent indent) const; void GenerateData(); //************************************************* // Organism section //************************************************** public: //virtual bool addBehaviour(Behavior * b){b->setPhysLayer(physLayer);cgLayer->addBehavior(b); return 0;}; //Overide base class function because different physics type is used. //virtual bool addDeformation(Deformation * d){physLayer->addDeformation(d);return 0;}; virtual char* checkMessages(); virtual bool postMessage(); virtual int run(); virtual bool setDefaultBehaviour(); virtual bool setSchedule(); virtual void addNode( DataType *n ){ /*TODO fill in*/ } // inline //virtual bool setPhysicsLayer( Physics *a ){ physLayer = a; return 0; } // inline virtual void writeNodesToFile( std::string fileName ){ this->geomLayer->writeNodesToFile(fileName); } // inline virtual void readNodesFromFile( std::string fileName ){ this->geomLayer->readNodesFromFile(fileName); } // inline }; }//end mial namespace #include "itkOrganism.cxx" #endif /* _INC_ItkOrganism*/