Dear,
I installed your plugin on a freshly napari installed and got an error while opening an ims file:
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\_qt\qt_viewer.py in _open_files_dialog(self=)
636
637 if (filenames != []) and (filenames is not None):
--> 638 self.viewer.open(filenames)
self.viewer.open = ), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=, font_size=10.0, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float64, font_size=10.0, position=, text=''), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Control-Shift-C': >})>
filenames = ['C:/Users/u0094799/Desktop/2021_11_Imaging_workshop_Leuven/Napari/large_2d/CD1.1_15_1001_2.ims']
639 update_open_history(filenames[0])
640
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\components\viewer_model.py in open(self=Viewer(axes=Axes(visible=False, labels=True, col..._viewer.QtViewer object at 0x000002645B31D8B0>>}), path=['C:/Users/u0094799/Desktop/2021_11_Imaging_workshop_Leuven/Napari/large_2d/CD1.1_15_1001_2.ims'], stack=False, plugin=None, layer_type=None, **kwargs={})
883 for _path in pbr:
884 added.extend(
--> 885 self._add_layers_with_plugins(
self._add_layers_with_plugins = ), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=, font_size=10.0, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float64, font_size=10.0, position=, text=''), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Control-Shift-C': >})>
_path = 'C:/Users/u0094799/Desktop/2021_11_Imaging_workshop_Leuven/Napari/large_2d/CD1.1_15_1001_2.ims'
kwargs = {}
plugin = None
layer_type = None
886 _path, kwargs, plugin=plugin, layer_type=layer_type
887 )
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\components\viewer_model.py in _add_layers_with_plugins(self=Viewer(axes=Axes(visible=False, labels=True, col..._viewer.QtViewer object at 0x000002645B31D8B0>>}), path_or_paths='C:/Users/u0094799/Desktop/2021_11_Imaging_workshop_Leuven/Napari/large_2d/CD1.1_15_1001_2.ims', kwargs={}, plugin='napari-imaris-loader', layer_type=None)
956 # actually add the layer
957 with layer_source(path=filename, reader_plugin=plugin):
--> 958 added.extend(self._add_layer_from_data(*_data))
added.extend =
self._add_layer_from_data = ), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=, font_size=10.0, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float64, font_size=10.0, position=, text=''), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Control-Shift-C': >})>
_data = ([dask.array, dask.array, dask.array, dask.array], {'scale': [(2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311)], 'contrast_limits': [0, 65534], 'name': ['Channel 0', 'Channel 1', 'Channel 2', 'Channel 3', 'Channel 4', 'Channel 5'], 'metadata': {'fileName': 'C:\\Users\\u0094799\\Desktop\\2021_11_Imaging_workshop_Leuven\\Napari\\large_2d\\CD1.1_15_1001_2.ims', 'resolutionLevels': 4}, 'channel_axis': 0, 'multiscale': True}, 'image')
959 return added
960
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\components\viewer_model.py in _add_layer_from_data(self=Viewer(axes=Axes(visible=False, labels=True, col..._viewer.QtViewer object at 0x000002645B31D8B0>>}), data=[dask.array, dask.array, dask.array, dask.array], meta={'channel_axis': 0, 'contrast_limits': [0, 65534], 'metadata': {'fileName': r'C:\Users\u0094799\Desktop\2021_11_Imaging_workshop_Leuven\Napari\large_2d\CD1.1_15_1001_2.ims', 'resolutionLevels': 4}, 'multiscale': True, 'name': ['Channel 0', 'Channel 1', 'Channel 2', 'Channel 3', 'Channel 4', 'Channel 5'], 'scale': [(2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311)]}, layer_type='image')
1030 try:
1031 add_method = getattr(self, 'add_' + layer_type)
-> 1032 layer = add_method(data, **(meta or {}))
layer = undefined
add_method = ), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=, font_size=10.0, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float64, font_size=10.0, position=, text=''), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Control-Shift-C': >})>
data = [dask.array, dask.array, dask.array, dask.array]
meta = {'scale': [(2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311)], 'contrast_limits': [0, 65534], 'name': ['Channel 0', 'Channel 1', 'Channel 2', 'Channel 3', 'Channel 4', 'Channel 5'], 'metadata': {'fileName': 'C:\\Users\\u0094799\\Desktop\\2021_11_Imaging_workshop_Leuven\\Napari\\large_2d\\CD1.1_15_1001_2.ims', 'resolutionLevels': 4}, 'channel_axis': 0, 'multiscale': True}
1033 except TypeError as exc:
1034 if 'unexpected keyword argument' not in str(exc):
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\components\viewer_model.py in add_image(self=Viewer(axes=Axes(visible=False, labels=True, col..._viewer.QtViewer object at 0x000002645B31D8B0>>}), data=[dask.array, dask.array, dask.array, dask.array], channel_axis=0, rgb=None, colormap=None, contrast_limits=[0, 65534], gamma=1, interpolation='nearest', rendering='mip', iso_threshold=0.5, attenuation=0.05, name=['Channel 0', 'Channel 1', 'Channel 2', 'Channel 3', 'Channel 4', 'Channel 5'], metadata={'fileName': r'C:\Users\u0094799\Desktop\2021_11_Imaging_workshop_Leuven\Napari\large_2d\CD1.1_15_1001_2.ims', 'resolutionLevels': 4}, scale=[(2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311), (2.0, 0.311, 0.311)], translate=None, rotate=None, shear=None, affine=None, opacity=1, blending=None, visible=True, multiscale=True, cache=True, experimental_slicing_plane=None, experimental_clipping_planes=None)
723 layer_list = list()
724 for image, i_kwargs, _ in layerdata_list:
--> 725 layer = Image(image, **i_kwargs)
layer = undefined
global Image =
image = [dask.array, dask.array, dask.array, dask.array]
i_kwargs = {'rgb': None, 'colormap': 'cyan', 'contrast_limits': [0, 65534], 'gamma': 1, 'interpolation': 'nearest', 'rendering': 'mip', 'iso_threshold': 0.5, 'attenuation': 0.05, 'name': 'Channel 0', 'metadata': {'fileName': 'C:\\Users\\u0094799\\Desktop\\2021_11_Imaging_workshop_Leuven\\Napari\\large_2d\\CD1.1_15_1001_2.ims', 'resolutionLevels': 4}, 'scale': (2.0, 0.311, 0.311), 'translate': None, 'rotate': None, 'shear': None, 'affine': None, 'opacity': 1, 'blending': 'additive', 'visible': True, 'multiscale': True, 'cache': True, 'experimental_slicing_plane': None, 'experimental_clipping_planes': None}
726 self.layers.append(layer)
727 layer_list.append(layer)
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\image\image.py in __init__(self=, data=[dask.array, dask.array, dask.array, dask.array], rgb=False, colormap='cyan', contrast_limits=[0, 65534], gamma=1, interpolation='nearest', rendering='mip', iso_threshold=0.5, attenuation=0.05, name='Channel 0', metadata={'fileName': r'C:\Users\u0094799\Desktop\2021_11_Imaging_workshop_Leuven\Napari\large_2d\CD1.1_15_1001_2.ims', 'resolutionLevels': 4}, scale=(2.0, 0.311, 0.311), translate=None, rotate=None, shear=None, affine=None, opacity=1, blending='additive', visible=True, multiscale=True, cache=True, experimental_slicing_plane=None, experimental_clipping_planes=None)
330
331 # Trigger generation of view slice and thumbnail
--> 332 self._update_dims()
self._update_dims = >
333
334 def _new_empty_slice(self):
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\base\base.py in _update_dims(self=, event=None)
639 self._ndim = ndim
640
--> 641 self.refresh()
self.refresh = >
642
643 @property
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\base\base.py in refresh(self=, event=None)
1107 """Refresh all layer data based on current view slice."""
1108 if self.visible:
-> 1109 self.set_view_slice()
self.set_view_slice = >
1110 self.events.set_data()
1111 self._update_thumbnail()
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\base\base.py in set_view_slice(self=)
900 def set_view_slice(self):
901 with self.dask_optimized_slicing():
--> 902 self._set_view_slice()
self._set_view_slice = >
903
904 @abstractmethod
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\image\image.py in _set_view_slice(self=)
698 self, image_indices, image, thumbnail_source
699 )
--> 700 self._load_slice(data)
self._load_slice = >
data =
701 if self._keep_autoscale or self._should_calc_clims:
702 self.reset_contrast_limits()
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\image\image.py in _load_slice(self=, data=)
719 data : Slice
720 """
--> 721 if self._slice.load(data):
self._slice.load = >
data =
722 # The load was synchronous.
723 self._on_data_loaded(data, sync=True)
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\image\_image_slice.py in load(self=, data=)
121 """
122 self.loaded = False # False until self._on_loaded is calls
--> 123 return self.loader.load(data)
self.loader.load = >
data =
124
125 def on_loaded(self, data: ImageSliceData) -> bool:
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\image\_image_loader.py in load(self=, data=)
20 True if load happened synchronously.
21 """
---> 22 data.load_sync()
data.load_sync = >
23 return True
24
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\napari\layers\image\_image_slice_data.py in load_sync(self=)
42 def load_sync(self) -> None:
43 """Call asarray on our images to load them."""
---> 44 self.image = np.asarray(self.image)
self.image = dask.array
global np.asarray =
45
46 if self.thumbnail_source is not None:
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\numpy\core\_asarray.py in asarray(a=dask.array, dtype=None, order=None, like=None)
100 return _asarray_with_like(a, dtype=dtype, order=order, like=like)
101
--> 102 return array(a, dtype, copy=False, order=order)
global array =
a = dask.array
dtype = None
global copy = undefined
order = None
103
104
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\array\core.py in __array__(self=dask.array, dtype=None, **kwargs={})
1532
1533 def __array__(self, dtype=None, **kwargs):
-> 1534 x = self.compute()
x = undefined
self.compute = >
1535 if dtype and x.dtype != dtype:
1536 x = x.astype(dtype)
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\base.py in compute(self=dask.array, **kwargs={})
286 dask.base.compute
287 """
--> 288 (result,) = compute(self, traverse=False, **kwargs)
result = undefined
global compute =
self = dask.array
global traverse = undefined
kwargs = {}
289 return result
290
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\base.py in compute(*args=(dask.array,), **kwargs={})
568 postcomputes.append(x.__dask_postcompute__())
569
--> 570 results = schedule(dsk, keys, **kwargs)
results = undefined
schedule =
dsk = HighLevelGraph with 4 layers.
0. array-c9ee8e0f4c10c6c23a4318f58ff94a46
1. getitem-46da6b34d2c45791bf57c6feccb4b594
2. getitem-a90b1329abe5c89d9750e440ffd497ad
3. getitem-74d10f3e832693dd7fd89549fa7725a5
keys = [[[('getitem-74d10f3e832693dd7fd89549fa7725a5', 0, 0)]]]
kwargs = {}
571 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
572
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\threaded.py in get(dsk=HighLevelGraph with 4 layers.
3. getitem-74d10f3e832693dd7fd89549fa7725a5
, result=[[[('getitem-74d10f3e832693dd7fd89549fa7725a5', 0, 0)]]], cache=None, num_workers=None, pool=, **kwargs={})
77 pool = MultiprocessingPoolExecutor(pool)
78
---> 79 results = get_async(
results = undefined
global get_async =
pool.submit = >
pool._max_workers = 16
dsk = HighLevelGraph with 4 layers.
0. array-c9ee8e0f4c10c6c23a4318f58ff94a46
1. getitem-46da6b34d2c45791bf57c6feccb4b594
2. getitem-a90b1329abe5c89d9750e440ffd497ad
3. getitem-74d10f3e832693dd7fd89549fa7725a5
result = [[[('getitem-74d10f3e832693dd7fd89549fa7725a5', 0, 0)]]]
cache = None
global get_id = undefined
global _thread_get_id =
global pack_exception =
kwargs = {}
80 pool.submit,
81 pool._max_workers,
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\local.py in get_async(submit=>, num_workers=16, dsk={('getitem-74d10f3e832693dd7fd89549fa7725a5', 0, 0): (, ('getitem-a90b1329abe5c89d9750e440ffd497ad', 0, 0, 0), (0, slice(None, None, None), slice(None, None, None))), ('getitem-a90b1329abe5c89d9750e440ffd497ad', 0, 0, 0): (, ('getitem-46da6b34d2c45791bf57c6feccb4b594', 0, 0, 0, 0), (0, slice(None, None, None), slice(None, None, None), slice(None, None, None))), ('getitem-46da6b34d2c45791bf57c6feccb4b594', 0, 0, 0, 0): (, ('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0), (0, slice(None, None, None), slice(None, None, None), slice(None, None, None), slice(None, None, None))), ('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0): (, 'array-original-c9ee8e0f4c10c6c23a4318f58ff94a46', (slice(0, 1, None), slice(0, 1, None), slice(0, 21, None), slice(0, 128, None), slice(0, 128, None))), 'array-original-c9ee8e0f4c10c6c23a4318f58ff94a46': }, result=[[[('getitem-74d10f3e832693dd7fd89549fa7725a5', 0, 0)]]], cache=None, get_id=, rerun_exceptions_locally=False, pack_exception=, raise_exception=, callbacks=set(), dumps=, loads=, chunksize=1, **kwargs={})
505 _execute_task(task, data) # Re-execute locally
506 else:
--> 507 raise_exception(exc, tb)
raise_exception =
exc = IndexError('too many indices for array: array is 3-dimensional, but 5 were indexed')
tb =
508 res, worker_id = loads(res_info)
509 state["cache"][key] = res
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\local.py in reraise(exc=IndexError('too many indices for array: array is 3-dimensional, but 5 were indexed'), tb=)
313 if exc.__traceback__ is not tb:
314 raise exc.with_traceback(tb)
--> 315 raise exc
exc = IndexError('too many indices for array: array is 3-dimensional, but 5 were indexed')
316
317
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\local.py in execute_task(key=('getitem-46da6b34d2c45791bf57c6feccb4b594', 0, 0, 0, 0), task_info=((, ('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0), (0, slice(None, None, None), slice(None, None, None), slice(None, None, None), slice(None, None, None))), {('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0): (21, 128, 128) uint16}), dumps=, loads=, get_id=, pack_exception=)
218 try:
219 task, data = loads(task_info)
--> 220 result = _execute_task(task, data)
result = (IndexError('too many indices for array: array is 3-dimensional, but 5 were indexed'), )
global _execute_task =
task = (, ('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0), (0, slice(None, None, None), slice(None, None, None), slice(None, None, None), slice(None, None, None)))
data = {('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0): (21, 128, 128) uint16}
221 id = get_id()
222 result = dumps((result, id))
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\core.py in _execute_task(arg=(, ('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0), (0, slice(None, None, None), slice(None, None, None), slice(None, None,
None), slice(None, None, None))), cache={('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0): (21, 128, 128) uint16}, dsk=None)
117 # temporaries by their reference count and can execute certain
118 # operations in-place.
--> 119 return func(*(_execute_task(a, cache) for a in args))
func =
global _execute_task =
global a = undefined
cache = {('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0): (21, 128, 128) uint16}
args = (('array-c9ee8e0f4c10c6c23a4318f58ff94a46', 0, 0, 0, 0, 0), (0, slice(None, None, None), slice(None, None, None), slice(None, None, None), slice(None, None, None)))
120 elif not ishashable(arg):
121 return arg
c:\gbw_myprograms\anaconda3\envs\napari-env2\lib\site-packages\dask\array\chunk.py in getitem(obj= (21, 128, 128) uint16, index=(0, slice(None, None, None), slice(None, None, None), slice(None, None, None), slice(None, None, None)))
420
421 """
--> 422 result = obj[index]
result = undefined
obj = (21, 128, 128) uint16
index = (0, slice(None, None, None), slice(None, None, None), slice(None, None, None), slice(None, None, None))
423 try:
424 if not result.flags.owndata and obj.size >= 2 * result.size:
IndexError: too many indices for array: array is 3-dimensional, but 5 were indexed
Best,
Benjamin