#include <MRBalloonForce.h>
Inheritance diagram for lsseg::MRBalloonForce:
Public Member Functions | |
MRBalloonForce (double fac, const LevelSetFunction &phi) | |
Constructor taking as argument the force field's magnitude and a current segmentation. | |
virtual | ~MRBalloonForce () |
virtual destructor | |
virtual void | init (const Image< double > *img, const Mask *mask) |
Initializes the MRBalloonForce 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=0) const |
Get the complete normal force field as a LevelSetFunction. | |
Private Member Functions | |
void | report () const |
Private Attributes | |
const double | fac_ |
the multiplicative factor which determines the overall strength of the (constant) force field | |
double | cur_force_ |
value for the constant force field given the current segmentation. |
The normal force field generated by this class is constant over the whole domain, and inversely proportional to the area (volume in 3D) of the closed domain of the current segmentation. Thus, the bigger the interior of this domain is, the weaker the force will be. 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 76 of file MRBalloonForce.h.
lsseg::MRBalloonForce::MRBalloonForce | ( | double | fac, | |
const LevelSetFunction & | phi | |||
) | [inline] |
Constructor taking as argument the force field's magnitude and a current segmentation.
fac | The generated force field will be constant, on the form K/vol , where vol is the area (volume in 3D) of the interior region of the current segmentation. The parameter fac to the constructor specifies the constant K in the above formula. | |
phi | A LevelSetFuncion used to specify the current segmentation, and thus the vol parameter in the above formula. |
Definition at line 89 of file MRBalloonForce.h.
virtual lsseg::MRBalloonForce::~MRBalloonForce | ( | ) | [inline, virtual] |
virtual void lsseg::MRBalloonForce::force | ( | LevelSetFunction & | phi, | |
const Mask * | mask = 0 | |||
) | const [inline, 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. |
Implements lsseg::ForceGenerator.
Definition at line 121 of file MRBalloonForce.h.
virtual double lsseg::MRBalloonForce::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 120 of file MRBalloonForce.h.
virtual double lsseg::MRBalloonForce::force2D | ( | int | x, | |
int | y | |||
) | const [inline, 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. Implements lsseg::ForceGenerator.
Definition at line 118 of file MRBalloonForce.h.
virtual double lsseg::MRBalloonForce::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.
Implements lsseg::ForceGenerator.
Definition at line 119 of file MRBalloonForce.h.
virtual void lsseg::MRBalloonForce::init | ( | const Image< double > * | img, | |
const Mask * | mask | |||
) | [inline, virtual] |
Initializes the MRBalloonForce 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 for a given segmentation.
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 110 of file MRBalloonForce.h.
void lsseg::MRBalloonForce::report | ( | ) | const [inline, private] |
virtual void lsseg::MRBalloonForce::update | ( | const LevelSetFunction & | phi | ) | [inline, 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. |
Implements lsseg::ForceGenerator.
Definition at line 114 of file MRBalloonForce.h.
double lsseg::MRBalloonForce::cur_force_ [private] |
value for the constant force field given the current segmentation.
Definition at line 130 of file MRBalloonForce.h.
const double lsseg::MRBalloonForce::fac_ [private] |
the multiplicative factor which determines the overall strength of the (constant) force field
Definition at line 127 of file MRBalloonForce.h.