Open mattersoflight opened 4 months ago
I was testing how fast is it to load the data chunked by CYX, like @ieivanov has done for Mantis, and ran into this bug:
TypeError Traceback (most recent call last) File /hpc/mydata/shalin.mehta/code/napari-iohub/src/napari_iohub/_widget.py:210, in MainWidget._update_layers(self=<napari_iohub._widget.MainWidget object>, layers=[([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 0., 1.]]), 'name': 'Mitochondria-deconvolved'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [0., 1., 0.]]), 'name': 'Lysosomes-deconvolved'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'Phase'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'Retardance'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'Orientation'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'Brightfield'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0. , 0. , 0. ], [0.12549, 0.67843, 0.97255]]), 'name': 'Nuclei-prediction'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0. , 0. , 0. ], [0.97255, 0.67843, 0.12549]]), 'name': 'Membrane-prediction'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 0., 1.]]), 'name': 'Mitochondria'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [0., 1., 0.]]), 'name': 'Lysosomes'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'State0'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'State1'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'State2'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'State3'}, 'image'), ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290...e=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'blending': 'additive', 'colormap': array([[0., 0., 0.], [1., 1., 1.]]), 'name': 'State4'}, 'image')]) 206 # FIXME: this is a workaround copied from 207 # https://github.com/napari/napari/blob/7ae2404f7636ce3e1e6db1386b96c69b88a52691/napari/components/viewer_model.py#L1375-L1376 # noqa 208 # constructing layer directly cause cryptic color map errors 209 add_method = getattr(self.viewer, "add_" + layer_data[2].lower()) --> 210 add_method(layer_data[0], **layer_data[1], blending="additive") layer_data = ([dask.array<getitem, shape=(1, 60, 61, 1909, 1290), dtype=float32, chunksize=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>], {'name': 'Mitochondria-deconvolved', 'colormap': array([[0., 0., 0.], [1., 0., 1.]]), 'blending': 'additive'}, 'image') add_method = <bound method ViewerModel.add_image of Viewer(camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), rollable=(True, True), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f91386e0b80>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, _keymap={})> layer_data[0] = [dask.array<getitem, shape=(1, 60, 61, 1909, 1290), dtype=float32, chunksize=(1, 1, 1, 1909, 1290), chunktype=numpy.ndarray>] layer_data[1] = {'name': 'Mitochondria-deconvolved', 'colormap': array([[0., 0., 0.], [1., 0., 1.]]), 'blending': 'additive'} 211 axis_labels = [ 212 ax.name for ax in self.dataset.axes if ax.type != "channel" 213 ] 214 if len(self.viewer.dims.axis_labels) == len(axis_labels) + 1: TypeError: napari.components.viewer_model.ViewerModel.add_image() got multiple values for keyword argument 'blending'
@mattersoflight can you provide the steps to reproduce?
I was testing how fast is it to load the data chunked by CYX, like @ieivanov has done for Mantis, and ran into this bug: