Skip to content

Commit

Permalink
Merge pull request #744 from thewtex/dask-image-pandas
Browse files Browse the repository at this point in the history
COMP: Only depend on dask-image in pyodide
  • Loading branch information
thewtex committed Apr 17, 2024
2 parents 1018156 + 9b30e37 commit 5d83f28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ furo
imjoy_jupyterlab_extension
jupyterlite[all]==0.1.0b17
myst-parser[linkify]
pydata-sphinx-theme
sphinx-autodoc2>=0.5.0
sphinx-copybutton
sphinx-design
Expand Down
14 changes: 11 additions & 3 deletions itkwidgets/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .vtk import HAVE_VTK, vtk_image_to_ngff_image, vtk_polydata_to_vtkjs
from .xarray import HAVE_XARRAY, HAVE_MULTISCALE_SPATIAL_IMAGE, xarray_data_array_to_numpy, xarray_data_set_to_numpy
from ..render_types import RenderType
from .environment import ENVIRONMENT, Env

def _spatial_image_scale_factors(spatial_image, min_length):
sizes = dict(spatial_image.sizes)
Expand Down Expand Up @@ -44,10 +45,17 @@ def _get_viewer_image(image, label=False):
return image.store

min_length = 64
if label:
method = Methods.DASK_IMAGE_NEAREST
# ITKWASM methods are currently only async in pyodide
if ENVIRONMENT is Env.JUPYTERLITE:
if label:
method = Methods.DASK_IMAGE_NEAREST
else:
method = Methods.DASK_IMAGE_GAUSSIAN
else:
method = Methods.DASK_IMAGE_GAUSSIAN
if label:
method = Methods.ITKWASM_LABEL_IMAGE
else:
method = Methods.ITKWASM_GAUSSIAN

store, chunk_store = _make_multiscale_store()

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ dependencies = [
"imjoy-rpc >= 0.5.42",
"imjoy-utils >= 0.1.2",
"importlib_metadata",
"ngff-zarr[dask-image] >= 0.4.3",
"ngff-zarr >= 0.8.1; sys_platform != \"emscripten\"",
"ngff-zarr[dask-image] >= 0.8.1; sys_platform == \"emscripten\"",
"numcodecs",
"zarr",
]
Expand Down

0 comments on commit 5d83f28

Please sign in to comment.