Skip to content

Commit

Permalink
do not ignore types when making binary im arr
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczmarj authored Jul 9, 2024
1 parent 385ce1f commit c8354f5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions wsinfer/patchlib/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ def segment_tissue(
_, im_arr = cv.threshold(
im_arr, thresh=binary_threshold, maxval=255, type=cv.THRESH_BINARY
)

# Convert to boolean dtype. This helps with static type analysis because at this
# point, im_arr is a uint8 array.
im_arr_binary: npt.NDArray[np.bool_] = im_arr > 0 # type: ignore
im_arr_binary: npt.NDArray[np.bool_] = im_arr > 0

# Closing. This removes small holes. It might not be entirely necessary because
# we have hole removal below.
Expand Down

0 comments on commit c8354f5

Please sign in to comment.