de.unihalle.informatik.MiToBo.core.datatypes.neurites
Class MTBNeurite2D

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDData
      extended by de.unihalle.informatik.MiToBo.core.datatypes.neurites.MTBNeurite2D

public class MTBNeurite2D
extends de.unihalle.informatik.Alida.operator.ALDData

Class for neurite objects. An neurite consists of its neurite skeleton graph (NSG), at least two feature lines, which are to borderlines to separate the soma from the neurite shaft and the neurite shaft from the growth cone(s). And there is a maximum spine (filopodia-like protrusions) length value that indicates, which paths of the neurite are spines. TODO updated comments about measurements

Author:
Danny Misiak
See Also:
MTBNeuriteSkelGraph

Field Summary
private  java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> featureLines
          Borderlines that separate the neurite from the soma and additionally separate the neurite from its growth cone.
private  java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> featurePoints
          Features of the single neurite branches.
private  MTBRegion2DSet growthCones
          Neurite corresponding growth cone regions as MTBRegion2D objects.
private  int maxSpineLength
          Given maximum lengths for definition of spines.
private  MTBNeuriteSkelGraph neuriteGraph
          Neurite skeleton Graph (NSG) of the current neurite.
private  MTBRegion2D neuriteRegion
          Neurite corresponding region as MTBRegion2D object.
private  MTBRegion2D neuriteShaft
          Neurite corresponding neurite shaft region as MTBRegion2D object.
private  int[] neuriteShaftLengths
          Lengths of the single branches of a neurite shaft.
private  java.util.Vector<java.util.Vector<java.lang.Double>> neuriteWidths
          Average widths of the whole neurite, the neurite shaft and the growth cone.
 
Constructor Summary
MTBNeurite2D(MTBNeuriteSkelGraph _neuriteGraph, java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> _featurePoints, java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> _featureLines, MTBRegion2D _neuriteRegion, int _maxSpineLength, int[] _neuriteShaftLengths, java.util.Vector<java.util.Vector<java.lang.Double>> _neuriteWidths)
          Constructor to generate a new neurite object.
 
Method Summary
 boolean addData(java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> p, java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> f, int[] n, java.util.Vector<java.util.Vector<java.lang.Double>> w)
          Add data to the current neurite object.
 MTBImageByte drawLine2D(java.awt.geom.Line2D.Double line, java.awt.geom.Point2D.Double point, MTBImageByte tmpNeuronImg)
          Draws a 2D line into the neuron image.
 double[] getAvgConeWidths()
          Get average widths of each neurite growth cone.
 double[] getAvgNeuriteWidths()
          Get average widths of each complete neurite branch.
 double[] getAvgShaftWidths()
          Get average widths of each neurite shaft.
 int getBrancheCount()
          Get number of neurite branches.
 int[] getBranchLengths()
          Get lengths of neurite branches along the complete neurite skeleton graph.
 int[] getConeAreas()
          Get areas of growth cone regions.
 int[] getConeLengths()
          Get length of the growth cone region along the neurite skeleton graph without neurite shaft areas.
 double[] getConeRoundness()
          Get roundness of growth cone regions, 1 means a perfect circle.
 int[] getConeSpineCount()
          Get number of spines (filopodia-like protrusions) per growth cones.
 int getDefinedSpineLength()
          Get length to define a neurite branch as spine (filopodia-like protrusions).
 int getEndCount()
          Get number of end points.
 java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> getFeatureLines()
          Get neurite corresponding feature lines of borders between soma and neurite shafts and neurite shafts and growth cones.
 java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> getFeaturePoints()
          Get neurite corresponding feature points of borders between soma and neurite shafts and neurite shafts and growth cones.
 java.awt.geom.Point2D.Double getfirstFeatureAt(int index)
          Get first feature of neurite corresponding feature points from borders between soma and neurite shafts.
 MTBRegion2DSet getGrowthConeRegions()
          Get regions of the separated growth cones.
 MTBNeuriteSkelGraph getNeuriteGraph()
          Get neurite corresponding skeleton graph.
 MTBRegion2D getNeuriteRegion()
          Get neurite corresponding region.
 int getNeuriteShaftArea()
          Get area of neurite shaft region (without growth cone).
 MTBRegion2D getNeuriteShaftRegion()
          Get neurite shaft region (without growth cone).
 java.util.Vector<java.util.Vector<java.lang.Double>> getNeuriteWidths()
          Get average widths of each neurite branch, including the average widths of the whole branches, the shafts and the growth cones.
 java.awt.geom.Point2D.Double getsecondFeatureAt(int index)
          Get second feature of neurite corresponding feature points from borders between neurite shafts and growth cones.
 int[] getShaftLengths()
          Get neurite shaft lengths of all branches without growth cone areas.
 int getSpineCount()
          Get number of spines (filopodia-like protrusions).
 MTBImageRGB toImage(java.awt.Color regionColor)
          Visualize the neurites skeleton graph as RGB image.
 MTBImageRGB toImage(MTBImageRGB rgbImage, java.awt.Color regionColor)
          Visualize the neurites skeleton graph in the given RGB image.
 void updateRegions()
          Update neurite shaft and growth cone regions, due to changes of this regions by adding features or something else.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

