|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.MiToBo.core.datatypes.MTBGraph
de.unihalle.informatik.MiToBo.core.datatypes.MTBNeuriteSkelGraph
public class MTBNeuriteSkelGraph
The class implements a neurite skeleton graph (NSG), based on the skeleton of a neurite region. The NSG is directed, in the way that exact one START node (mostly the point near the neuron cell body area) exists, which can have one or more output edges and no input edges. By the way, there are some other nodes from type BRANCH or END inside the graph. BRANCH nodes: have one input edge and two or more out edges END nodes: have exact one input edge and no output edges The NSG is build by skeleton traversing, beginning at one given node. The direction is implicit corrected, so that at every time there is a direct "flow" from the START node to all END nodes. So the START node is connected with every END node via exact one path. If the START nodes is changed, the directness of the graph is automatically corrected, and the old node becomes automatically a BRANCH or a END node. The edges hold the pixels of the skeleton between the nodes. It is possible to get all paths from the START node to all END nodes, get the longest path in the whole graph, and several other operations, needed for a NSG. The graph is always free of circles. If an circle exists in the underlying skeleton, the circle is disconnected in two paths (due to the approach of building the graph).
MTBGraph
,
MTBGraphEdge
,
MTBNeuriteSkelGraphNode
Field Summary |
---|
Fields inherited from class de.unihalle.informatik.MiToBo.core.datatypes.MTBGraph |
---|
directed, edges, nodes, numberOfEdges, numberOfNodes |
Constructor Summary | |
---|---|
MTBNeuriteSkelGraph()
Standard constructor. |
|
MTBNeuriteSkelGraph(int _maxSpineLength)
Constructor that creates an empty directed MTBNeuriteSkelGraph with defined maximum spine length. |
|
MTBNeuriteSkelGraph(Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> skelNodes,
Vector<MTBGraphEdge> skelEdges,
int _maxSpineLength,
int _width,
int _heigth)
Constructor to create an directed MTBNeuriteSkelGraph with the given MTBSkeletonGraphNodes and MTBGraphEdges. |
Method Summary | |
---|---|
boolean |
buildSkeletonGraph(int x,
int y,
int w,
int h,
MTBImageByte skeletonImg,
int skelColor)
Build the skeleton graph from a given binary skeleton image and a given starting point to build up the graph. |
MTBNeuriteSkelGraph |
clone()
|
Vector<Vector<Point2D.Double>> |
getAllPaths(boolean includeSpines)
Get the pixels of all paths of the neurite skeleton graph. |
void |
getAllPixels(Vector<Point2D.Double> pixels)
Get all pixels of the neurite skeleton graph from the nodes and edges. |
Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> |
getBranchNodes()
Get all branch nodes of the MTBNeuriteSkelGraph. |
Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> |
getEndNodes()
Get all end nodes of the MTBNeuriteSkelGraph. |
int |
getHeight()
Get skeleton graph image size in y direction. |
Vector<Point2D.Double> |
getLongestPath(boolean includeSpines)
Get the pixels of the longest path of the neurite skeleton graph. |
int |
getRegionID()
Get the region id. |
Vector<Point2D.Double> |
getShortestPath(boolean includeSpines)
Get the pixels of the shortest path of the neurite skeleton graph. |
Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> |
getSkeletonGraphNodes()
Get all nodes of the MTBNeuriteSkelGraph as MTBNeuriteSkelGraphNodes. |
Vector<Vector<Point2D.Double>> |
getSpinePaths()
Get the pixels of all spine paths of the neurite skeleton graph. |
MTBNeuriteSkelGraphNode<Point2D.Double> |
getStartNode()
Get the start node of the MTBNeuriteSkelGraph. |
int |
getWidth()
Get skeleton graph image size in x direction. |
void |
print()
Print the neurite skeleton graph informations. |
void |
setRegionID(int id)
Set the region id. |
void |
setStartNode(MTBNeuriteSkelGraphNode<Point2D.Double> node)
Set a new start node. |
MTBImageByte |
toByteImage()
Draw the skeleton graph into a binary image. |
MTBImageRGB |
toImage()
Visualize the skeleton graph as RGB image. |
MTBImageRGB |
toImage(MTBImageRGB rgbImage)
Draw the skeleton graph in the given RGB image. |
MTBTableModel |
toSWC(String fileName,
MTBImageByte neuronImage)
Method to save neurite skeleton graph as SWC file. |
Methods inherited from class de.unihalle.informatik.MiToBo.core.datatypes.MTBGraph |
---|
addEdge, addNode, getEdgeNum, getEdges, getGraphCost, getNodeNum, getNodes, isDirected, removeEdge, removeNode |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MTBNeuriteSkelGraph()
public MTBNeuriteSkelGraph(int _maxSpineLength)
_maxSpineLength
- public MTBNeuriteSkelGraph(Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> skelNodes, Vector<MTBGraphEdge> skelEdges, int _maxSpineLength, int _width, int _heigth) throws MTBNeuriteSkelGraphException
skelNodes
- vector of MTBNeuriteSkelGraphNodesskelEdges
- vector of MTBGraphEdges
MTBNeuriteSkelGraphException
Method Detail |
---|
public int getWidth()
public int getHeight()
public MTBNeuriteSkelGraph clone()
clone
in class Object
public Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> getSkeletonGraphNodes()
public MTBNeuriteSkelGraphNode<Point2D.Double> getStartNode()
public void setStartNode(MTBNeuriteSkelGraphNode<Point2D.Double> node)
node
- new start nodepublic Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> getBranchNodes()
public Vector<MTBNeuriteSkelGraphNode<Point2D.Double>> getEndNodes()
public void setRegionID(int id)
public int getRegionID()
public boolean buildSkeletonGraph(int x, int y, int w, int h, MTBImageByte skeletonImg, int skelColor)
Build the skeleton graph from a given binary skeleton image and a given starting point to build up the graph. Build definition: The graph is build from a given starting point (mostly a end point of the skeleton, near the neuron cell body). All other points are marked automatically by building up the graph. Branch points are marked as BRANCH nodes, end points are marked as END nodes and edge points are added to the edge data structure. BRANCH nodes: have one input edge and two or more out edges END nodes: have exact one input edge and no output edges By building up the graph, 4-way neighbors are visited first, diagonal neighbors are visited in the second step. The graph is always free of circles. If an circle exists in the underlying skeleton, the circle is disconnected in two paths (due to the approach of building the graph).
x
- starting point coordinate in x-directiony
- starting point coordinate in y-directionw
- width of the skeleton imageh
- height of the skeleton imageskeletonImg
- the binary skeleton imageskelColor
- color of the skeleton, the background is set to the opposite
color, for example the skeleton is 0, then the background is set
to 255 and vice versa
public void getAllPixels(Vector<Point2D.Double> pixels)
Get all pixels of the neurite skeleton graph from the nodes and edges. Pixel collection starts at the start node of the skeleton graph. WARNING!!! The specific order within the list depends on the edge direction between the single nodes. Order of the single edges depends on the build process.
pixels
- empty list to be filledpublic Vector<Point2D.Double> getLongestPath(boolean includeSpines)
includeSpines
-
public Vector<Point2D.Double> getShortestPath(boolean includeSpines)
includeSpines
-
public Vector<Vector<Point2D.Double>> getSpinePaths()
public Vector<Vector<Point2D.Double>> getAllPaths(boolean includeSpines)
includeSpines
-
public MTBImageRGB toImage()
public MTBImageRGB toImage(MTBImageRGB rgbImage)
public MTBImageByte toByteImage()
public void print()
print
in class MTBGraph
public MTBTableModel toSWC(String fileName, MTBImageByte neuronImage)
fileName
- filename for saving the SWC file, if null, file will not be savedneuronImage
- if radii for each skeleton point should be calculated, a image
must be given to calculate the distance map of the neuron region
and get radius of each skeleton point, can be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |