In a few scans I’m working with, after thresholding and segmenting with brushes/scissors/etc, I wind up with many thousands of small islands in the integument of some insects. Basically, lots of tiny little buts that are the same intensity of the vessels I’m segmenting out, but separate from these features. The islands are typically less than 20 voxels, so removing them using remove small islands is pretty straightforward. The issue is that it is exceedingly slow - it can take hours, depending on how many (upwards of 100000) small specs show up.
I’ve dug into the python for the islands effect a bit, and by scattering print statements to do a very coarse profiling, it appears the slowest part is the modifySegmentByLabelmap() function (implemented in C++), so “refactoring” this is probably non-trivial.
What I’ve wound up doing is making a new segment and picking the larger islands one by one to add to it using Add selected island, but it’s still pretty tedious. I’ve also tried a few filtering and smoothing approaches, but they wind up removing detail on the things I want to keep.
Any ideas anybody has on this for either speeding up removing small islands, or a totally different approach would be most appreciated - Thanks!