io.loader.load2D
Class SampleParts2D

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

public class SampleParts2D
extends java.lang.Object

Sample the skeleton branches emanating from one critical node (end or junction node).


Field Summary
private static org.apache.log4j.Logger logger
          logger instance
 
Constructor Summary
SampleParts2D()
           
 
Method Summary
private static SkeletonBranch createPart(SkeletonNode startnode, SkeletonNode endnode, java.util.List<SkeletonNode> nodesOnPart)
          If an end node or junction node has been reached, this function can be used to create the part between the startnode and the current node.
private static boolean isVisited(boolean[][] visited, SkeletonNode node)
          Test if the speicifed skeleton node has been visited.
private static void markAsVisited(boolean[][] visited, SkeletonNode node)
          mark the specified skeleton node as visited.
static java.util.List<SkeletonBranch> samplePartsPerStartNode(SkeletonNode startnode, ij.ImagePlus skeletonImage, java.util.List<SkeletonNode> endnodes, java.util.List<SkeletonNode> junctionnodes)
          Sample all skeleton branches emanating from the specified startnode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.apache.log4j.Logger logger
logger instance

Constructor Detail

SampleParts2D

public SampleParts2D()
Method Detail

markAsVisited

private static void markAsVisited(boolean[][] visited,
                                  SkeletonNode node)
mark the specified skeleton node as visited.

Parameters:
visited - the 3D array to mark visited nodes in
node - the node to be marked as visited

isVisited

private static boolean isVisited(boolean[][] visited,
                                 SkeletonNode node)
Test if the speicifed skeleton node has been visited.

Parameters:
visited - the 3D array where information is saved about visited nodes
node - the node to be tested
Returns:
true if the nodes was already visited, false if not

samplePartsPerStartNode

public static java.util.List<SkeletonBranch> samplePartsPerStartNode(SkeletonNode startnode,
                                                                     ij.ImagePlus skeletonImage,
                                                                     java.util.List<SkeletonNode> endnodes,
                                                                     java.util.List<SkeletonNode> junctionnodes)
                                                              throws InvalidSkeletonException
Sample all skeleton branches emanating from the specified startnode.

Parameters:
startnode - the node for which the emanating parts will be sampled
skeletonImage - the skeleton image
endnodes - a list of all endnodes in the skeleton image
junctionnodes - a list of all junction nodes in the skeleton image
Returns:
a list of all skeleton branches emanating from the specified start node
Throws:
InvalidSkeletonException - if the skeleton seems broken

createPart

private static SkeletonBranch createPart(SkeletonNode startnode,
                                         SkeletonNode endnode,
                                         java.util.List<SkeletonNode> nodesOnPart)
If an end node or junction node has been reached, this function can be used to create the part between the startnode and the current node. A copy of the list of all visited nodes is set as visited nodes in the part, and the original (temporary) list is cleared.

Parameters:
startnode - - the startnode of the new part
endnode - - the endnode of the new part
nodesOnPart - - all nodes lieing on this part, in the order of their occurance. Warning: this list cleared in the function.
Returns:
a skeleton part, starting at startnode and ending at end node, connected by the list of skeleton nodes passed as nodesOnPath