Skip to content

Commit 5d83f28

Browse files
authored
Merge pull request #744 from thewtex/dask-image-pandas
COMP: Only depend on dask-image in pyodide
2 parents 1018156 + 9b30e37 commit 5d83f28

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ furo
22
imjoy_jupyterlab_extension
33
jupyterlite[all]==0.1.0b17
44
myst-parser[linkify]
5-
pydata-sphinx-theme
65
sphinx-autodoc2>=0.5.0
76
sphinx-copybutton
87
sphinx-design

itkwidgets/integrations/__init__.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .vtk import HAVE_VTK, vtk_image_to_ngff_image, vtk_polydata_to_vtkjs
1111
from .xarray import HAVE_XARRAY, HAVE_MULTISCALE_SPATIAL_IMAGE, xarray_data_array_to_numpy, xarray_data_set_to_numpy
1212
from ..render_types import RenderType
13+
from .environment import ENVIRONMENT, Env
1314

1415
def _spatial_image_scale_factors(spatial_image, min_length):
1516
sizes = dict(spatial_image.sizes)
@@ -44,10 +45,17 @@ def _get_viewer_image(image, label=False):
4445
return image.store
4546

4647
min_length = 64
47-
if label:
48-
method = Methods.DASK_IMAGE_NEAREST
48+
# ITKWASM methods are currently only async in pyodide
49+
if ENVIRONMENT is Env.JUPYTERLITE:
50+
if label:
51+
method = Methods.DASK_IMAGE_NEAREST
52+
else:
53+
method = Methods.DASK_IMAGE_GAUSSIAN
4954
else:
50-
method = Methods.DASK_IMAGE_GAUSSIAN
55+
if label:
56+
method = Methods.ITKWASM_LABEL_IMAGE
57+
else:
58+
method = Methods.ITKWASM_GAUSSIAN
5159

5260
store, chunk_store = _make_multiscale_store()
5361

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ dependencies = [
4040
"imjoy-rpc >= 0.5.42",
4141
"imjoy-utils >= 0.1.2",
4242
"importlib_metadata",
43-
"ngff-zarr[dask-image] >= 0.4.3",
43+
"ngff-zarr >= 0.8.1; sys_platform != \"emscripten\"",
44+
"ngff-zarr[dask-image] >= 0.8.1; sys_platform == \"emscripten\"",
4445
"numcodecs",
4546
"zarr",
4647
]

0 commit comments

Comments
 (0)