featureLines

private java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> featureLines
Borderlines that separate the neurite from the soma and additionally separate the neurite from its growth cone.


featurePoints

private java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> featurePoints
Features of the single neurite branches. Each branch has at least one feature at the starting point of the neurite and one feature to separate the neurite shaft from the growth cone.


growthCones

private MTBRegion2DSet growthCones
Neurite corresponding growth cone regions as MTBRegion2D objects.


maxSpineLength

private int maxSpineLength
Given maximum lengths for definition of spines. If an end point of the MTBNeuriteSkelGraph has an incoming edge smaller than the given spineLength, the path is labeled as spine.


neuriteGraph

private MTBNeuriteSkelGraph neuriteGraph
Neurite skeleton Graph (NSG) of the current neurite.


neuriteRegion

private MTBRegion2D neuriteRegion
Neurite corresponding region as MTBRegion2D object.


neuriteShaft

private MTBRegion2D neuriteShaft
Neurite corresponding neurite shaft region as MTBRegion2D object.


neuriteShaftLengths

private int[] neuriteShaftLengths
Lengths of the single branches of a neurite shaft.


neuriteWidths

private java.util.Vector<java.util.Vector<java.lang.Double>> neuriteWidths
Average widths of the whole neurite, the neurite shaft and the growth cone.

Constructor Detail

MTBNeurite2D

public MTBNeurite2D(MTBNeuriteSkelGraph _neuriteGraph,
                    java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> _featurePoints,
                    java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> _featureLines,
                    MTBRegion2D _neuriteRegion,
                    int _maxSpineLength,
                    int[] _neuriteShaftLengths,
                    java.util.Vector<java.util.Vector<java.lang.Double>> _neuriteWidths)
Constructor to generate a new neurite object.

Parameters:
_neuriteGraph - NSG of the current neurite
_featurePoints - vector of feature points
_featureLines - vector of feature lines
_neuriteRegion - 2D region of the neurite
_maxSpineLength - maximum spine (filopodia-like protrusions) length
_neuriteShaftLengths - array of neurite branch lengths
_neuriteWidths - average widths of neurite branches, shafts and growth cones for the current neurite object
Method Detail

addData

public boolean addData(java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> p,
                       java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> f,
                       int[] n,
                       java.util.Vector<java.util.Vector<java.lang.Double>> w)
Add data to the current neurite object.

Parameters:
p - vector of feature points to add
f - vector of feature lines to add
n - array of neurite branch lengths to add
w - vector of average widths to add
Returns:
True if data was added successfully.

drawLine2D

public MTBImageByte drawLine2D(java.awt.geom.Line2D.Double line,
                               java.awt.geom.Point2D.Double point,
                               MTBImageByte tmpNeuronImg)
Draws a 2D line into the neuron image.

This function implements the Bresenham algorithm. Code was 'stolen' from Wikipedia, http://de.wikipedia.org/wiki/Bresenham-Algorithmus, and then translated into Java (German comments where kept).

Parameters:
xstart - x-coordinate of start point.
ystart - y-coordinate of start point.
xend - x-coordinate of end point.
yend - y-coordinate of end point.
value - Color/gray-scale value of the polygon.

getAvgConeWidths

public double[] getAvgConeWidths()
Get average widths of each neurite growth cone.

Returns:
Average growth cone widths.

getAvgNeuriteWidths

public double[] getAvgNeuriteWidths()
Get average widths of each complete neurite branch.

Returns:
Average branch widths.

getAvgShaftWidths

public double[] getAvgShaftWidths()
Get average widths of each neurite shaft.

Returns:
Average shaft widths.

