geometry.object
Class SkeletonNode

java.lang.Object
  extended by geometry.object.SkeletonNode

public class SkeletonNode
extends java.lang.Object

data structure to hold information about single skeleton nodes (that is, points on a skeleton) like coordinates, previous node on path etc.

A skeleton node can be either an endnode or a "true" skeleton node. An end node is a point on the skeleton with exactly one neighbor skeleton point.

If a skeleton node is not explicitly declared as an endpoint, it is implicitely declared as skeleton point.


Field Summary
private  Coordinates coordinates
          the skeleton node's coordinates
private  Index index
          the skeleton node's index in the 2D/3D image (as coordinates and index might differ from each other)
private  boolean isEndNode
          holds the information if this skeleton node is an end node
private  boolean isSkeletonNode
          holds the information if this skeleton node is a true skeleton node, that is, no end node
(package private)  org.apache.log4j.Logger logger
          logger instance
private  SkeletonNode previous
          holds the information which skeleton node is the predecessor on the path
 
Constructor Summary
SkeletonNode(Coordinates coordinates, boolean isEndNode)
          constructor with specified isEndNode
SkeletonNode(Coordinates coordinates, Index index)
          constructor.
 
Method Summary
 boolean equals(SkeletonNode node)
          check if the current skeleton node is equal to the one specified as parameter.
 Coordinates getCoordinates()
          get this skeleton node's coordinates.
 Index getIndex()
           
 SkeletonNode getPrevious()
          get the predecessor of this skeleton node on the path.
 boolean isEndNode()
          check if this skeleton node is an end node.
 boolean isSkeletonNode()
          check if this skeleton node is a true skeleton node, that is, it's neither end node nor junction node.
 void setCoordinates(Coordinates coordinates)
          set this skeleton node's coordinates.
 void setEndNode(boolean isEndNode)
          set the information if this node is an end node
 void setIndex(Index index)
           
 void setPrevious(SkeletonNode previous)
          get the predecessor of this skeleton node on the path.
 void setSkeletonNode(boolean isSkeletonNode)
          set the information if this skeleton node is a true skeleton node, that is, it not an end node.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

coordinates

private Coordinates coordinates
the skeleton node's coordinates


index

private Index index
the skeleton node's index in the 2D/3D image (as coordinates and index might differ from each other)


isEndNode

private boolean isEndNode
holds the information if this skeleton node is an end node


isSkeletonNode

private boolean isSkeletonNode
holds the information if this skeleton node is a true skeleton node, that is, no end node


logger

final org.apache.log4j.Logger logger
logger instance


previous

private SkeletonNode previous
holds the information which skeleton node is the predecessor on the path

Constructor Detail

SkeletonNode

public SkeletonNode(Coordinates coordinates,
                    Index index)
constructor. create a new skeleton node with only the coordinates given. if this constructor is used, isEndNode is automatically set to false and isSkeletonNode is set to true.

Parameters:
coordinates - the skeleton node's coordinates

SkeletonNode

public SkeletonNode(Coordinates coordinates,
                    boolean isEndNode)
             throws InvalidSkeletonException
constructor with specified isEndNode

to create a true skeleton node, just use SkeletonNode(Coordinates, Index)

Parameters:
coordinates - the skeleton node's coordinates
isEndNode - set if this skeleton node is end node or not.
Throws:
InvalidSkeletonException
Method Detail

equals

public boolean equals(SkeletonNode node)
               throws InvalidSkeletonException
check if the current skeleton node is equal to the one specified as parameter.

two skeleton nodes are defined as equals, if their coordinates are equal.

a node can either be junction point, endpoint, or skeleton point. so if one of the nodes is defined as a junction point or as endpoint and the other one is not, something might be wrong in the skeleton and an exception is thrown. in this case the function returns true anyway.

Parameters:
node - the skeleton node to be compared
Returns:
true if the two skeletonnodes are equal, false if not.
Throws:
InvalidSkeletonException - if the nodes have the same coordinates, but one of the nodes is defined as junction/endpoint while the other one is not.

getCoordinates

public Coordinates getCoordinates()
get this skeleton node's coordinates.

Returns:
coordinates the skeleton node's coordinates

getPrevious

public SkeletonNode getPrevious()
get the predecessor of this skeleton node on the path.

Returns:
the predecessor of this node

isEndNode

public boolean isEndNode()
check if this skeleton node is an end node.

Returns:
true if this skeleton node is an end node, false if not.

isSkeletonNode

public boolean isSkeletonNode()
check if this skeleton node is a true skeleton node, that is, it's neither end node nor junction node.

Returns:
true if this node is a true skeleton node, false if not.

setCoordinates

public void setCoordinates(Coordinates coordinates)
set this skeleton node's coordinates.

Parameters:
coordinates - the skeleton node's coordinates

setEndNode

public void setEndNode(boolean isEndNode)
set the information if this node is an end node

Parameters:
isEndNode - true if this is an end node, false if not

setPrevious

public void setPrevious(SkeletonNode previous)
get the predecessor of this skeleton node on the path.

Parameters:
previous - the predecessor of this skeleton node

setSkeletonNode

public void setSkeletonNode(boolean isSkeletonNode)
set the information if this skeleton node is a true skeleton node, that is, it not an end node.

Parameters:
isSkeletonNode - true if this is a true skeleton node, false if it's an end node

setIndex

public void setIndex(Index index)
Parameters:
index - the index to set

getIndex

public Index getIndex()
Returns:
the index

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object