Calculates a Sholl analysis on tree intree counting the number of intersections of the tree with concentric spheres of increasing diameter values given by dd. dd can also simply be a single value, the diameter increasing step, by default 50 µm. Outputs are s, number of intersections at diameters dd. A segment can intersect a circle or sphere twice, these double intersections are counted in sd. XP, YP and ZP are the coordinates of the intersection points. iD is the index of these points in dd. Diameter 0 µm is 1 intersection by definition but typically 4 points are still output into XP.

Equations for intersection between line segments and spheres are from Paul Bourke 1992:

http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/

Example:

>> sholl_tree (sample2_tree, 20, '-s')

TREES

The calculation happens in 3D:

TREES

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License