io.loader.load2D
Class NeighborSkeletonNodes2D

java.lang.Object
  extended by io.loader.load2D.NeighborSkeletonNodes2D

public class NeighborSkeletonNodes2D
extends java.lang.Object

Functionalities to examine the neighborhood of skeleton nodes.


Constructor Summary
NeighborSkeletonNodes2D()
           
 
Method Summary
static java.util.List<SkeletonNode> getNeighborSkeletonNodes(SkeletonNode sn, java.awt.image.BufferedImage bimg)
          return a list of all neighbor skeleton nodes.
static boolean isEdgeNeighbor(Index i1, Index i2)
          Check if two indices are edge neighbors or not.
private static boolean isSkeleton(int argb)
          check if the specified color code is encoding a skeleton node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeighborSkeletonNodes2D

public NeighborSkeletonNodes2D()
Method Detail

getNeighborSkeletonNodes

public static java.util.List<SkeletonNode> getNeighborSkeletonNodes(SkeletonNode sn,
                                                                    java.awt.image.BufferedImage bimg)
return a list of all neighbor skeleton nodes. WARNING: this just searches the neighbor pixels in the image of the specified node. new instances are created! WARNING 2: The assumption is that coordinates = index here

Parameters:
sn - the skeleton node we want the neighbors of
bimg - the image where to look for the neighbors
Returns:
a list of all neighbors of the specified skeletonnode. new instances are created for every skeleton node.

isEdgeNeighbor

public static boolean isEdgeNeighbor(Index i1,
                                     Index i2)
Check if two indices are edge neighbors or not.

Parameters:
i1 - index of the first node
i2 - index of the second node
Returns:
true if the two indices are edge neighbors, false if not

isSkeleton

private static boolean isSkeleton(int argb)
check if the specified color code is encoding a skeleton node

Parameters:
argb - the color to be checked
Returns:
true if the specified color value is the skeleton color, false otherwise