guiwitz / napari-sediment

https://guiwitz.github.io/napari-sediment/napari_sediment.html
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

napari-sediment on Debian 12 #42

Open andreigithubK opened 3 months ago

andreigithubK commented 3 months ago

After starting napari, selecting napari -sediment plugin, Selecting ENVI file: Select hdr file image is loaded. After clicking on load RGB the following error is generated


TypeError Traceback (most recent call last) File ~/anaconda3/envs/napari/lib/python3.12/site-packages/napari_sediment/widgets/rgb_widget.py:114, in RGBWidget._on_click_RGB(self=, event=False) 112 self.rgb_ch, self.rgb_names = self.imagechannels.get_indices_of_bands(self.rgb) 113 rgb_cube = self.imagechannels.get_image_cube(self.rgb_ch, roi=roi) --> 114 self.add_rgb_cube_to_viewer(rgb_cube) rgb_cube = <class 'numpy.ndarray'> (3, 8086, 1024) uint16 self = <napari_sediment.widgets.rgb_widget.RGBWidget object at 0x7fd8981784d0>

File ~/anaconda3/envs/napari/lib/python3.12/site-packages/napari_sediment/widgets/rgb_widget.py:172, in RGBWidget.add_rgb_cube_to_viewer(self=, rgb_cube=<class 'numpy.ndarray'> (3, 8086, 1024) uint16) 170 self.viewer.layers[cmap].data = rgb_cube[ind] 171 if self.translate: --> 172 self.viewer.layers[cmap].translate = (self.row_bounds[0], self.col_bounds[0]) cmap = 'red' self.viewer = Viewer(camera=Camera(center=(0.0, 4042.5, 511.5), zoom=0.11086739021487593, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 7776.6910043695825, 3339.2026641274811), scaled=True, size=1, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 3.0, 1.0), (0.0, 8087.0, 1.0), (0.0, 1025.0, 1.0)), current_step=(0, 4042, 511), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'red' at 0x7fd7e6957110>, <Image layer 'green' at 0x7fd7e6983740>, <Image layer 'blue' at 0x7fd7e69a1f10>, <Image layer 'imcube' at 0x7fd7e41773b0>, <Shapes layer 'main-roi' at 0x7fd7e69791c0>, <Shapes layer 'rois_0' at 0x7fd7e6979460>], help='use <2> for transform, use for add rectangles, use for add ellipses, use for add lines, use for add path, use

for add polygons, use for add polygons lasso, use <4> for select vertices, use <5> for select shapes, use <2> for insert vertex, use <1> for remove vertex', status={'layer_base': 'main-roi', 'source_type': '', 'plugin': '', 'coordinates': ' [7777 3339]: [, ]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[<bound method SedimentWidget._shift_move_callback of <napari_sediment.sediment_widget.SedimentWidget object at 0x7fd8bc216e70>>], mouse_drag_callbacks=[], mouse_double_click_callbacks=[<bound method SedimentWidget._add_analysis_roi of <napari_sediment.sediment_widget.SedimentWidget object at 0x7fd8bc216e70>>], mouse_wheel_callbacks=[<function dims_scroll at 0x7fd939453ba0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'A': <bound method ConvPaintWidget.hide_annotation of <napari_sediment.classifier.ConvPaintSpectralWidget object at 0x7fd7e6a47410>>, 'R': <bound method ConvPaintWidget.hide_prediction of <napari_sediment.classifier.ConvPaintSpectralWidget object at 0x7fd7e6a47410>>}) self = <napari_sediment.widgets.rgb_widget.RGBWidget object at 0x7fd8981784d0> self.row_bounds = None self.col_bounds = None 174 update_contrast_on_layer(self.viewer.layers[cmap])

TypeError: 'NoneType' object is not subscriptable

guiwitz commented 3 months ago

Thanks for the report. This should now be fixed via 2277502