mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType > Class Template Reference

A derived physics class capable of carrying out deformations of a spring mass system. More...

#include <Phys_Euler.h>

Inheritance diagram for mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >:

mial::Physics< Type, nDims, MType, VType > mial::Phys_VesselCrawlerEuler< DataType, TGradientImage, nDims, MType, VType > List of all members.

Public Types

typedef Phys_Euler Self
typedef itk::SmartPointer<
Self
Pointer
typedef itk::SmartPointer<
const Self
ConstPointer
typedef itk::WeakPointer<
const Self
ConstWeakPointer
typedef SpringMassDeformation<
DataType, nDims, MType, VType > 
DeformationType
 The type of deformation's used. Notice they must be of the same internal storage types and dimension as the physics class.
typedef MType MatrixType
typedef VType VectorType
typedef TGradientImage GradientImageType

Public Member Functions

virtual bool runDeformation (const std::string defName, typename DeformationType::deformationIn *const i, std::stringstream *const s=NULL)
 Run a deformation.
virtual void setRestLengths (int *a, DataType *values, int n)
 Set the restlengths of the specified springs to the specified values.
virtual void setRestLengths (VectorType a, VectorType values)
 Set the restlengths of the specified springs to the specified values.
virtual void setTimeStep (double a)
 Set the time step.
virtual void setSpringLengths (int *a, DataType *values, int n)
 Set the lengths of the specified springs to the specified values.
virtual void setSpringLengths (VectorType a, VectorType values)
 Set the lengths of the specified springs to the specified values.
virtual void setSpringsK (int *a, DataType *values, int n)
 Set the Hooke's constants of the specified springs to the specified values.
virtual void setSpringsK (VectorType a, VectorType values)
 Set the Hooke's constants of the specified springs to the specified values.
virtual void enableImageForces ()
 enable image forces (defaultly enabled)
virtual void disableImageForces ()
 disable image forces (defaultly enabled)
virtual bool simulate ()
 Simulate the deformation dynamics.
virtual void setExternalForces (void *f)
 Set the external forces to be used during the simulation.

Protected Types

typedef GradientImageType::Pointer GradientImageTypePointer
 Typedef for the type of gradient image smart pointer used.

Protected Member Functions

 Phys_Euler (int numNodes=0, int numSprings=0, int numPossibleDeformations=0, int defK=35)

Protected Attributes

MatrixType nodes
 A matrix of nodes.
MatrixType nodesV
 A matrix of node velocities.
MatrixType nodesF
 A matrix of node forces.
MatrixType nodesFDef
 A matrix of node deformation forces.
MatrixType nodesA
 A matrix of node accelerations.
VectorType nodesM
 A matrix of node masses.
DataType defaultMass
 The default mass.
VectorType springsRest
 A vector of spring rest lengths.
VectorType springsDamp
 A vector of spring dampening amounts.
DataType defaultDamp
 The default dampening amount.
MatrixType springsNodes
 A matrix describing how the springs and masses are connected. e.g. spring1: node 1 --> node 2, spring2: node 2 --> node 3.
VectorType springLengths
 A vector of current spring lengths.
VectorType springsK
 A vector of Hooke constants for each spring.
DataType defaultK
 The default Hooke constant.
DataType defaultDrag
 The default drag force.
double timeStep
 How large a time step to take during the simulations. Position = PositionOld + (VelocityOld + acceleartion*timeStep)*timeStep;.
GradientImageTypePointer gradientPointer
 The pointer to the gradient image.
bool imageForces
 Whether or not image forces are enabled.

Classes

struct  Error

Detailed Description

template<class DataType, class TGradientImage, int nDims, class MType = vnl_matrix<DataType>, class VType = vnl_vector<DataType>>
class mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >

A derived physics class capable of carrying out deformations of a spring mass system.

A derived class of the physical ABC, this class provides the framework with the ability to simulate deformation dynamics of any dimension on a spring mass system. It assumes any node in the geometrical layer to represent a mass and any connection present to represent a spring between connected masses. This class is considered to be relatively stable, in that additional functionality may be added but current functionality will remain.

See [1] for details on the simulation dynamics and examples of possible controled deformation types.

[1] Ghassan Hamarneh and Chris McIntosh. Physics-based deformable organisms for medical image analysis. SPIE Medical Imaging, 5747:326335, 2005.

