#include <LevelSet.h>
Public Types | |
typedef BaseImage< DIM, Pixel > | base |
typedef base::Shape | Shape |
typedef base::Index | Index |
typedef Initializer< DIM, Pixel > | Initializer |
typedef Weno3< DIM, Pixel > | Approximator |
typedef Fluxes< DIM, Approximator, Pixel > | Fluxes |
typedef Schemes< DIM, Pixel > | Schemes |
Public Member Functions | |
Constructors - Destructor - Resize | |
LevelSet () | |
Default constructor. | |
LevelSet (const Shape &_shape, float _thickness=3.0f) | |
Constructor from a given shape. | |
template<typename Pixel2> | |
LevelSet (const LevelSet< DIM, Pixel2 > &ls) | |
Copy constructor. | |
template<typename Pixel2> | |
LevelSet | operator= (const LevelSet< DIM, Pixel2 > &ls) |
affectation operator | |
virtual | ~LevelSet () |
Destructor. | |
void | resize (const Shape &s) |
Update of the narrow band | |
void | update (const BaseImage< DIM, Pixel > &dphi, const float dt) |
Update the level set in the band : phi += dphi * dt. | |
Access/Modif the narrow band | |
bool | is_in_band (const Index &ind) const |
Test if a point is in the narrow band. | |
bool | add_point (const Index &ind) |
Add a point in the narrow band if not already in. return true if the point has been added. | |
bool | remove_point (const Index &ind) |
remove the point from the narrow_band | |
const Index & | get_point (unsigned i) const |
Get the point of indice i in the narrow band. | |
int | nb_points () const |
Number of points in the narrow band. | |
int | pos_to_neg_index () const |
Indice [0 .. pos_to_neg_index()-1] correspond to the points that changed from positive to negative in the last update. | |
int | neg_to_pos_index () const |
Indice [neg_to_pos_index() .. nb_points()-1] correspond to the points that changed from negative to positive in the last update. | |
float & | thickness () |
Thickness of the narrow band. | |
void | clear_band () |
Clear the narrow band, remove all points. | |
Initializers | |
void | init_sphere (const Index ¢er, float radius, Initializer &init, bool add=true) |
Initialize to a sphere. | |
void | init_small_spheres (float radius, float window, Initializer &init, bool add=true) |
Initialize to small spheres, each of them being in a center of a window. | |
void | init_border (const unsigned border, Initializer &init, bool add=true) |
Initialize to a rectangle close to the border. | |
void | init_rectangle (const Index &tl, const Index &br, Initializer &init, bool add=true) |
Initialize to a rectangle. | |
void | init_image (const BaseImage< DIM, Pixel > &image, Initializer &init, const Pixel &pix=0) |
Initialize from an image, pix is the value representing the front. | |
Auxiliary functions | |
void | reinit_PDE (int iter=2, float dt=0.4) |
Reinitialization EDP. | |
void | extend_data (BaseImage< DIM, Pixel > &u, short type=0, int iter=20, float dt=0.4) const |
Extension of datas in the band, perpendicularly to the surface. type = -1, 0, 1 means repectively in the negative + 0 region, whole band, positive region. | |
Pixel | band_average (const BaseImage< DIM, Pixel > &u, const float epsilon=2.0) const |
Average of a quantity on the surface. | |
Pixel | band_integral (const BaseImage< DIM, Pixel > &u, const float epsilon=2.0) const |
Integral of a quantity on the surface. | |
Pixel | area (const float epsilon=2.0) const |
Area of the surface. | |
Protected Attributes | |
Data Members | |
float | m_thickness |
Thickness of the narrow band. | |
Index * | m_band |
Coords of the points in the band. | |
BaseImage< DIM, int > | m_mask |
Mask of the points of the band. | |
unsigned | m_nbpts |
Number of points in the band. | |
unsigned | m_pos_to_neg |
Special indice in 'm_band'. | |
unsigned | m_neg_to_pos |
Special indice in 'm_band'. |
2D_DistanceMap.C, 2D_Gaussian.C, 2D_GeodesicActiveContour.C, 2D_LocalGaussian.C, 2D_LocalStats.C, 2D_Parzen.C, 2D_SoftShapePrior.C, and 3D_ChanVese.C.
Definition at line 47 of file LevelSet.h.
Constructor from a given shape.
_shape | shape of the level set |
_thickness | thickness of the narrow band |
Definition at line 200 of file LevelSet.h.
References LevelSet::m_band, LevelSet::m_mask, and LevelSet::m_thickness.
00201 : base(_shape), m_thickness(_thickness), m_mask(_shape), m_nbpts(0), m_pos_to_neg(0), m_neg_to_pos(0) 00202 { 00203 m_mask = -1; 00204 base::operator=(-m_thickness); 00205 m_band = new Index[base::size()]; 00206 }