Memory efficient way to remove spurious edges of a skeleton?

조회 수: 4 (최근 30일)
Eric Chadwick
Eric Chadwick 2019년 2월 4일
편집: Geoffrey Schivre 2019년 2월 8일
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.

답변 (1개)

Geoffrey Schivre
Geoffrey Schivre 2019년 2월 8일
편집: Geoffrey Schivre 2019년 2월 8일
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