Skip to content

Commit 87f4e36

Browse files
authored
Merge pull request #123 from HealthBioscienceIDEAS/km/remove-binary-erosion
remove use of deprecated binary_erosion
2 parents 3b6d5c5 + a5a4928 commit 87f4e36

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

episodes/instance-segmentation-and-measurements.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,15 @@ apparent size of the nuclei by eroding the image.
281281
Image erosion is an image filter, similar to those we covered in the
282282
[filters and thresholding](filters-and-thresholding.md) lesson.
283283
We 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
287287
the 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)`
290290
if you prefer.
291291

292-
The binary erosion function sets a pixel to the
292+
The erosion function sets a pixel to the
293293
minimum value in the neighbourhood defined by a `footprint` parameter.
294294
We'll use scikit-image's [ball](
295295
https://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.
303303
What 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
309309
radius = 1
310-
eroded_mask = binary_erosion(semantic_seg, footprint = ball(radius))
310+
eroded_mask = erosion(semantic_seg, footprint = ball(radius))
311311
viewer.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).
326326
for 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
```

episodes/quality-control-and-manual-segmentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ the details of what's happening here - we'll look at some of these concepts in
192192
later episodes.
193193

194194
```python
195-
from skimage.morphology import binary_erosion, ball
195+
from skimage.morphology import erosion, ball
196196
from skimage.segmentation import expand_labels
197197
from skimage.measure import label
198198

199-
eroded = binary_erosion(semantic_seg, footprint=ball(10))
199+
eroded = erosion(semantic_seg, footprint=ball(10))
200200
instance_seg = label(eroded)
201201
instance_seg = expand_labels(instance_seg, distance=10)
202202

0 commit comments

Comments
 (0)