de.unihalle.informatik.MiToBo.topology
Class MTBTopologicalNumber

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.topology.MTBTopologicalNumber
Direct Known Subclasses:
MTBTopologicalNumber2D

public abstract class MTBTopologicalNumber
extends Object

An abstract class to compute topological numbers given a neighborhood.

See Han, X. and Xu, C. and Prince, J.L., A topology preserving level set method for geometric deformable models}, PAMI, pages 755-768, 2003
for definitions and notation.


Nested Class Summary
 class MTBTopologicalNumber.PixelOffsetIterator
           
 class MTBTopologicalNumber.Point3D
          This class is used as a light weight 3D point implementation
 
Field Summary
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 Summary
MTBTopologicalNumber()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected static boolean debug
debug flag


coordinatesNeighbors

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). The coordinates of this current pixel are (1,1,1). The order of the neighbors is define in the class extending this abstract super class.


offsetsNeighbors

protected MTBTopologicalNumber.Point3D[] offsetsNeighbors
In analogy to 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.


coordinatesNeighborNeighbors

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. (These are called neighborneighbors subsequently.) The order of neighbors within the array are the same as for coordinatesNeighbors while the order of neighborneighbors in the vector is arbitrary.


coordinatesNeighborNeighborsByCoord

protected Vector<MTBTopologicalNumber.Point3D>[][][] coordinatesNeighborNeighborsByCoord
As 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.


offsetsNeighborNeighbors

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.


X

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. Memory layout is 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.

Constructor Detail

MTBTopologicalNumber

public MTBTopologicalNumber()
Method Detail

topoNumberIsOne

public abstract boolean topoNumberIsOne(int[][][] nbClasses3D,
                                        int c)
Check if topological for the class 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.


topoNumberIsOne

public 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. 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


computeN

protected abstract void computeN()
Derive N_n^k from X, see Han et al. This method works destructive on X (for efficiency), that is upon return X contains N_n^k, which is a subset of X. n and k are define in derived sub classes.


hasOneCC

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.


print

public void print()
Print information of this class to stdout


iterator

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


iteratorOffsets

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



Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.