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 selecting RGB contrast #41

Open andreigithubK opened 3 months ago

andreigithubK commented 3 months ago

Got the following error when selected RGB contast aftel loading ENVI SPECIM FX10 image

AttributeError Traceback (most recent call last) File ~/anaconda3/envs/napari/lib/python3.12/site-packages/napari_sediment/widgets/rgb_widget.py:125, in RGBWidget._on_change_contrast(self=, event=(0.5392857142857143, 1.0)) 123 rgb = ['red', 'green', 'blue'] 124 for c in rgb: --> 125 contrast_limits = np.percentile(self.viewer.layers[c].data.compute(), (2,98)) c = 'red' np.percentile = <function percentile at 0x7f0f1bcc32b0> np = <module 'numpy' from '/home/avk/anaconda3/envs/napari/lib/python3.12/site-packages/numpy/init.py'> self.viewer = Viewer(camera=Camera(center=(0.0, 3501.686060713947, 862.0392279756215), zoom=0.08225935302600906, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(5993.804173535593, 4043.0, 6180.583727625777), 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, 8086.0, 1.0), (0.0, 1024.0, 1.0)), current_step=(0, 4043, 511), order=(1, 0, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'red' at 0x7f0db5b94d10>, <Image layer 'green' at 0x7f0eff4a1070>, <Image layer 'blue' at 0x7f0db5a440e0>, <Image layer 'imcube' at 0x7f0ed8e424e0>], help='use <2> for transform', status='Ready', 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 0x7f0e737de450>>], mouse_drag_callbacks=[], mouse_double_click_callbacks=[<bound method SedimentWidget._add_analysis_roi of <napari_sediment.sediment_widget.SedimentWidget object at 0x7f0e737de450>>], mouse_wheel_callbacks=[<function dims_scroll at 0x7f0f07747ce0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'A': <bound method ConvPaintWidget.hide_annotation of <napari_sediment.classifier.ConvPaintSpectralWidget object at 0x7f0db5cb95b0>>, 'R': <bound method ConvPaintWidget.hide_prediction of <napari_sediment.classifier.ConvPaintSpectralWidget object at 0x7f0db5cb95b0>>}) self = <napari_sediment.widgets.rgb_widget.RGBWidget object at 0x7f0e67004e60> 126 contrast_range = contrast_limits[1] - contrast_limits[0] 127 newlimits = contrast_limits.copy()

AttributeError: 'numpy.ndarray' object has no attribute 'compute'

guiwitz commented 3 months ago

Thanks, this was indeed a bug. Should be fixed via 5655932

guiwitz commented 3 months ago

Just FYI, currently things are very much in flux in this project. In particular we made some major changes that are not yet reflected in the documentation. We should soon have a "standard" workflow that we don't modify too much anymore, by which point we'll update the docs.

andreigithubK commented 3 months ago

Thank you. Great experience so far. Andrei

On Wed, May 22, 2024, 5:16 PM Guillaume Witz @.***> wrote:

Just FYI, currently things are very much in flux in this project. In particular we made some major changes that are not yet reflected in the documentation. We should soon have a "standard" workflow that we don't modify too much anymore, by which point we'll update the docs.

— Reply to this email directly, view it on GitHub https://github.com/guiwitz/napari-sediment/issues/41#issuecomment-2125760172, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIVJ6KZUP3FI7IEL745OI4LZDUDJLAVCNFSM6AAAAABIEGMCGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRVG43DAMJXGI . You are receiving this because you authored the thread.Message ID: @.***>