getBrancheCount

public int getBrancheCount()
Get number of neurite branches.


getBranchLengths

public int[] getBranchLengths()
Get lengths of neurite branches along the complete neurite skeleton graph.

Returns:
Neurite branch lengths.

getConeAreas

public int[] getConeAreas()
Get areas of growth cone regions.

Returns:
Growth cone areas in pixel.

getConeLengths

public int[] getConeLengths()
Get length of the growth cone region along the neurite skeleton graph without neurite shaft areas.

Returns:
Growth cone lengths.

getConeRoundness

public double[] getConeRoundness()
Get roundness of growth cone regions, 1 means a perfect circle.

Returns:
Growth cone roundness.

getConeSpineCount

public int[] getConeSpineCount()
Get number of spines (filopodia-like protrusions) per growth cones.

Returns:
Growth cone spine count.

getDefinedSpineLength

public int getDefinedSpineLength()
Get length to define a neurite branch as spine (filopodia-like protrusions).

Returns:
Spine length.

getEndCount

public int getEndCount()
Get number of end points.


getFeatureLines

public java.util.Vector<java.util.Vector<java.awt.geom.Line2D.Double>> getFeatureLines()
Get neurite corresponding feature lines of borders between soma and neurite shafts and neurite shafts and growth cones.

Returns:
Feature points.

getFeaturePoints

public java.util.Vector<java.util.Vector<java.awt.geom.Point2D.Double>> getFeaturePoints()
Get neurite corresponding feature points of borders between soma and neurite shafts and neurite shafts and growth cones.

Returns:
Feature points.

getfirstFeatureAt

public java.awt.geom.Point2D.Double getfirstFeatureAt(int index)
Get first feature of neurite corresponding feature points from borders between soma and neurite shafts.

Returns:
First feature points.

getGrowthConeRegions

public MTBRegion2DSet getGrowthConeRegions()
Get regions of the separated growth cones.

Returns:
Growth cone regions.

getNeuriteGraph

public MTBNeuriteSkelGraph getNeuriteGraph()
Get neurite corresponding skeleton graph.

Returns:
Neurite skeleton graph.

getNeuriteRegion

public MTBRegion2D getNeuriteRegion()
Get neurite corresponding region.

Returns:
Neurite region.

getNeuriteShaftArea

public int getNeuriteShaftArea()
Get area of neurite shaft region (without growth cone).

Returns:
Neurite shaft area in pixel.

getNeuriteShaftRegion

public MTBRegion2D getNeuriteShaftRegion()
Get neurite shaft region (without growth cone).

Returns:
Neurite shaft region.

getNeuriteWidths

public java.util.Vector<java.util.Vector<java.lang.Double>> getNeuriteWidths()
Get average widths of each neurite branch, including the average widths of the whole branches, the shafts and the growth cones.

Returns:
Average widths.

getsecondFeatureAt

public java.awt.geom.Point2D.Double getsecondFeatureAt(int index)
Get second feature of neurite corresponding feature points from borders between neurite shafts and growth cones.

Returns:
Second feature points.

getShaftLengths

public int[] getShaftLengths()
Get neurite shaft lengths of all branches without growth cone areas.

Returns:
Neurite shaft lengths.

getSpineCount

public int getSpineCount()
Get number of spines (filopodia-like protrusions).


toImage

public MTBImageRGB toImage(java.awt.Color regionColor)
Visualize the neurites skeleton graph as RGB image. Edge points colored in bright green, END nodes colored in red, BRANCH nodes colored in blue and START nodes colored in green. The features (border lines) are colored in yellow.

Parameters:
regionColor - neurite region color in 3-element RGB array red[0], green[1], blue[2], if null no regions are drawn
Returns:
RGB labeled neurite image.

toImage

public MTBImageRGB toImage(MTBImageRGB rgbImage,
                           java.awt.Color regionColor)
Visualize the neurites skeleton graph in the given RGB image. Edge points colored in bright green, END nodes colored in red, BRANCH nodes colored in blue and START nodes colored in green. The features (border lines) are colored in yellow. Regions can be shown in special colors via an 3-element int array.

Parameters:
rgbImage - image to draw neurite into
regionColor - neurite region color in 3-element RGB array red[0], green[1], blue[2], if null no regions are drawn
Returns:
RGB labeled neurite image.

updateRegions

public void updateRegions()
Update neurite shaft and growth cone regions, due to changes of this regions by adding features or something else.