Branch Points from 3D Logical Skeleton

Version 1.12.0.0 (2.55 KB) by
A function that returns branch points in a 3D skeleton logical image
Updated 6 Jun 2018

This is a function that takes in a 3D skeletonized logical image of size MxNxP and prodcues a logical image containing location of branch points. I was motivated by the lack of a 3D lookup table (LUT) or bwlookup within MATLAB. This function is ideal for computing branchpoints in vasculature or pipes. This function uses a similar approach to a look-up table (LUT), but in 3D. It runs a SZ x SZ x SZ sized local region along the XY plane, and increments Z by one after each scan.
For a continuous line without any branch points running through a 3 x 3 x 3 local region, there will be 3 occupied voxels out of 27. Anytime the number of voxels in this region exceeds 3, there is a branch point present. The function applies this principle to find branch points.
Ensure that your image is padded padded first prior to calling this function. You can do so via I = padarray(I,[3 3],0,'both'), which pads all 6 sides of your 3D image with 3 voxels. Ideally, you should pad your image same size as one of the inputs to this function, 'sz'.
As of now, it is only working when sz = 3, producing a local region of size 3x3x3. So ONLY parse in sz = 3.
Function example:
BP = branchpoints3(skel,3);
where BP is the output logical array containing branchpoints; skel is the input logical skeletonized imaged and 3 is the size of local cubic region.

You can dilate the branch points by a couple pixels and subtract them from your skeleton to create perfectly separated branches. You can then call regionprops3 to obtain various parameters on these branches. If you'd like to get the location of end points of separated branched, vie my other file for calculating end points.

Cite As

Siddhartha Dhiman (2024). Branch Points from 3D Logical Skeleton (https://www.mathworks.com/matlabcentral/fileexchange/67600-branch-points-from-3d-logical-skeleton), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.12.0.0

Fixed error produced from calling undefined variable 'sz'.

1.11.0.0