io.loader.load3D
Class SampleParts3D

java.lang.Object
  extended by io.loader.load3D.SampleParts3D

public class SampleParts3D
extends java.lang.Object

Sample single skeleton branches in 3D data.


Field Summary
private static org.apache.log4j.Logger logger
          logger instance
 
Constructor Summary
SampleParts3D()
           
 
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)
          Check if the specified node has already been visited.
private static void markAsVisited(boolean[][][] visited, SkeletonNode node)
          Mark the the specified node as visited.
static java.util.List<SkeletonBranch> samplePartsPerStartNode(SkeletonNode startnode, int[][][] thinningcube, java.util.List<SkeletonNode> endnodes, java.util.List<SkeletonNode> junctionnodes, double widthDim, double heightDim, double depthDim)
          sample all skeleton parts emanating from the specified startnode which has to be a critical node, that is, either end node or junction node.
 
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

SampleParts3D

public SampleParts3D()
Method Detail

samplePartsPerStartNode

public static java.util.List<SkeletonBranch> samplePartsPerStartNode(SkeletonNode startnode,
                                                                     int[][][] thinningcube,
                                                                     java.util.List<SkeletonNode> endnodes,
                                                                     java.util.List<SkeletonNode> junctionnodes,
                                                                     double widthDim,
                                                                     double heightDim,
                                                                     double depthDim)
                                                              throws InvalidSkeletonException
sample all skeleton parts emanating from the specified startnode which has to be a critical node, that is, either end node or junction node.

Parameters:
startnode - - the node where to start sampling all parts
thinningcube - - the skeleton information, where each "not-skeleton" element has entry 0
endnodes - - a list of all end nodes in the skeleton
junctionnodes - - a list of all junction nodes in the skeleton
Throws:
InvalidSkeletonException - - if the skeleton seems to be broken

markAsVisited

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

Parameters:
visited - - 3d array where the coordinates of the passed node are set to true
node - - the node to mark as visited

isVisited

private static boolean isVisited(boolean[][][] visited,
                                 SkeletonNode node)
Check if the specified node has already been visited.

Parameters:
visited - - 3d array where an entry is set to true if these coordinates already have been visited
node - - the node to check for if this was already visited
Returns:
true if the node's coordinates are marked as visited, false if not

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