@@ -47,10 +47,11 @@ def _get_viewer_image(image, label=False):
47
47
method = Methods .DASK_IMAGE_NEAREST
48
48
else :
49
49
method = Methods .DASK_IMAGE_GAUSSIAN
50
-
50
+
51
51
store , chunk_store = _make_multiscale_store ()
52
52
53
53
if HAVE_MULTISCALE_SPATIAL_IMAGE :
54
+ from multiscale_spatial_image import MultiscaleSpatialImage
54
55
if isinstance (image , MultiscaleSpatialImage ):
55
56
image .to_zarr (store , compute = True )
56
57
return store
@@ -59,6 +60,7 @@ def _get_viewer_image(image, label=False):
59
60
ngff_image = itk_image_to_ngff_image (image )
60
61
multiscales = to_multiscales (ngff_image , method = method )
61
62
to_ngff_zarr (store , multiscales , chunk_store = chunk_store )
63
+ return store
62
64
63
65
if HAVE_ITK :
64
66
import itk
@@ -152,10 +154,6 @@ def _detect_render_type(data, input_type) -> RenderType:
152
154
return RenderType .IMAGE
153
155
elif isinstance (data , itkwasm .PointSet ):
154
156
return RenderType .POINT_SET
155
- elif HAVE_MULTISCALE_SPATIAL_IMAGE :
156
- from multiscale_spatial_image import MultiscaleSpatialImage
157
- if isinstance (data , MultiscaleSpatialImage ):
158
- return RenderType .IMAGE
159
157
elif isinstance (data , (zarr .Array , zarr .Group )):
160
158
# For now assume zarr.Group is an image
161
159
# In the future, once NGFF supports point sets fully
@@ -175,6 +173,10 @@ def _detect_render_type(data, input_type) -> RenderType:
175
173
import itk
176
174
if isinstance (data , itk .Image ):
177
175
return RenderType .IMAGE
176
+ if HAVE_MULTISCALE_SPATIAL_IMAGE :
177
+ from multiscale_spatial_image import MultiscaleSpatialImage
178
+ if isinstance (data , MultiscaleSpatialImage ):
179
+ return RenderType .IMAGE
178
180
if HAVE_VTK :
179
181
import vtk
180
182
if isinstance (data , vtk .vtkImageData ):
@@ -200,8 +202,8 @@ def _detect_render_type(data, input_type) -> RenderType:
200
202
return RenderType .POINT_SET
201
203
else :
202
204
return RenderType .IMAGE
203
- if isinstance (data , xr .Dataset ):
204
- if input_type == 'point_sets' :
205
- return RenderType .POINT_SET
206
- else :
207
- return RenderType .IMAGE
205
+ if isinstance (data , xr .Dataset ):
206
+ if input_type == 'point_sets' :
207
+ return RenderType .POINT_SET
208
+ else :
209
+ return RenderType .IMAGE
0 commit comments