Find the endpoints of 3D skeleton
Show older comments
I have images of vessels which are of size 316x316x856. I have used the Skeleton3D function which is available from FileExchange to extract the skeleton, and so the result is a binary volume of the same size. Now however I don't know how to find the endpoints, seeing as the bwmorph command only works for 2D. I tried calculating the Euclidean distance of every point in the skeleton to the other, in a double loop, and keep the maximum distance, but the results I get I think are wrong. Are there any other ways to correctly compute the endpoints?
Answers (1)
Sean de Wolski
on 28 Aug 2015
Edited: Sean de Wolski
on 28 Aug 2015
Convolve the 3d skeleton using convn() with a rubik's cube of ones. Anywhere in this new image that is equal to one or two should be an endpoint.
endpts = ismember(convn(double(skel3d),ones(3,3,3),'same'),[1 2]);
7 Comments
Iason Solomos
on 28 Aug 2015
Edited: Iason Solomos
on 28 Aug 2015
Sean de Wolski
on 28 Aug 2015
Edited: Sean de Wolski
on 28 Aug 2015
This is also going to get spur points so depending on the skeleton algorithm it might be picking up lots of spurs. You could repeat the above 3-4 times which would shorten the skeleton a little but remove the spurs.
Alternatively: There is another option that is more involved that uses the geodesic distance to give you two end points for each vessel that maximize the length of it. If you're interested in this(?) I can try and put some code together. It would involve grabbing all voxels for a specific object. Selecting all of the end/spur points for it and then calculating the geodesic distance between each of them and selecting the two with the largest distance.
Iason Solomos
on 28 Aug 2015
Sean de Wolski
on 28 Aug 2015
Do you have an example zip file you can attach with the MAT file?
Sean de Wolski
on 28 Aug 2015
Also, right idea and good first pass!
You're calculating regular distance, not geodesic. Look at the 'SubImage' and 'PixelList' option in regionprops for pulling out each object, and then bwdistgeodesic for a selected end point.
Sean de Wolski
on 28 Aug 2015
Actually, can you attach a MAT file in a zip file with just skel stored.
Iason Solomos
on 28 Aug 2015
Categories
Find more on Rubik's Cube in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!