Algorithm 1 Branch detection algorithm Sample N directions di∀i ∈ (1, N) uniformly off the sphere
2. |
| Construct tubes of radius 1 and length R along each of the N directions, originating at the end point under analysis. |
| Calculate the mean image intensity within each tube as Imean(di). |
| Threshold the estimated mean intensities with respect to the parent branch intensity Ithres. |
| Extract the subset of directions di with mean intensities above the threshold. |
| Apply k-means clustering [64], [65] to the extracted directions di∀i ∈ (1, N) and Imean(di) > = Ithres, with a target of 3 clusters. |
|
if Number of non-empty clusters < 3 then
|
| Declare nonexistence of branching at end point under analysis |
| else |
| Compute the centroid of the directions in each cluster, to yield 3 candidate branch directions. |
| Eliminate the candidate direction that has maximum overlap with the parent branch's volume. |
| Compute the dot products of the 2 remaining candidate directions with the tangent of the parent branch at the end point. |
| Extend the parent branch by the candidate direction better aligned with the tangent at the end point. |
| Create a new branch in the tree structure using the 1 remaining candidate direction. |
| end if |