@@ -281,15 +281,15 @@ apparent size of the nuclei by eroding the image.
281281Image erosion is an image filter, similar to those we covered in the
282282[ filters and thresholding] ( filters-and-thresholding.md ) lesson.
283283We will use scikit-image's
284- [ binary_erosion ] (
285- https://scikit-image.org/docs/stable/api/skimage.morphology.html#skimage.morphology.binary_erosion )
286- function. In this lesson we will run the binary erosion function using
284+ [ erosion ] (
285+ https://scikit-image.org/docs/stable/api/skimage.morphology.html#skimage.morphology.erosion )
286+ function. In this lesson we will run the erosion function using
287287the Napari console to help develop our scripting skills. It is also
288- possible to run the binary erosion function through a plugin:
289- ` Layers > Filter > Morphology > Binary Morphology (napari skimage) `
288+ possible to run the erosion function through a plugin:
289+ ` Layers > Filter > Morphology > Morphology (napari skimage) `
290290if you prefer.
291291
292- The binary erosion function sets a pixel to the
292+ The erosion function sets a pixel to the
293293minimum value in the neighbourhood defined by a ` footprint ` parameter.
294294We'll use scikit-image's [ ball] (
295295https://scikit-image.org/docs/stable/api/skimage.morphology.html#skimage.morphology.ball )
@@ -303,11 +303,11 @@ the `semantic_seg` layer with different integer values for the radius.
303303What radius do you need to ensure all nuclei are separate?
304304
305305``` python
306- from skimage.morphology import binary_erosion , ball
306+ from skimage.morphology import erosion , ball
307307
308308# With radius = 1
309309radius = 1
310- eroded_mask = binary_erosion (semantic_seg, footprint = ball(radius))
310+ eroded_mask = erosion (semantic_seg, footprint = ball(radius))
311311viewer.add_labels(eroded_mask, name = f ' eroded ball { radius} ' )
312312```
313313
@@ -324,7 +324,7 @@ which enables us to test multiple values of radius quickly.
324324# The for loop will repeat the indented lines of codes for each value
325325# of radius in the list (1, 5, 10).
326326for radius in 1 , 5 , 10 :
327- eroded_mask = binary_erosion (semantic_seg, footprint = ball(radius))
327+ eroded_mask = erosion (semantic_seg, footprint = ball(radius))
328328 viewer.add_labels(eroded_mask, name = f ' eroded ball { radius} ' )
329329
330330```
0 commit comments