Parameters:
Type The data type to be used for internal storage.
TGradientImage The data type used for external forces.
nDims The number of dimensions used for simulations.
MType The type of matrix used for internal storage. Defaults to vnl_matrix<Type>, the only supported type at this time.
VType The type of vector used for internal storage. Defaults to vnl_vector<Type>, the only supported type at this time.

Definition at line 46 of file Phys_Euler.h.


Member Function Documentation

template<class DataType, class TGradientImage, int nDims, class MType, class VType>
bool mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::runDeformation ( const std::string  defName,
typename DeformationType::deformationIn *const   i,
std::stringstream *const   s = NULL 
) [virtual]

Run a deformation.

Assemble the neccessary inputs and run the named deformation. Typically, only behaviors call this method. Note that only one of i,s can be non-null, while s is only optionally supported.

Parameters:
defName the name of the deformation
i The deformations argument list prepared by the behavior requesting the run
s The deformations argument list in stream format.

Implements mial::Physics< Type, nDims, MType, VType >.

Definition at line 123 of file Phys_Euler.cxx.

References mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::defaultMass, mial::Physics< Type, nDims, MType, VType >::Error::deformationError, mial::Physics< Type, nDims, MType, VType >::Error::deformationNumber, mial::Physics< Type, nDims, MType, VType >::deformationsList, mial::Physics< Type, nDims, MType, VType >::geom, mial::Physics< Type, nDims, MType, VType >::Error::msg, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::nodes, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::nodesA, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::nodesF, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::nodesFDef, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::nodesM, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::nodesV, mial::Physics< Type, nDims, MType, VType >::numDeformations, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springLengths, mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springsNodes, and mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springsRest.

template<class DataType, class TGradientImage, int nDims, class MType, class VType>
void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setRestLengths ( VectorType  a,
VectorType  values 
) [virtual]

Set the restlengths of the specified springs to the specified values.

Parameters:
a the indices of the springs
values the values to use

Definition at line 62 of file Phys_Euler.cxx.

References mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springsRest.

template<class DataType, class TGradientImage, int nDims, class MType, class VType>
void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setRestLengths ( int *  a,
DataType values,
int  n 
) [virtual]

Set the restlengths of the specified springs to the specified values.

Parameters:
a the indices of the springs
values the values to use
n the number of springs being set

Definition at line 49 of file Phys_Euler.cxx.

References mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springsRest.

template<class DataType, class TGradientImage, int nDims, class MType, class VType>
void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setSpringLengths ( VectorType  a,
VectorType  values 
) [virtual]

Set the lengths of the specified springs to the specified values.

Parameters:
a the indices of the springs
values the values to use

Definition at line 87 of file Phys_Euler.cxx.

References mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springLengths.

template<class DataType, class TGradientImage, int nDims, class MType, class VType>
void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setSpringLengths ( int *  a,
DataType values,
int  n 
) [virtual]

Set the lengths of the specified springs to the specified values.

Parameters:
a the indices of the springs
values the values to use
n the number of springs being set

Definition at line 74 of file Phys_Euler.cxx.

References mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springLengths.

template<class DataType, class TGradientImage, int nDims, class MType, class VType>
void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setSpringsK ( VectorType  a,
VectorType  values 
) [virtual]

Set the Hooke's constants of the specified springs to the specified values.

Parameters:
a the indices of the springs
values the values to use

Definition at line 112 of file Phys_Euler.cxx.

References mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springsK.

template<class DataType, class TGradientImage, int nDims, class MType, class VType>
void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setSpringsK ( int *  a,
DataType values,
int  n 
) [virtual]

Set the Hooke's constants of the specified springs to the specified values.

Parameters:
a the indices of the springs
values the values to use
n the number of springs being set

Definition at line 99 of file Phys_Euler.cxx.

References mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::springsK.

template<class DataType, class TGradientImage, int nDims, class MType = vnl_matrix<DataType>, class VType = vnl_vector<DataType>>
virtual void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setTimeStep ( double  a  )  [inline, virtual]

Set the time step.

Parameters:
a the new time step.

Definition at line 168 of file Phys_Euler.h.


The documentation for this class was generated from the following files:
Generated on Wed Jul 19 13:05:24 2006 for IDO by  doxygen 1.4.7