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

Constructor Summary
MTBNeurite2D(MTBNeuriteSkelGraph _neuriteGraph, Vector<Vector<Point2D.Double>> _featurePoints, Vector<Vector<Line2D.Double>> _featureLines, MTBRegion2D _neuriteRegion, int _maxSpineLength, int[] _neuriteShaftLengths, Vector<Vector<Double>> _neuriteWidths)
          Constructor to generate a new neurite object.
 
Method Summary
 boolean addData(Vector<Vector<Point2D.Double>> p, Vector<Vector<Line2D.Double>> f, int[] n, Vector<Vector<Double>> w)
          Add data to the current neurite object.
 MTBImageByte drawLine2D(Line2D.Double line, 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.
 Vector<Vector<Line2D.Double>> getFeatureLines()
          Get neurite corresponding feature lines of borders between soma and neurite shafts and neurite shafts and growth cones.
 Vector<Vector<Point2D.Double>> getFeaturePoints()
          Get neurite corresponding feature points of borders between soma and neurite shafts and neurite shafts and growth cones.
 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).
 Vector<Vector<Double>> getNeuriteWidths()
          Get average widths of each neurite branch, including the average widths of the whole branches, the shafts and the growth cones.
 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(Color regionColor)
          Visualize the neurites skeleton graph as RGB image.
 MTBImageRGB toImage(MTBImageRGB rgbImage, 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
 

Constructor Detail

MTBNeurite2D

public MTBNeurite2D(MTBNeuriteSkelGraph _neuriteGraph,
                    Vector<Vector<Point2D.Double>> _featurePoints,
                    Vector<Vector<Line2D.Double>> _featureLines,
                    MTBRegion2D _neuriteRegion,
                    int _maxSpineLength,
                    int[] _neuriteShaftLengths,
                    Vector<Vector<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

getNeuriteGraph

public MTBNeuriteSkelGraph getNeuriteGraph()
Get neurite corresponding skeleton graph.

Returns:
Neurite skeleton graph.

getFeaturePoints

public Vector<Vector<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 Point2D.Double getfirstFeatureAt(int index)
Get first feature of neurite corresponding feature points from borders between soma and neurite shafts.

Returns:
First feature points.

getsecondFeatureAt

public 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.

getFeatureLines

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

Returns:
Feature points.

getNeuriteRegion

public MTBRegion2D getNeuriteRegion()
Get neurite corresponding region.

Returns:
Neurite region.

addData

public boolean addData(Vector<Vector<Point2D.Double>> p,
                       Vector<Vector<Line2D.Double>> f,
                       int[] n,
                       Vector<Vector<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.

updateRegions

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


getGrowthConeRegions

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

Returns:
Growth cone regions.

getNeuriteShaftRegion

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

Returns:
Neurite shaft region.

getNeuriteShaftArea

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

Returns:
Neurite shaft area in pixel.

getConeAreas

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

Returns:
Growth cone areas in pixel.

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.

getBranchLengths

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

Returns:
Neurite branch lengths.

getShaftLengths

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

Returns:
Neurite shaft lengths.

getConeLengths

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

Returns:
Growth cone lengths.

getNeuriteWidths

public Vector<Vector<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.

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.

getAvgConeWidths

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

Returns:
Average growth cone widths.

getBrancheCount

public int getBrancheCount()
Get number of neurite branches.


getSpineCount

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


getEndCount

public int getEndCount()
Get number of end points.


toImage

public MTBImageRGB toImage(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,
                           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.

drawLine2D

public MTBImageByte drawLine2D(Line2D.Double line,
                               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.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.