ValueError Traceback (most recent call last)
File C:\bin\python\anaconda64\envs\py10image\lib\site-packages\napari_qt\menus\plugins_menu.py:105, in PluginsMenu._add_plugin_actions.._add_toggle_widget(key=('napari-plot-profile', 'Plot Profile'), hook_type='dock')
102 return
104 if hook_type == 'dock':
--> 105 self._win.add_plugin_dock_widget(*key)
key = ('napari-plot-profile', 'Plot Profile')
self._win = <napari._qt.qt_main_window.Window object at 0x000001FD51760580>
self = <napari._qt.menus.plugins_menu.PluginsMenu object at 0x000001FD61182170>
106 else:
107 self._win._add_plugin_function_widget(*key)
File C:\bin\python\anaconda64\envs\py10image\lib\site-packages\napari_qt\qt_main_window.py:811, in Window.add_plugin_dock_widget(self=<napari._qt.qt_main_window.Window object>, plugin_name='napari-plot-profile', widget_name='Plot Profile', tabify=False)
808 wdg = wdg._magic_widget
809 return dock_widget, wdg
--> 811 wdg = _instantiate_dock_widget(
Widget = <class 'napari_plot_profile._dock_widget.PlotProfile'>
self = <napari._qt.qt_main_window.Window object at 0x000001FD51760580>
812 Widget, cast('Viewer', self._qt_viewer.viewer)
813 )
815 # Add dock widget
816 dock_kwargs.pop('name', None)
File C:\bin\python\anaconda64\envs\py10image\lib\site-packages\napari_qt\qt_main_window.py:1465, in _instantiate_dock_widget(wdg_cls=<class 'napari_plot_profile._dock_widget.PlotProfile'>, viewer=Viewer(camera=Camera(center=(0.0, 265.5, 270.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}))
1460 break
1461 # cannot look for param.kind == param.VAR_KEYWORD because
1462 # QWidget allows **kwargs but errs on unknown keyword arguments
1463
1464 # instantiate the widget
-> 1465 return wdg_cls(**kwargs)
kwargs = {'napari_viewer': Viewer(camera=Camera(center=(0.0, 265.5, 270.5), zoom=1.707950148809524, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=False, mouse_zoom=True), cursor=Cursor(position=(4.075508866833751, -126.7598387528613), scaled=True, size=1, style=<CursorStyle.CROSS: 'cross'>), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0.0, 532.0, 1.0), (0.0, 542.0, 1.0)), current_step=(265, 270), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer '20231115-172120_WT' at 0x1fd6120f9d0>, <Shapes layer 'Shapes' at 0x1fd54355780>], help='use <6> for pan/zoom, use
<2> for transform, use for add rectangles, use for add ellipses, 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='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x000001FD50C0BE20>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})}
wdg_cls = <class 'napari_plot_profile._dock_widget.PlotProfile'>
File C:\bin\python\anaconda64\envs\py10image\lib\site-packages\napari_plot_profile_dock_widget.py:121, in PlotProfile.init(self=<napari_plot_profile._dock_widget.PlotProfile object>, napari_viewer=Viewer(camera=Camera(center=(0.0, 265.5, 270.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}))
117 self._timer.stop()
119 self._timer.start()
--> 121 self.redraw()
self = <napari_plot_profile._dock_widget.PlotProfile object at 0x000001FD547FF9A0>
File C:\bin\python\anaconda64\envs\py10image\lib\site-packages\napari_plot_profile_dock_widget.py:196, in PlotProfile.redraw(self=<napari_plot_profile._dock_widget.PlotProfile object>, force_redraw=False)
193 self._data = []
194 for i, layer in enumerate(self.selected_image_layers()):
195 # plot profile
--> 196 my_profile = profile(layer, line, num_points=num_bins)
line = <class 'numpy.ndarray'> (2, 2) float64
num_bins = 100
layer = <Image layer '20231115-172120_WT' at 0x1fd6120f9d0>
197 my_profile['name'] = layer.name
198 self._data.append(my_profile)
File C:\bin\python\anaconda64\envs\py10image\lib\site-packages\napari_plot_profile_dock_widget.py:272, in profile(layer=<Image layer '20231115-172120_WT'>, line=<class 'numpy.ndarray'> (2, 2) float64, num_points=100)
270 # check if point still within image
271 position_clipped = np.maximum(position, np.zeros(position.shape))
--> 272 position_clipped = np.minimum(position_clipped, layer.data.shape - np.ones(position.shape))
position = <class 'numpy.ndarray'> (2,) float64
position_clipped = <class 'numpy.ndarray'> (2,) float64
layer = <Image layer '20231115-172120_WT' at 0x1fd6120f9d0>
np.minimum = <ufunc 'minimum'>
np = <module 'numpy' from 'C:\bin\python\anaconda64\envs\py10image\lib\site-packages\numpy\init.py'>
273 if np.array_equal(position, position_clipped):
274 position = position.astype(int)
ValueError: operands could not be broadcast together with shapes (3,) (2,)