Memory efficient way to remove spurious edges of a skeleton?

5 vues (au cours des 30 derniers jours)
Eric Chadwick
Eric Chadwick le 4 Fév 2019
Hello,
Basically I am looking for a way to achieve what this answer achieves https://www.mathworks.com/matlabcentral/answers/88284-remove-the-spurious-edge-of-skeleton#answer_97852 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.

Réponses (1)

Geoffrey Schivre
Geoffrey Schivre le 8 Fév 2019
Modifié(e) : Geoffrey Schivre le 8 Fév 2019
Hello,
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.
Regrads,
Geoffrey

Community Treasure Hunt

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

Start Hunting!

Translated by