public class NeuriteDetector2DAlgos extends Object
The class implements the basic algorithm for neurite detection based on a 2D multichannel fluorescence image. The basic steps are: 1. pre-segmentation step to get a coarse contour of the neurons, yielding a initialization for the active contour models (snake) 2. refinement of the initial contours by the active contour models 3. identification of structural neuron parts, like soma, neurites and growth cones via a wavelet based detection A lot of intermediate results are save to the special result directories. After detection of the neurites a result table with all measured morphology values is shown. An result image showing the detected neurites with their neurite traces and special points is saved to the output directory.
NeuriteExtractor2D
Modifier and Type | Class and Description |
---|---|
static class |
NeuriteDetector2DAlgos.DetectorExternalEnergy
Label for different external energies of the snake which can be used by the
detector.
|
Modifier and Type | Field and Description |
---|---|
private double |
alpha
Weighting factor for snake length term.
|
private double |
beta
Weighting factor for snake curvature term.
|
private MTBNeurite2DSet |
detectedNeuritesSet
Final set of detected neurites.
|
private NeuriteDetector2DAlgos.DetectorExternalEnergy |
energyLabel
Label of available external snake energies, which are usable by the
detector.
|
private String |
file_name_noExtension
Current image name without file extension.
|
private String |
fileName
File name of the current multichannel fluorescence image.
|
private int |
height
Image size in y-direction, given in pixel.
|
private MTBImage |
inputImage
Multichannel fluorescence image of the labeled neuron.
|
private int |
maxFragmentDistance
Maximum distance to connect a fragment to a detected neuron, given in
pixel.
|
private int |
maxIterations
Number of snake iterations.
|
private int |
maxSpineLength
Maximum length to define a branch of a neurite as spine (filopodia-like
protrusion) in pixel.
|
private double |
motionFraction
Minimum fraction of points which should have stooped to move until the
snake optimization stops.
|
private Color |
neuriteColor
Region color of detected neurites to view the neurites in the result image.
|
private int |
neuriteMaskSize
Mask size of average neurite with in pixel.
|
private int[] |
neuronChannels
Channel numbers, including the neuron stains for detection of the neurons
in the current multichannel fluorescence image.
|
private MTBImage |
neuronMIP
Maximum intensity projection (MIP) image of the neuron.
|
private double |
niblackConstant
Application based constant for Niblack thresholding.
|
private int |
nucleiChannel
Channel number, including the nuclei, in the current multichannel
fluorescence image.
|
private MTBImage |
nucleus
Fluorescence labeled nuclei image from the multichannel microscope image.
|
private double |
nucleusRatio
Ratio of nucleus pixels which should be included in a intact neuron region
to specify the neuron region as active and use for detection.
|
private int |
nucleusSize
Minimum size of nucleus region to set region as intact nucleus.
|
private org.rosuda.JRI.Rengine |
rEngine
R engine to start R thread.
|
private int |
resampleConstant
Constant for resampling the snake control points.
|
private String |
result_energy
Result directory for snake energy results.
|
private String |
result_extraction
Result directory for neurite extraction results.
|
private String |
result_presegmentation
Result directory for pre-segmentation.
|
private String |
result_snakes
Result directory for snake results.
|
private String |
resultDir
Main directory for result output.
|
private MTBTableModel |
resultTable
Result table showing the the detection and morphology measurements.
|
private int[] |
snakeIterCount
Number of snake iterations used in current optimization process.
|
private double |
stepSize
Step size value for a snake step (gamma) during optimization.
|
private Boolean |
verbose
Verbose flag for standard console outputs.
|
private int |
width
Image size in x-direction, given in pixel.
|
Constructor and Description |
---|
NeuriteDetector2DAlgos()
Standard constructor.
|
NeuriteDetector2DAlgos(MTBImage _inputImage,
int _nucleiChannel,
int _nucleusSize,
double _nucleusRation,
int[] _neuronChannels,
double _niblackConstant,
int _maxFragmentDistance,
String _pathToFile,
String _resultDir,
NeuriteDetector2DAlgos.DetectorExternalEnergy _energyLabel,
double _alpha,
double _beta,
double _stepSize,
double _motionFraction,
int _maxIterations,
int _resampleConstant,
int _maxSpineLength,
int _neuriteMaskSize,
Color _neuriteColor,
MTBTableModel _table,
Boolean _verbose,
org.rosuda.JRI.Rengine _re)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getAlpha()
Get weighting factor for snake length term.
|
double |
getBeta()
Get weighting factor for snake curvature term.
|
MTBNeurite2DSet |
getDetectedNeuritesSet()
Get set of detected neurites.
|
NeuriteDetector2DAlgos.DetectorExternalEnergy |
getEnergyLabel()
Get energy label for external energy, used for optimization.
|
private MTBImage |
getExtEnergyInit()
Calculate the initial image for the external energy of the snake.
|
MTBImage |
getInputImage()
Get multichannel fluorescence input image.
|
int |
getMaxFragmentDistance()
Get maximum fragment distance , in pixel.
|
int |
getMaxIterations()
Get maximum number of iterations to finish snake optimization,
|
int |
getMaxSpineLength()
Get maximum length of a spine, in pixel.
|
double |
getMotionFraction()
Get minimum motion fraction of snake control points, to finish snake
optimization.
|
Color |
getNeuriteColor()
Get neurite region color (RGB) for result image.
|
int |
getNeuriteMaskSize()
Get maximum neurite mask size, in pixel.
|
int[] |
getNeuronChannles()
Get neuron channels, used for detection.
|
double |
getNiblackConstant()
Get Niblack thresholding constant.
|
int |
getNucleiChannel()
Get channel number, including the labeled nuclei.
|
double |
getNucleusRatio()
Get ratio of nucleus pixels which should be included in an intact neuron
region
|
int |
getNucleusSize()
Get minimum nucleus size of nuclei regions
|
int |
getResampleConstant()
Get constant for snake point resampling.
|
String |
getResultDir()
Get directory of intermediate and final results.
|
MTBTableModel |
getResultTable()
Get final result table of morphology measurements.
|
private Vector<MTBSnakePoint2D> |
getSnakeControlPoints(MTBContour2D initContour)
Method to get each 7th point of the initial contour as snake control point.
|
int[] |
getSnakeIterCount()
Get number snake iteration counts, used for optimization.
|
private MTBRegion2DSet |
getSnakeRegion(MTBPolygon2DSet theSnakes)
Get the region which is included in the snake contour.
|
double |
getStepSize()
Get step size of snake point movement.
|
private void |
init()
Initialize detector.
|
void |
neuriteDetection(MTBContour2DSet initContourSet)
Main method for 2D neurite detection.
|
private MTBPolygon2DSet |
optimizeSnakes(MTBPolygon2DSet initSnakeSet)
Optimization of the snakes (main snake and inner snakes) with its specified
parameters and energies.
|
MTBContour2DSet |
preSegmentation()
Method for pre-segmentation.
|
private void |
setResultDirs()
Create all output directories for the single detection steps.
|
private boolean |
testRegions(MTBRegion2D cell,
MTBRegion2D core)
Test whether the number of pixels from a neuron region contains more than
90% of the pixels from a nucleus region.
|
private boolean |
testRegions2(MTBRegion2D cell,
MTBRegion2D core)
Test whether a single pixel from a neuron region contains a pixel from a
nucleus region.
|
private int width
private int height
private MTBImage neuronMIP
private MTBImage nucleus
private int[] snakeIterCount
private MTBNeurite2DSet detectedNeuritesSet
private String result_presegmentation
private String result_snakes
private String result_extraction
private String result_energy
private String file_name_noExtension
private MTBImage inputImage
private int nucleiChannel
private int nucleusSize
private double nucleusRatio
private int[] neuronChannels
private double niblackConstant
private int maxFragmentDistance
private String fileName
private String resultDir
private NeuriteDetector2DAlgos.DetectorExternalEnergy energyLabel
private double alpha
private double beta
private double stepSize
private double motionFraction
private int maxIterations
private int resampleConstant
private int maxSpineLength
private int neuriteMaskSize
private Color neuriteColor
private MTBTableModel resultTable
private Boolean verbose
private org.rosuda.JRI.Rengine rEngine
public NeuriteDetector2DAlgos()
public NeuriteDetector2DAlgos(MTBImage _inputImage, int _nucleiChannel, int _nucleusSize, double _nucleusRation, int[] _neuronChannels, double _niblackConstant, int _maxFragmentDistance, String _pathToFile, String _resultDir, NeuriteDetector2DAlgos.DetectorExternalEnergy _energyLabel, double _alpha, double _beta, double _stepSize, double _motionFraction, int _maxIterations, int _resampleConstant, int _maxSpineLength, int _neuriteMaskSize, Color _neuriteColor, MTBTableModel _table, Boolean _verbose, org.rosuda.JRI.Rengine _re)
_inputImage
- multichannel fluorescence image_nucleiChannel
- channel number including nuclei image_nucleusSize
- minimum size of nucleus region_nucleusRation
- ratio of nucleus pixels which should be included in an intact
neuron region_neuronChannels
- channel numbers including neuron stains for detection_niblackConstant
- constant for niblack thresholding_maxFragmentDistance
- maximum distance to connect a fragment to the neuron, in pixel_pathToFile
- path to current image fileresultDir
- directory of output results_energyLabel
- label of available external energies for detection using snakes_alpha
- weighting factor for snake length term_beta
- weighting factor for snake curvature term_stepSize
- step size gamma to move snake in a optimization step_motionFraction
- minimum fraction of not moving points to stop optimization_maxIterations
- maximum iteration to stop optimization_resampleConstant
- constant for resampling snake control points_maxSpineLength
- maximum length of a branch to define it as spine, in pixel_neuriteMaskSize
- mask size of average neurite width, in pixel_neuriteColor
- color for neurite regions in result image_table
- result table_verbose
- flag for standard console outputs_re
- R engine to call R scripts from a Java threadpublic double getAlpha()
public double getBeta()
public int[] getSnakeIterCount()
public MTBImage getInputImage()
public int getNucleiChannel()
public int getNucleusSize()
public double getNucleusRatio()
public int[] getNeuronChannles()
public double getNiblackConstant()
public int getMaxFragmentDistance()
public NeuriteDetector2DAlgos.DetectorExternalEnergy getEnergyLabel()
public double getStepSize()
public double getMotionFraction()
public int getMaxIterations()
public int getResampleConstant()
public int getMaxSpineLength()
public int getNeuriteMaskSize()
public Color getNeuriteColor()
public String getResultDir()
public MTBTableModel getResultTable()
public MTBNeurite2DSet getDetectedNeuritesSet()
private void init()
private void setResultDirs()
public void neuriteDetection(MTBContour2DSet initContourSet) throws NeuriteDetector2DException
initContourSet
- set of initial contours for snakesNeuriteDetector2DException
public MTBContour2DSet preSegmentation() throws NeuriteDetector2DException
NeuriteDetector2DException
private Vector<MTBSnakePoint2D> getSnakeControlPoints(MTBContour2D initContour)
initContour
- initial contour to extract snake control pointsprivate MTBRegion2DSet getSnakeRegion(MTBPolygon2DSet theSnakes)
snake
- current snakeprivate MTBImage getExtEnergyInit()
private MTBPolygon2DSet optimizeSnakes(MTBPolygon2DSet initSnakeSet)
initSnakes
- initial snakes for optimization startprivate boolean testRegions(MTBRegion2D cell, MTBRegion2D core)
cell
- region of the neuron cellcore
- region of the nucleusprivate boolean testRegions2(MTBRegion2D cell, MTBRegion2D core)
cell
- region of the neuron cellcore
- region of the nucleusCopyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.