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:


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


The calculation happens in 3D:


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