Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

napari sediment on Debian 12 selecting RGB contrast #41

Open
andreigithubK opened this issue May 22, 2024 · 3 comments
Open

napari sediment on Debian 12 selecting RGB contrast #41

andreigithubK opened this issue May 22, 2024 · 3 comments

Comments

@andreigithubK
Copy link

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=<napari_sediment.widgets.rgb_widget.RGBWidget object>, 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
Copy link
Owner

guiwitz commented May 22, 2024

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

@guiwitz
Copy link
Owner

guiwitz commented May 22, 2024

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
Copy link
Author

andreigithubK commented May 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants