#include <ForceGenerator.h>
Inheritance diagram for lsseg::ForceGenerator:
Public Member Functions | |
virtual | ~ForceGenerator () |
virtual destructor | |
virtual void | init (const Image< double > *img, const Mask *mask=0)=0 |
Initialize the ForceGenerator. | |
virtual void | update (const LevelSetFunction &phi)=0 |
Update the force field based on a given segmentation of an image. | |
virtual double | force2D (int x, int y) const =0 |
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 =0 |
Get the normal force value of a (x, y, z) location in the current normal force field. | |
virtual double | force (size_t ix) const =0 |
Get the normal force value of a particular pixel, specified by its internal storage index. | |
virtual void | force (LevelSetFunction &phi, const Mask *mask) const =0 |
Get the complete normal force field as a LevelSetFunction. |
The role of a ForceGenerator is to generate a field of forces acting normally on the constant-value curves (including zero-set curves) of a level-set function. The basis for generating this normal force field is the image to be segmented, as well as the current state of segmentation for the image. The normal force as defined by the ForceGenerator is expressed as a scalar value at each pixel of the image, expressing the magnitude of the normal force acting at the level-set at that location. These values are then used to evolve the curve given timestep.
Read the How Segmentation in LSSEG Works for a more comprehensive explanation of the role ForceGenerators play in in this library's segmentation functionally.
Definition at line 74 of file ForceGenerator.h.
virtual lsseg::ForceGenerator::~ForceGenerator | ( | ) | [inline, virtual] |
virtual void lsseg::ForceGenerator::force | ( | LevelSetFunction & | phi, | |
const Mask * | mask | |||
) | const [pure virtual] |
Get the complete normal force field as a LevelSetFunction.
phi | the LevelSetFunction which will, upon completion of the function, contain the force field currently contained in the ForceGenerator |
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 ). If this pointer is left at zero, the whole of the force field is considered to be active. |
Implemented in lsseg::ChanVeseForce, lsseg::ConstantForce, lsseg::MRBalloonForce, lsseg::NormalDistributionForce, and lsseg::ParzenDistributionForce.
virtual double lsseg::ForceGenerator::force | ( | size_t | ix | ) | const [pure 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.
Implemented in lsseg::ChanVeseForce, lsseg::ConstantForce, lsseg::MRBalloonForce, lsseg::NormalDistributionForce, and lsseg::ParzenDistributionForce.
virtual double lsseg::ForceGenerator::force2D | ( | int | x, | |
int | y | |||
) | const [pure virtual] |
Get the normal force value of a (x, y) location in the current normal force field.
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. Implemented in lsseg::ChanVeseForce, lsseg::ConstantForce, lsseg::MRBalloonForce, lsseg::NormalDistributionForce, and lsseg::ParzenDistributionForce.
virtual double lsseg::ForceGenerator::force3D | ( | int | x, | |
int | y, | |||
int | z | |||
) | const [pure virtual] |
Get the normal force value of a (x, y, z) location in the current normal force field.
Implemented in lsseg::ChanVeseForce, lsseg::ConstantForce, lsseg::MRBalloonForce, lsseg::NormalDistributionForce, and lsseg::ParzenDistributionForce.
virtual void lsseg::ForceGenerator::init | ( | const Image< double > * | img, | |
const Mask * | mask = 0 | |||
) | [pure virtual] |
Initialize the ForceGenerator.
img | (pointer to) the image that the ForceGenerator should use to derive the force field (i.e. the Image to be segmented). | |
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. |
Implemented in lsseg::ChanVeseForce, lsseg::ConstantForce, lsseg::MRBalloonForce, lsseg::NormalDistributionForce, and lsseg::ParzenDistributionForce.
virtual void lsseg::ForceGenerator::update | ( | const LevelSetFunction & | phi | ) | [pure virtual] |
Update the force field based on a given segmentation of an image.
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. |
Implemented in lsseg::ChanVeseForce, lsseg::ConstantForce, lsseg::MRBalloonForce, lsseg::NormalDistributionForce, and lsseg::ParzenDistributionForce.