lsseg::ConstantForce Class Reference

This ForceGenerator creates a constant normal force, which does not depend on the underlying image or its current segmentation. More...

#include <ConstantForce.h>

Inheritance diagram for lsseg::ConstantForce:

lsseg::ForceGenerator List of all members.

Public Member Functions

 ConstantForce (double c)
 constructor. The value of the constant normal force is specified with the argument c.
virtual ~ConstantForce ()
 virtual destructor
virtual void init (const Image< double > *img, const Mask *mask=0)
 Initializes the ConstantForce ForceGenerator.
virtual void update (const LevelSetFunction &phi)
 Update the force field based on a given segmentation of an image.
virtual double force2D (int x, int y) const
 Get the normal force value of a (x, y) location in the current normal force field.
virtual double force3D (int x, int y, int z) const
 Get the normal force value of a (x, y, z) location in the current normal force field.
virtual double force (size_t ix) const
 Get the normal force value of a particular pixel, specified by its internal storage index.
virtual void force (LevelSetFunction &phi, const Mask *mask) const
 Get the complete normal force field as a LevelSetFunction.

Private Attributes

double constant_
 storage of the value for the constant force

Detailed Description

This ForceGenerator creates a constant normal force, which does not depend on the underlying image or its current segmentation.

This ForceGenerator might not be very useful for segmentation purposes, but can be used to make predictable normal force field for testing or debug purposes.

Definition at line 65 of file ConstantForce.h.


Constructor & Destructor Documentation

lsseg::ConstantForce::ConstantForce ( double  c  )  [inline]

constructor. The value of the constant normal force is specified with the argument c.

A positive value for c represents a force pointing outwards of the domain enclosed by the curve/surface. A negative value represents a force pointing inwards.

Definition at line 74 of file ConstantForce.h.

virtual lsseg::ConstantForce::~ConstantForce (  )  [inline, virtual]

virtual destructor

Definition at line 77 of file ConstantForce.h.


Member Function Documentation

virtual void lsseg::ConstantForce::force ( LevelSetFunction phi,
const Mask mask 
) const [inline, virtual]

Get the complete normal force field as a LevelSetFunction.

Return values:
phi the LevelSetFunction which will, upon completion of the function, contain the force field currently contained in the ForceGenerator
Parameters:
mask (pointer to) an optional Mask that specifies which part(s) of the force field are active. (The inactive parts will not be filled into the LevelSetFunction $ \phi $). If this pointer is left at zero, the whole of the force field is considered to be active.

Implements lsseg::ForceGenerator.

Definition at line 99 of file ConstantForce.h.

virtual double lsseg::ConstantForce::force ( size_t  ix  )  const [inline, virtual]

Get the normal force value of a particular pixel, specified by its internal storage index.

The internal storage index of any pixel can be found by applying the Image::indexOf() member function.

Implements lsseg::ForceGenerator.

Definition at line 98 of file ConstantForce.h.

virtual double lsseg::ConstantForce::force2D ( int  x,
int  y 
) const [inline, virtual]

Get the normal force value of a (x, y) location in the current normal force field.

Note:
for 3D images, z is here set to be 0. The method is not overloaded due to performance reasons. For true 3D fields, use the force3D() function instead.

Implements lsseg::ForceGenerator.

Definition at line 96 of file ConstantForce.h.

virtual double lsseg::ConstantForce::force3D ( int  x,
int  y,
int  z 
) const [inline, virtual]

Get the normal force value of a (x, y, z) location in the current normal force field.

Note:
The method is not overloaded due to performance reasons. If you want to get the normal force at a point in a 2D field, consider using the force2D() function instead, as this might be less expensive.

Implements lsseg::ForceGenerator.

Definition at line 97 of file ConstantForce.h.

virtual void lsseg::ConstantForce::init ( const Image< double > *  img,
const Mask mask = 0 
) [inline, virtual]

Initializes the ConstantForce ForceGenerator.

inherited from ForceGenerator. For this class, however, the image information will not contribute to the determination of the force field, which is constant over the whole image domain..

Parameters:
img (pointer to) the image that the ForceGenerator should use to derive the force field (i.e. the Image to be segmented). For this class, the image information will not participate in the determination of the (constant) force field. However, the domain of the defined force field will be that ot the image.
mask (pointer to) an optional Mask that specifies which part(s) of the image are active. (No forces will be computed for the inactive part(s) of an image). If this pointer is left at zero, the whole of img is considered to be active.

Implements lsseg::ForceGenerator.

Definition at line 94 of file ConstantForce.h.

virtual void lsseg::ConstantForce::update ( const LevelSetFunction phi  )  [inline, virtual]

Update the force field based on a given segmentation of an image.

Parameters:
phi this LevelSetFunction should be of the same shape as the Image that the ForceGenerator derives the force field from, and it specifies a segmentation of the Image. Taking this segmentation of the Image into consideration, the ForceGenerator computes the new force field.

Implements lsseg::ForceGenerator.

Definition at line 95 of file ConstantForce.h.


Member Data Documentation

double lsseg::ConstantForce::constant_ [private]

storage of the value for the constant force

Definition at line 104 of file ConstantForce.h.


The documentation for this class was generated from the following file:
Generated on Tue Nov 28 18:35:47 2006 for lsseg by  doxygen 1.4.7