25class CSOMarchingSquares;
78 bool isAmbiguous()
const;
101 char config = (
static_cast<unsigned char>(values[0] >=
isoValue) << 0) |
102 (
static_cast<unsigned char>(values[1] >=
isoValue) << 1) |
103 (
static_cast<unsigned char>(values[2] >=
isoValue) << 2) |
104 (
static_cast<unsigned char>(values[3] >=
isoValue) << 3);
128 return ((_cellConfig !=
rkCell._cellConfig) ||
129 (_topLeftVoxel[0] !=
rkCell._topLeftVoxel[0]) ||
130 (_topLeftVoxel[1] !=
rkCell._topLeftVoxel[1]));
135 bool _isCorner()
const;
141 int _getDirectionOppositeOfEdge()
const;
144 std::array<float, 2> _voxelsInDirection(
int direction)
const;
159 int _topLeftVoxel[2];
178inline bool CSOMarchingSquaresCell::isAmbiguous()
const
180 return (_cellConfig == 5) || (_cellConfig == 10);
185inline bool CSOMarchingSquaresCell::isIsoCell(
char cellConfig)
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
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 isoV...
void reset()
Resets the state of the cell (i.e. no values are set)
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.
CSOMarchingSquaresCell()
Constructor.
float _isoValue
The isovalue to check the values against.
static int oppositeDirection(int fromDir)
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...
static char calculateCellConfig(float isoValue, float values[4])
Calculates the cell config.
vecPoint2D::iterator vecPoint2DIter
Defines an iterator to iterate through a 2D point vector.
Direction
Enumeration of directions (next to compute).
bool _isBorderLeft
Flags to indicate that some voxels of this cell are outside the image.
std::vector< Vector2 > vecPoint2D
Defines a 2D point vector.
bool isIsoCell() const
Returns true if this cell is intersected by the isoline.
~CSOMarchingSquaresCell()
Destructor.
This class implements the Marching Squares algorithm to find isolines on 2D image slices.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.