diff --git a/README.md b/README.md index ec63c89..1c9d104 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,30 @@ # fastmorph: multilabel 3D morphological image processing functions. +This is a collection of morphological 3D image operations that are tuned for working with dense 3D labeled images. + +We provide the following multithreaded operations: + +- Dilation +- Erosion +- Opening +- Closing +- Spherical Dilation (binary images) +- Fill Voids + +Highlights compared to other libraries: + +- Handles multi-labeled images +- Multithreaded +- High performance single-threaded +- Low memory usage +- Dilate computes mode of surrounding labels + +Disadvantages versus other libraries: + +- Not ideal for grayscale images +- Stencil (structuring element) is fixed size 3x3x3 and all on. + ```python import fastmorph @@ -45,3 +69,25 @@ morphed = fastmorph.spherical_erode(labels, radius=1, parallel=2, anisotropy=(1, filled_labels, ct = fastmorph.fill_holes(labels, return_fill_count=True, remove_enclosed=False) ``` +## Performance + +A test run on an M1 Macbook Pro on `connectomics.npy.ckl`, a 5123 volume with over 2000 dense labels had the following results. + +``` +erode / 1 thread: 7.70 sec +erode / 2 threads: 4.10 sec +erode / 4 threads: 3.02 sec +dilate / background_only=True / 1 thread: 1.15 sec +dilate / background_only=True / 2 threads: 0.65 sec +dilate / background_only=True / 4 threads: 0.48 sec +dilate / background_only=False / 1 thread: 14.31 sec +dilate / background_only=False / 2 threads: 7.47 sec +dilate / background_only=False / 4 threads: 8.09 sec +dilate / background_only=False / 8 threads: 5.46 sec +skimage expand_labels / 1 thread: 75.20 sec +``` + + + + +