Closed elevans closed 10 months ago
Attention: 11 lines
in your changes are missing coverage. Please review.
Comparison is base (
c003095
) 77.68% compared to head (f205852
) 77.81%.
Files | Patch % | Lines |
---|---|---|
src/imagej/convert.py | 64.00% | 9 Missing :warning: |
src/imagej/_java.py | 86.66% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@elevans I created an environment with the indicated yml and pip install -e .
but when I run the notebook the first cell fails with a dependency not found exception on StarDist.
When I paste the exact same line into a python interpreter launched in the exact same environment that started jupyter, it works no problem. :(
I noticed that I'm using python 3.8 locally and I think you used 3.11 when you made the ipynb
. Is 3.11 necessary?
@hinerm I ran using the following environment.yml
:
name: cellstar
channels:
- conda-forge
- defaults
dependencies:
- python=="3.8"
- pyimagej
- jupyterlab
- openjdk=11
- pip
- pip:
- tensorflow==2.12.*
- stardist
- cellpose
and things seem to work fine. How did you install python 3.8?
How did you install python 3.8?
@gselzer it's just my system python, since it wasn't specified in the environment.yml
specified.
I'm trying with your method of specification. Interestingly I earlier tried >=3.11
and environment creation failed with dependency conflicts.
Further interestingly, python=="3.8"
syntax does not work on my computer. I have to remove the double quotes.
Edit: specifying python==3.8
did not work either. Still can't find StarDist
@hinerm I updated the jupyter notebook to use %pip install package
magic per Curtis's recommendation. Would you mind giving the notebook a try again?
@hinerm I updated the jupyter notebook to use
%pip install package
magic per Curtis's recommendation. Would you mind giving the notebook a try again?
Do I need to do anything different to install it? I assume if you use %pip install
you need to trust
the notebook?
I assume the environment file should now be:
name: cellstar
channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- pyimagej
- jupyterlab
- openjdk=11
- pip
Anyway, this doesn't work for me. It looks like the stardist
has a dependency on csbdeep
that is not compatible with tensorflow 2.12
.
What version of stardist
and csbdeep
are you getting from pip
? I think we want to pin a stardist
version compatible with the chosen tensorflow
on all OS's. Welcome to dependency hell.
@hinerm After many hours of painful testing across Linux, Windows and macOS I found the following shell commands to be the most successful for installing cellpose
and stardist
:
%%capture
!mamba install -y -c conda-forge tensorflow stardist
!pip install cellpose
I tested this on the following systems:
While testing on macOS, I got bit by the lack of interactive
mode support. Bummer! So I included a check for macOS and switch to headless
mode with some explanations.
I'm going to do something spicy :hot_pepper: and merge this branch. The actual new code in convert.py
and the accompanying tests have already been reviewed since @hinerm had troubles with the Jupyter notebook. Letting mamba/conda resolve the tensorflow
and stardist
side of things while installing cellpose
from PyPi and not conda-forge was the trick. Since then all I've done is update the cellpose jupyter notebook with shell commands, compatibility with macOS and extra notes.
Awesome, thanks @elevans!
This PR adds support to convert index images (Python or Java) into either of the following:
net.imagej.roi.DefaultROITree
populated with ImgLib2 ROIs.RoiManager
populated with legacy converted ROIs (e.g.net.imagej.legacy.convert.roi.polygon2d.Polygon2DWrapper
).Because there's no real way to tell the difference between an index image and some other type of image data (without making assumptions) I feel its best to not register these index image functions with
scyjava/pyimagej
converters.Included in this PR:
To run the use case you'll need Cellpose and StarDist. This
environment.yml
file should do the trick:Don't forget to pull this branch and
pip install -e .
before running the notebook!