![]() ![]() A multi-label algorithm can be much faster than even the fastest serial application of a binary algorithm. Similarly to the connected-components-3d and euclidean-distance-3d projects, in connectomics, it can be common to want to apply void filling algorithms to all labels within a densely packed volume. We improve performance significantly by using libdivide to make computing x,y,z coordinates from array index faster, by scanning right and left to take advantage of machine memory speed, by only placing a neighbor on the stack when we've either just started a scan or just passed a foreground pixel while scanning. This means non-visited holes and foreground will be marked as 1 for foreground and the visited background will be marked as 0. Write out a binary image the same size as the input mapped as buffer != 1 (i.e.Flood fill (six connected) with the visited background color ( 1) in sequence from each location in the stack that is not already foreground.Raster scan each face of the current image and the first time a black pixel ( 0) is encountered after either starting or enountering a foreground pixel, add that location to a stack.Raster scan and mark every foreground voxel 2 for pre-existing foreground.Pip install fill-voids -no-binary :all: Current Algorithm Sudo apt-get install python3-dev # This is for Ubuntu, but whatever is appropriate for you The current version of this library uses a scan line flood fill of the background labels and then labels everything not filled as foreground. The SciPy hole filling algorithm uses slow serial dilations. This library contains both 2D and 3D void filling algorithms, similar in function to _fill_holes, but with an eye towards higher performance. In this test, fill_voids (`in_place=False`) is significantly faster than scipy with lower memory usage. 1: Filling five labels using SciPy binary_fill_holes vs fill_voids from a 512x512x512 densely labeled connectomics segmentation. 512x512x512 binary image // modifies labels as a side effect, returns number of voxels filled in size_t fill_ct = fill_voids::binary_fill_holes(labels, sx, sy, sz) // 3D // let labels now represent a 512x512 2D image size_t fill_ct = fill_voids::binary_fill_holes(labels, sx, sy) // 2Dįig. # include "fill_voids.hpp " size_t sx, sy, sz ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |