Skip to content

Commit

Permalink
fix inverted EDT processing for dask arrays / non-binary masks (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoOkuma authored Oct 7, 2024
1 parent 3e29caa commit 23e41db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ultrack/imgproc/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def inverted_edt(
ArrayLike
Inverted and normalized EDT.
"""
mask = np.asarray(mask)
if axis is None:
dist = edt.edt(mask, anisotropy=voxel_size)
else:
Expand All @@ -216,7 +217,7 @@ def inverted_edt(
)
dist = dist / dist.max()
dist = 1.0 - dist
dist[~mask] = 1
dist[mask == 0] = 1
return dist


Expand Down

0 comments on commit 23e41db

Please sign in to comment.