Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import watershed function from scikit-image?

Using Napari Image Analysis GUI to run the Allen Cell Segmenter (no response in Napari github or Allen Cell Forum, thought I'd try here) and getting the following error when I attempt to run the watershed for cutting function:

ImportError: cannot import name 'watershed' from 'skimage.morphology' (C:\Users\Murryadmin\anaconda3\envs\napari-env\lib\site-packages\skimage\morphology_init_.py)

c:\users\murryadmin\anaconda3\envs\napari-env\lib\site-packages\aicssegmentation\core\utils.py(449)watershed_wrapper() -> from skimage.morphology import watershed, dilation, ball

Anyone have any potential fixes for this?

Thanks

like image 502
DarthRevan Avatar asked Oct 23 '25 16:10

DarthRevan


1 Answers

watershed was moved from skimage.morphology to skimage.segmentation in version 0.17. There was a pointer from morphology to the new function in segmentation in 0.17 and 0.18, but it was removed in 0.19. The Allen Cell Segmenter needs to be updated to match the more modern scikit-image version, so I would raise an issue in their GitHub repository if I were you.

Downgrading to scikit-image 0.18 could fix the Allen Cell Segmenter itself, but unfortunately napari requires 0.19+.

like image 170
Juan Avatar answered Oct 26 '25 04:10

Juan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!