Skip to content

Commit

Permalink
Merge pull request #25 from jonasutz/main
Browse files Browse the repository at this point in the history
Cast binary images to uint8 before masking to suppress deprecation warning
  • Loading branch information
haesleinhuepf authored Sep 4, 2024
2 parents 83ae92f + aaf2cb7 commit a9be379
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def touching_objects_labeling(binary_image:"napari.types.LabelsData") -> "napari
useImageSpacing=False)

ws = sitk.MorphologicalWatershed(distance_map, markWatershedLine=False, level=1)
labels = sitk.Mask(ws, sitk.Cast(binary_image, ws.GetPixelID()))
labels = sitk.Mask(ws, sitk.Cast(binary_image, sitk.sitkUInt8))
return labels


Expand Down Expand Up @@ -543,7 +543,7 @@ def watershed_otsu_labeling(image:"napari.types.ImageData", spot_sigma: float =
binary_otsu = sitk.OtsuThreshold(blurred_outline, 0, 1)

ws = sitk.MorphologicalWatershed(blurred_spots, markWatershedLine=False, level=watershed_level)
labels = sitk.Mask(ws, sitk.Cast(binary_otsu, ws.GetPixelID()))
labels = sitk.Mask(ws, sitk.Cast(binary_otsu, sitk.sitkUInt8))

return labels

Expand Down

0 comments on commit a9be379

Please sign in to comment.