#include <Phys_Euler.h>
Inheritance diagram for mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >:
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 |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
virtual void mial::Phys_Euler< DataType, TGradientImage, nDims, MType, VType >::setTimeStep | ( | double | a | ) | [inline, virtual] |