public abstract class MTBTopologicalNumber extends Object
See
Han, X. and Xu, C. and Prince, J.L., A topology preserving level set method for geometric deformable models},
PAMI, pages 755768, 2003
for definitions and notation.
Modifier and Type  Class and Description 

private class 
MTBTopologicalNumber.PixelIndexIterator 
class 
MTBTopologicalNumber.PixelOffsetIterator 
class 
MTBTopologicalNumber.Point3D
This class is used as a light weight 3D point implementation

Modifier and Type  Field and Description 

protected Vector<MTBTopologicalNumber.Point3D>[] 
coordinatesNeighborNeighbors
For each neighbor in the neighborhood
this vector holds coordinates of all other pixels in the neighborhood
which are connected to the neighbor under consideration with regard the
the neighborhood definition.

protected Vector<MTBTopologicalNumber.Point3D>[][][] 
coordinatesNeighborNeighborsByCoord
As
coordinatesNeighborNeighbors this array give
for each neighbor in the neighborhood coordinates of its neighbors
(i.e. neighborneighbors). 
protected MTBTopologicalNumber.Point3D[] 
coordinatesNeighbors
For each neighbor in the neighborhood
this gives their coordinates in a 3x3x3 array center around the
current pixel (of which the neighborhood is represented).

protected static boolean 
debug
debug flag

protected Vector<MTBTopologicalNumber.Point3D>[] 
offsetsNeighborNeighbors
As for the neighbors this vector is in analogy to
coordinatesNeighborNeighbors
and gives for each neighborneighbor the offset instead of coordinates. 
protected MTBTopologicalNumber.Point3D[] 
offsetsNeighbors
In analogy to
coordinatesNeighbors this array hold the offsets of the neighbors. 
protected boolean[][][] 
X
8 or 26 neighbors of the current pixel
used to determine topological numbers represented as an 3x3x3 array center around
the current pixel.

Constructor and Description 

MTBTopologicalNumber() 
Modifier and Type  Method and Description 

protected abstract void 
computeN()
Derive N_n^k from X, see Han et al.

protected boolean 
hasOneCC()
Checks if the neighborhood represented in X has exactly one connected
component of entries set to true using the neighborhood definition as
as represented in the neighborhood arrays of the class.

Iterator<MTBTopologicalNumber.Point3D> 
iterator()
Returns a iterator for the coordinatesNeighbors in the order as defined

Iterator<MTBTopologicalNumber.Point3D> 
iteratorOffsets()
Returns a iterator for the pixelOffsets in the order as defined

void 
print()
Print information of this class to stdout

abstract boolean 
topoNumberIsOne(int[][][] nbClasses3D,
int c)
Check if topological for the class
c is one in the
neighborhood nbClassess3D . 
boolean 
topoNumberIsOne(MTBSegmentationInterface segmentation,
int x,
int y,
int z,
int c)
Check if topological for the class
c is one in the
pixel with coordinate (x,y,z) in the segmentation object
segmentation . 
private void 
visitCC(int z,
int y,
int x)
Visit (x,y,z): reset the corresponding entry in X to false
and recursively visit all neighbors of (x,y,z) in X.

protected static boolean debug
protected MTBTopologicalNumber.Point3D[] coordinatesNeighbors
protected MTBTopologicalNumber.Point3D[] offsetsNeighbors
coordinatesNeighbors
this array hold the offsets of the neighbors.
Each offset may also be considered as the coordinates of a neighbor in a
a 3x3x3 array center around the
current pixel where
the coordinates of this current pixel are (0,0,0).
The order of neighbors within the array are the same as for coordinatesNeighbors
.
protected Vector<MTBTopologicalNumber.Point3D>[] coordinatesNeighborNeighbors
coordinatesNeighbors
while the order of neighborneighbors in the vector is arbitrary.protected Vector<MTBTopologicalNumber.Point3D>[][][] coordinatesNeighborNeighborsByCoord
coordinatesNeighborNeighbors
this array give
for each neighbor in the neighborhood coordinates of its neighbors
(i.e. neighborneighbors).
However the vectors of neighborneighbors are not indexed by the order of
the neighbors but by the coordinate of each neighbor
within an 3x3x3 array, coordinatesNeighbors
.
The vector are define in analogy as in @see indicesNeighbors.protected Vector<MTBTopologicalNumber.Point3D>[] offsetsNeighborNeighbors
coordinatesNeighborNeighbors
and gives for each neighborneighbor the offset instead of coordinates.protected boolean[][][] X
nbClasses3D[z][y][x]
.
First it is assigned to the array X
of Han et al, i.e.:
An entry is true if class in neighborhood is equal to the class under consideration,
false otherwise.
Subsequently to the array N_n^k
And finally altered to compute number of components.
This array is recycled for efficiency.
public abstract boolean topoNumberIsOne(int[][][] nbClasses3D, int c)
c
is one in the
neighborhood nbClassess3D
. Specifically, all pixels in
nbClasses3D
with equal values to c
are considered as elements of X, the rest as not in X.
nbClassess3D
is a 3D volume of size 3x3x3
where the current pixel is located in the center, i.e. with coordinates (1,1,1).
Memory layout is nbClasses3D[z][y][x]
.
The values give the classes or phases to which the pixels belong to.
Neighborhood definitions are define in derived sub classes.
If this is a 2D neighborhood, only the z=0
slice of
nbClasses3D
will be considered and accessed.
public boolean topoNumberIsOne(MTBSegmentationInterface segmentation, int x, int y, int z, int c)
c
is one in the
pixel with coordinate (x,y,z)
in the segmentation object
segmentation
.
Specifically, all pixels in
neighborhood with equal values to c
are considered as elements of X, the rest as not in X.
Neighborhood definitions are define in derived sub classes.
If this segmentation is 2D a 2D topology is to be used
TODO: conceive how to handle invalid pixels
protected abstract void computeN()
protected boolean hasOneCC()
private void visitCC(int z, int y, int x)
public void print()
public Iterator<MTBTopologicalNumber.Point3D> iterator()
public Iterator<MTBTopologicalNumber.Point3D> iteratorOffsets()
Copyright © 2010–2015 Martin Luther University HalleWittenberg. All rights reserved.