Imagej ops skeleton (thin) remove loops

@imagejan, @ctrueden, @iarganda

I am using


to create skeletons.

Works very nice! Thanks for implementing!

I was wondering whether there is a way to avoid loops? Or remove loops later?

1 Like

I have not tried this and perhaps you are ignoring the original topology, but in case it helps:

fill holes,
skeletonize again


@Christian_Tischer No problem (and @dietzc’s students developed the initial version). Now that we’ve established some data structures for meshes in imagej-mesh, I would also like to setup some skeleton/graph data structures. We will also need those in SciView, and I have some prototype code for doing this for 3D skeletons that is written in Clojure.

@gabriel’s suggestion is clever.

@iarganda’s skeleton analysis code is more advanced when it comes to loop removal and pruning, and I would be open to his suggestions for loop removal and skeleton pruning op ideas. My suggestion would be to maintain a separation between thinning, loop removal, and pruning ops.

If anyone is interested there is a project that I’ve been working on with some folks at CBG and UTSW for skeletonizing noisy segmentations (to resolve, for example, skeletonization results where there the topology of the input binary segmentation has been broken incorrectly). Much of that code has been written (in clojure) for pruning, topology measures, topologically informed methods for loop removal, and the data structures are strictly graphs. We just need a bit of revitalization/fresh blood to wrap up the code/paper.


Sorry for the late answer. In AnalyzeSkeleton you can detect and prune loops. You might need to apply it several times to make sure your remove all loops though.

1 Like

This approach works in 2D but not in 3D, right?

As I said, I did not try that so I do not know. I wonder, if you have a 3D hole after skeletonizing the first time, wouldn’t that hole appear as holes in stack slices? Maybe you can fill those in 2D and re-skeletonize in 3D.