lsseg::NormalDistributionForce Class Reference

This ForceGenerator creates a normal force field derived from the minimization of the Mumford-Shah functional, in a setting where each region is modeled statistically using a normal distribution. More...

#include <NormalDistributionForce.h>

Inheritance diagram for lsseg::NormalDistributionForce:

lsseg::ForceGenerator List of all members.

Public Member Functions

 NormalDistributionForce (bool multireg_mode=false)
 Constructor making a NormalDistributionForce-generator which will have to be initialized with the init() function before being usable.
 NormalDistributionForce (const Image< double > *img, Mask *mask=0, bool multireg_mode=false)
 Constructor.
virtual ~NormalDistributionForce ()
virtual void init (const Image< double > *img, const Mask *mask=0)
 Initialize the 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 &, const Mask *mask=0) const
 Get the complete normal force field as a LevelSetFunction.

Private Member Functions

void report () const
void compute_averages (const LevelSetFunction &)
 function called by the update() function. Computes the pixel averages for each channel and each region, and writes the result to the mu_out_ and mu_in_ arrays.
void compute_deviations (const LevelSetFunction &)
 function called by the update() function. Computes the pixel mean deviation for each channel and each region, and writes the result to the inv_sigma_in_ and inv_sigma_out_ arrays. It also precomputes the values in precalc_log_ array.

Private Attributes

const Image< double > * img_
 pointer to the Image to be segmented
const Maskmask_
 pointer to a Mask specifying which parts of the image are considered to be active
const bool multi_region_mode_
 flag specifying whether this object is intended to be used in a multi-region setting (see here for an explanation), or if it is to be used in the classical two-region problem.
std::vector< double > mu_in_
 average pixel value inside the closed region; one entry per image channel.
std::vector< double > mu_out_
 average pixel value outside the closed region; one entry per image channel.
std::vector< double > inv_sigma_in_
 The inverse of the mean deviation inside the closed region; one entry per image channel.
std::vector< double > inv_sigma_out_
 The inverse of the mean deviation outside the closed region; one entry per image channel.
std::vector< double > precalc_log_
 precalculate the logarithm component (defined by the regions' mean pixel deviations) of the force. This expression is slightly different according to whether we work in a two-region or multiple-region setting.

Detailed Description

This ForceGenerator creates a normal force field derived from the minimization of the Mumford-Shah functional, in a setting where each region is modeled statistically using a normal distribution.

This model can be seen as an elaboration of the model presented by Chan and Vese in [Chan99], with an additional parameter (standard deviation) describing the pixel distribution inside each region. Thus, contrary to the Chan-Vese approach, it can discern between regions having the same average pixel values, as long as the standard deviation of the pixels are different in the two regions. How the force defined by this ForceGenerator is derived from the Mumford-Shah functional is explained e.g. on page 113 and 114 in the thesis by Brox: [Brox05].

Definition at line 74 of file NormalDistributionForce.h.


Constructor & Destructor Documentation

lsseg::NormalDistributionForce::NormalDistributionForce ( bool  multireg_mode = false  )  [inline]

Constructor making a NormalDistributionForce-generator which will have to be initialized with the init() function before being usable.

Parameters:
multireg_mode The NormalDistributionForce-generator is written to also work in a multiregion setting (ie. when segmenting an image into more than two parts using a region competition approach If you construct this object with the intention of using it in a multiregion setting, set multireg_mode to true. Otherwise (if you intend to use the classical setting with two regions), leave it at false. For more about the multiregion setting, refer to the appropriate section of the page on How Segmentation in LSSEG Works.

Definition at line 91 of file NormalDistributionForce.h.

lsseg::NormalDistributionForce::NormalDistributionForce ( const Image< double > *  img,
Mask mask = 0,
bool  multireg_mode = false 
)

Constructor.

Parameters:
img pointer to 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.
multireg_mode The NormalDistributionForce-generator is written to work in a multiregion setting (ie. when segmenting an image into more than two parts using a region competition approach). If you construct this object with the intention of using it in a multiregion setting, set multireg_mode to true. Otherwise (if you intend to use the classical setting with two regions), leave it at false. For more about the multiregion setting, refer to the appropriate section of the page on How Segmentation in LSSEG Works.

Definition at line 55 of file NormalDistributionForce.C.

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

Definition at line 115 of file NormalDistributionForce.h.


Member Function Documentation

void lsseg::NormalDistributionForce::compute_averages ( const LevelSetFunction  )  [inline, private]

function called by the update() function. Computes the pixel averages for each channel and each region, and writes the result to the mu_out_ and mu_in_ arrays.

Definition at line 174 of file NormalDistributionForce.C.

void lsseg::NormalDistributionForce::compute_deviations ( const LevelSetFunction  )  [inline, private]

function called by the update() function. Computes the pixel mean deviation for each channel and each region, and writes the result to the inv_sigma_in_ and inv_sigma_out_ arrays. It also precomputes the values in precalc_log_ array.

Definition at line 224 of file NormalDistributionForce.C.

void lsseg::NormalDistributionForce::force ( LevelSetFunction ,
const Mask mask = 0 
) const [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 142 of file NormalDistributionForce.C.

double lsseg::NormalDistributionForce::force ( size_t  ix  )  const [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 109 of file NormalDistributionForce.C.

double lsseg::NormalDistributionForce::force2D ( int  x,
int  y 
) const [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 95 of file NormalDistributionForce.C.

double lsseg::NormalDistributionForce::force3D ( int  x,
int  y,
int  z 
) const [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 102 of file NormalDistributionForce.C.

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

Initialize the ForceGenerator.

Parameters:
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.

Implements lsseg::ForceGenerator.

Definition at line 65 of file NormalDistributionForce.C.

void lsseg::NormalDistributionForce::report (  )  const [inline, private]

void lsseg::NormalDistributionForce::update ( const LevelSetFunction phi  )  [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 84 of file NormalDistributionForce.C.


Member Data Documentation

const Image<double>* lsseg::NormalDistributionForce::img_ [private]

pointer to the Image to be segmented

Definition at line 127 of file NormalDistributionForce.h.

std::vector<double> lsseg::NormalDistributionForce::inv_sigma_in_ [private]

The inverse of the mean deviation inside the closed region; one entry per image channel.

Definition at line 146 of file NormalDistributionForce.h.

std::vector<double> lsseg::NormalDistributionForce::inv_sigma_out_ [private]

The inverse of the mean deviation outside the closed region; one entry per image channel.

Definition at line 150 of file NormalDistributionForce.h.

const Mask* lsseg::NormalDistributionForce::mask_ [private]

pointer to a Mask specifying which parts of the image are considered to be active

Definition at line 131 of file NormalDistributionForce.h.

std::vector<double> lsseg::NormalDistributionForce::mu_in_ [private]

average pixel value inside the closed region; one entry per image channel.

Definition at line 139 of file NormalDistributionForce.h.

std::vector<double> lsseg::NormalDistributionForce::mu_out_ [private]

average pixel value outside the closed region; one entry per image channel.

Definition at line 142 of file NormalDistributionForce.h.

const bool lsseg::NormalDistributionForce::multi_region_mode_ [private]

flag specifying whether this object is intended to be used in a multi-region setting (see here for an explanation), or if it is to be used in the classical two-region problem.

Definition at line 136 of file NormalDistributionForce.h.

std::vector<double> lsseg::NormalDistributionForce::precalc_log_ [private]

precalculate the logarithm component (defined by the regions' mean pixel deviations) of the force. This expression is slightly different according to whether we work in a two-region or multiple-region setting.

Definition at line 155 of file NormalDistributionForce.h.


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