AllenCell / napari-allencell-segmenter

A plugin that enables image segmentation provided by Allen Institute for Cell Science
BSD 3-Clause "New" or "Revised" License
16 stars 6 forks source link

Watershed Function Import Bug Napari Allen Cell Segmenter #140

Closed DarthRevan109 closed 2 years ago

DarthRevan109 commented 2 years ago

Description

Hello, I am using the Allen Cell Segmenter via napari, and am unable to use the workflows which incorporate the Watershed function (from scikit-image). This results in a failure of the workflow to segment the given image in the workflow and batch applications. I get the following error message when running these work flows:

****A napari user on stackflow had the following comment:

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+.

Error message

ImportError: cannot import name 'watershed' from 'skimage.morphology' (C:\Users\Murryadmin\anaconda3\envs\napari-env\lib\site-packages\skimage\morphologyinit.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

Expected Behavior

Watershed function should be imported and final segmented image should be produced.

Reproduction

Please list the exact steps we can take to reproduce this bug.

  1. Run workflow which has watershed function (e.g., the cetn2 pipeline).
  2. "Run all" command/button on pipeline
  3. Error occurs

Environment