Skip to content

Commit

Permalink
docs: add description of highlights and perf
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Dec 19, 2023
1 parent ae68f15 commit ebad043
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 512<sup>3</sup> 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
```





0 comments on commit ebad043

Please sign in to comment.