Clear Filters
Clear Filters

Memory efficient way to remove spurious edges of a skeleton?

2 views (last 30 days)
Basically I am looking for a way to achieve what this answer achieves but in a way that does not result in an out of memory error.
I am working with a 3D skeleton of matrix size: 492x501x347 and this is significantly reduced from the actualy size I will be using (3000x3000x2000 roughly).
I have attached the reduced example if anyone would like to try. For me, the memory seems to rise linearly as the for loop progresses. This makes sense since it is populating an array, increasing the size of the array as it continues, but the array is of size Nx1 where N is only in the thousands so this can't be it.
Any insight would be greatly appreciated.
I should add I used a computer with 128 GB of RAM with Matlab being the only program running and still got this error.

Answers (1)

Geoffrey Schivre
Geoffrey Schivre on 8 Feb 2019
Edited: Geoffrey Schivre on 8 Feb 2019
Following your comment here : cleanSkel, I change my litle function to work on 3d images. I couldn't try it to your example (in full size) because my computer is a bit old, but when testing on a litle portion of it seems to work. On the final output of cleanSkel, bwmorph3 didn't find neither any endpoints nor any branchpoints.

Community Treasure Hunt

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

Start Hunting!