#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_DEFORMATION #define _INC_DEFORMATION #include "stdafx.h" #include #include #include #include #include "itkSmartPointer.h" #include "itkLightObject.h" #include namespace mial { //-status: 1: complete, 0: incomplete, -1 failed. //! An abstract base class for deformations. /*! Each deformation is in charge of unmarshaling its own arguments. \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 Deformation:public itk::LightObject { public: //Smart pointers typedef Deformation Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; //itkNewMacro(Self); public: //! Public typedef for the internal matrix type typedef MType MatrixType; //! Public typedef for the internal vector type typedef VType VectorType; //! These define the standard "hidden" argument set for a deformation that allow to manipulate the model /*! Contains the Physics layer specific arguments that a deformation uses to initiate deformations. */ struct DefArgSet { // TODO:: fill in }; //! The error structure. struct Error { std::string name; std::string msg; }; //! A structure defining the inputs of a Deformation. /*! Since structures support public inheritance derived class must inherit from this class in their definitions of deformationIn. */ struct deformationIn:public itk::LightObject{ //Define all common deformation inputs here typedef deformationIn Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; //typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); protected: deformationIn(){}; }; private: int status; protected: //! The name of the deformation used to identify itself in a list of deformations std::string name; public: //! Run method for running this deformation /*! Note that one and only one of i,s can be non-NULL. \param i the deformationIn structure. \param s the deformation arguments as a stream. To support, one would typically define a conversion method in the deformationIN class of the derived deformation class. */ virtual bool run(deformationIn * i,DefArgSet* org, std::stringstream *s = NULL) =0; //! Get the status of the deformation. virtual int getStatus(); //! Get the name of the deformation. virtual std::string getName(); protected: Deformation(){}; }; } // end namespace mial #include "Deformation.cxx" #endif /* _INC_DEFORMATION */