Skip to content

Commit

Permalink
Simplify setting meta attribute for ndmorph functions (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
GenevieveBuckley committed Apr 22, 2021
1 parent adcb217 commit ec39605
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions dask_image/ndmorph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def binary_closing(image,
result = binary_erosion(
result, structure=structure, iterations=iterations, origin=origin
)
result._meta = image._meta.astype(bool)

return result

Expand All @@ -63,7 +62,6 @@ def binary_dilation(image,
brute_force=brute_force,
border_value=border_value
)
result._meta = image._meta.astype(bool)

return result

Expand All @@ -88,7 +86,6 @@ def binary_erosion(image,
brute_force=brute_force,
border_value=border_value
)
result._meta = image._meta.astype(bool)

return result

Expand All @@ -111,6 +108,5 @@ def binary_opening(image,
result = binary_dilation(
result, structure=structure, iterations=iterations, origin=origin
)
result._meta = image._meta.astype(bool)

return result
1 change: 1 addition & 0 deletions dask_image/ndmorph/_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ def _binary_op(func,
**kwargs
)
result = dask.array.where(mask, iter_result, result)
result._meta = image._meta.astype(bool)

return result

0 comments on commit ec39605

Please sign in to comment.