mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-20 12:40:31 +08:00
Create new expected_warnings helper and some cleanup
Add new helper function for expected warnings during test Indentation cleanups and avoid skipping doctests if possible.
This commit is contained in:
@@ -416,12 +416,12 @@ def label(input, neighbors=None, background=None, return_num=False,
|
||||
[0 1 0]
|
||||
[0 0 1]]
|
||||
>>> from skimage.measure import label
|
||||
>>> print(label(x, neighbors=4)) # doctest: +SKIP
|
||||
>>> print(label(x, connectivity=1))
|
||||
[[0 1 1]
|
||||
[2 3 1]
|
||||
[2 2 4]]
|
||||
|
||||
>>> print(label(x, neighbors=8)) # doctest: +SKIP
|
||||
>>> print(label(x, connectivity=2))
|
||||
[[0 1 1]
|
||||
[1 0 1]
|
||||
[1 1 0]]
|
||||
|
||||
@@ -473,13 +473,13 @@ def regionprops(label_image, intensity_image=None, cache=True):
|
||||
>>> from skimage import data, util
|
||||
>>> from skimage.morphology import label
|
||||
>>> img = util.img_as_ubyte(data.coins()) > 110
|
||||
>>> label_img = label(img) # doctest: +SKIP
|
||||
>>> props = regionprops(label_img) # doctest: +SKIP
|
||||
>>> label_img = label(img, connectivity=img.ndim)
|
||||
>>> props = regionprops(label_img)
|
||||
>>> # centroid of first labeled object
|
||||
>>> props[0].centroid # doctest: +SKIP
|
||||
>>> props[0].centroid
|
||||
(22.729879860483141, 81.912285234465827)
|
||||
>>> # centroid of first labeled object
|
||||
>>> props[0]['centroid'] # doctest: +SKIP
|
||||
>>> props[0]['centroid']
|
||||
(22.729879860483141, 81.912285234465827)
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user