MeVisLab Toolbox Reference
|
Marching squares cell. More...
#include <CSOMarchingSquaresCell.h>
Public Types | |
enum | Direction { NONE = 0 , LEFT = 1 , TOP = 2 , RIGHT = 4 , BOTTOM = 8 } |
Enumeration of directions (next to compute). More... | |
typedef std::vector< Vector2 > | vecPoint2D |
Defines a 2D point vector. | |
typedef vecPoint2D::iterator | vecPoint2DIter |
Defines an iterator to iterate through a 2D point vector. | |
Public Member Functions | |
CSOMarchingSquaresCell () | |
Constructor. | |
~CSOMarchingSquaresCell () | |
Destructor. | |
void | reset () |
Resets the state of the cell (i.e. no values are set) | |
void | set (int topLeftVoxel[2], float values[4], float isoValue, char cellConfig=0) |
Set the top left position in voxel coordinates topLeftVoxel , the values of the 4 corners and the isoValue . | |
bool | isAmbiguous () const |
There are two configurations (5 and 10) where the next cell one can visit is not unique. | |
bool | isIsoCell () const |
Returns true if this cell is intersected by the isoline. | |
int | getToDirection (int fromDir) const |
Returns the direction for this cell to go to coming from fromDir . | |
bool | addPoints (bool bIinterpolate, int fromDir, vecPoint2D &points, float xyOffset) |
Adds points the points vector according to the cell configuration. | |
bool | operator!= (CSOMarchingSquaresCell &rkCell) |
The inequality operator takes the cell configuration and the cell position into account. | |
Static Public Member Functions | |
static bool | isIsoCell (char cellConfig) |
Returns true if this cell config is intersected by the isoline. | |
static char | calculateCellConfig (float isoValue, float values[4]) |
Calculates the cell config. | |
static int | oppositeDirection (int fromDir) |
Protected Attributes | |
unsigned char | _cellConfig |
The cell configuration is saved as a bit set such that Bit 0 is set if the upper left corner is above the isovalue. | |
int | _topLeftVoxel [2] |
The position of the top left voxel in voxel coordinates. | |
float | _values [4] |
The four voxel values used to determine the cell configuration and to interpolate the position. | |
float | _isoValue |
The isovalue to check the values against. | |
bool | _isBorderLeft |
Flags to indicate that some voxels of this cell are outside the image. | |
bool | _isBorderRight |
bool | _isBorderTop |
bool | _isBorderBottom |
Friends | |
class | CSOMarchingSquares |
To allow for an accessing of the CSOMarchingSquares class. | |
Marching squares cell.
Definition at line 44 of file CSOMarchingSquaresCell.h.
typedef std::vector<Vector2> ml::CSOMarchingSquaresCell::vecPoint2D |
Defines a 2D point vector.
Definition at line 59 of file CSOMarchingSquaresCell.h.
typedef vecPoint2D::iterator ml::CSOMarchingSquaresCell::vecPoint2DIter |
Defines an iterator to iterate through a 2D point vector.
Definition at line 60 of file CSOMarchingSquaresCell.h.
Enumeration of directions (next to compute).
Enumerator | |
---|---|
NONE | No direction. |
LEFT | To the left. |
TOP | To the top. |
RIGHT | To the right. |
BOTTOM | To the bottom. |
Definition at line 50 of file CSOMarchingSquaresCell.h.
ml::CSOMarchingSquaresCell::CSOMarchingSquaresCell | ( | ) |
Constructor.
ml::CSOMarchingSquaresCell::~CSOMarchingSquaresCell | ( | ) |
Destructor.
bool ml::CSOMarchingSquaresCell::addPoints | ( | bool | bIinterpolate, |
int | fromDir, | ||
vecPoint2D & | points, | ||
float | xyOffset ) |
Adds points the points
vector according to the cell configuration.
If bInterpolate
is true the method interpolates linearly. The parameter fromDir
is necessary for the correct insertion order. xyOffset
is added to the resulting positions. Use a 0 for evaluated functions and a 0.5 for evaluated images. The method returns whether a point was really added.
|
inlinestatic |
Calculates the cell config.
Definition at line 99 of file CSOMarchingSquaresCell.h.
References mlrange_cast().
Returns the direction for this cell to go to coming from fromDir
.
1 = left; 2 = up; 4 = right; 8 = down This is also encoded bitwise. For ambiguities this method currently returns the direction taking the way around that voxel whose value is greater than the isovalue.
|
inline |
There are two configurations (5 and 10) where the next cell one can visit is not unique.
This method returns, if this cell is such an ambiguity.
Definition at line 178 of file CSOMarchingSquaresCell.h.
|
inline |
Returns true if this cell is intersected by the isoline.
Definition at line 80 of file CSOMarchingSquaresCell.h.
References isIsoCell().
Referenced by isIsoCell().
Returns true if this cell config is intersected by the isoline.
Definition at line 185 of file CSOMarchingSquaresCell.h.
References mlrange_cast().
|
inline |
The inequality operator takes the cell configuration and the cell position into account.
Definition at line 126 of file CSOMarchingSquaresCell.h.
References mlrange_cast().
Definition at line 108 of file CSOMarchingSquaresCell.h.
References mlrange_cast().
void ml::CSOMarchingSquaresCell::reset | ( | ) |
Resets the state of the cell (i.e. no values are set)
void ml::CSOMarchingSquaresCell::set | ( | int | topLeftVoxel[2], |
float | values[4], | ||
float | isoValue, | ||
char | cellConfig = 0 ) |
Set the top left position in voxel coordinates topLeftVoxel
, the values
of the 4 corners and the isoValue
.
This method also computes and sets the internal cell configuration if it is not passed.
|
friend |
To allow for an accessing of the CSOMarchingSquares class.
Definition at line 62 of file CSOMarchingSquaresCell.h.
The cell configuration is saved as a bit set such that Bit 0 is set if the upper left corner is above the isovalue.
Definition at line 157 of file CSOMarchingSquaresCell.h.
|
protected |
Definition at line 173 of file CSOMarchingSquaresCell.h.
|
protected |
Flags to indicate that some voxels of this cell are outside the image.
Definition at line 170 of file CSOMarchingSquaresCell.h.
|
protected |
Definition at line 171 of file CSOMarchingSquaresCell.h.
|
protected |
Definition at line 172 of file CSOMarchingSquaresCell.h.
|
protected |
The isovalue to check the values against.
Definition at line 168 of file CSOMarchingSquaresCell.h.
|
protected |
The position of the top left voxel in voxel coordinates.
Definition at line 159 of file CSOMarchingSquaresCell.h.
|
protected |
The four voxel values used to determine the cell configuration and to interpolate the position.
The following mapping is used: 0 = top-left 1 = top-right 2 = bottom-right 3 = bottom-left
Definition at line 166 of file CSOMarchingSquaresCell.h.