MPI-Dortmund / tomotwin-cryoet

cryo-ET particle picking by representation and metric learning
Mozilla Public License 2.0
30 stars 6 forks source link

UMAP manifold error #85

Closed ffigueiredo85 closed 8 months ago

ffigueiredo85 commented 10 months ago

Hello!

I am using TomoTwin to analyze my tomograms and I am in the step of Estimate UMAP manifold and Generate Embedding Mask.

When I run the command for that: _tomotwin_tools.py umap -i .out/embed/tomo/tomoembeddings.temb -o out/clustering

I receive the following error:

_Traceback (most recent call last): File "/mnt/nfs/clustersw/Debian/bullseye/python/3.11.4/bin/tomotwin_tools.py", line 5, in from tomotwin.tools_main import main File "/mnt/nfs/clustersw/Debian/bullseye/python/3.11.4/lib/python3.11/site-packages/tomotwin/toolsmain.py", line 390, in from tomotwin.modules.tools.umap import UmapTool File "/mnt/nfs/clustersw/Debian/bullseye/python/3.11.4/lib/python3.11/site-packages/tomotwin/modules/tools/umap.py", line 7, in import cuml ModuleNotFoundError: No module named 'cuml'

We have updated TomoTwin to the latest version yesterday in our cluster, since this error was occurring before, but unfortunately it did not fix the issue.

Any suggestion to tackle this?

Thank you,

Francisco

thorstenwagner commented 10 months ago

Hi Francisco,

how did you setup TomoTwin? By following the installation instructions? Because it seems like that you are using python 3.11. If you follow the installation instructions you should end up with python 3.10 and cuml etc installed.

Best, Thorsten

PS: Can you try to install TomoTwin by using a fresh environment? To that, you need to first remove the old environment with mamba env remove -n tomotwin

ffigueiredo85 commented 9 months ago

Hi Thorsten,

Thank you very much for your valuable feedback. I passed this information to our IT people that manage our servers. I hope it runs. Once again,

Thank you

ffigueiredo85 commented 9 months ago

Hi Thorsten,

Our IT department was able to put TomoTwin to work with python 3.10 and cuml installed. The UMAP estimates work perfectly, however, in the next step Finding the target clusters, after identifying the clustered points when I try to change the slice of the tomogram this error appears:

Screenshot 2023-12-21 at 11 44 14

And all the highlighted regions disappear.

This is the same error Jesse reported in the other thread with the older version of TomoTwin.

‘numpy.float64’ object cannot be interpreted as an integer

Any idea what could be happening here?

Best,

Francisco

thorstenwagner commented 9 months ago

Can you show me the exact stacktrace? I can't reproduce any of those issues. The problem in jesses case is probably, that he somehow installed Napari 0.4.18 insated of 0.4.17. 18 contains breaking changes that gonna be fixed with the next napari release.

ffigueiredo85 commented 9 months ago

Here it is:

`--------------------------------------------------------------------------- TypeError Traceback (most recent call last) File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/_qt/widgets/qt_dims_slider.py:142, in QtDimSliderWidget._value_changed(self=, value=131) 137 def _value_changed(self, value): 138 """Slider changed to this new value. 139 140 We split this out as a separate function for perfmon. 141 """ --> 142 self.dims.set_current_step(self.axis, value) self.axis = 0 value = 131 self.dims = Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')) self = <napari._qt.widgets.qt_dims_slider.QtDimSliderWidget object at 0x7f3b34273640>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/components/dims.py:290, in Dims.set_current_step(self=Dims(ndim=3, ndisplay=2, last_used=0, range=((0....4), order=(0, 1, 2), axis_labels=('0', '1', '2')), axis=0, value=131) 288 full_current_step = list(self.current_step) 289 full_current_step[axis] = step --> 290 self.current_step = full_current_step full_current_step = [131, 359, 254] self.current_step = (131, 359, 254) self = Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')) 291 else: 292 full_current_step = list(self.current_step)

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/utils/events/evented_model.py:326, in EventedModel.setattr(self=Dims(ndim=3, ndisplay=2, last_used=0, range=((0....4), order=(0, 1, 2), axis_labels=('0', '1', '2')), name='current_step', value=[131, 359, 254]) 323 if areequal(after, before): 324 # no change 325 return --> 326 emitter(value=after) # emit event emitter = <napari.utils.events.event.EventEmitter object at 0x7f3beba13160> after = (131, 359, 254) 328 # emit events for any dependent computed properties as well 329 for dep, value in before_deps.items():

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/utils/events/event.py:768, in EventEmitter.call(self=, *args=(), **kwargs={'value': (131, 359, 254)}) 765 self._block_counter.update([cb]) 766 continue --> 768 self._invoke_callback(cb, event if pass_event else None) event = self = <napari.utils.events.event.EventEmitter object at 0x7f3beba13160> cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 359.5, 254.5), zoom=0.8958761467889909, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(131.0, 856.2204250238916, 754.5691151505343), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f3b3450fd30>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f3b138f93c0>, <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [131 856 755]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap..get_event at 0x7f3ab34bd510>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f3c0015a680>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})> pass_event = False 769 if event.blocked: 770 break

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/utils/events/event.py:806, in EventEmitter._invoke_callback(self=, cb=, event=None) 804 self.disconnect(cb) 805 return --> 806 _handle_exception( self = <napari.utils.events.event.EventEmitter object at 0x7f3beba13160> event = None cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 359.5, 254.5), zoom=0.8958761467889909, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(131.0, 856.2204250238916, 754.5691151505343), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f3b3450fd30>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f3b138f93c0>, <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [131 856 755]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap..get_event at 0x7f3ab34bd510>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f3c0015a680>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})> (cb, event) = (<bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 359.5, 254.5), zoom=0.8958761467889909, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(131.0, 856.2204250238916, 754.5691151505343), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f3b3450fd30>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f3b138f93c0>, <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [131 856 755]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap..get_event at 0x7f3ab34bd510>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f3c0015a680>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, None) 807 self.ignore_callback_errors, 808 self.print_callback_errors, 809 self, 810 cb_event=(cb, event), 811 )

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/utils/events/event.py:795, in EventEmitter._invoke_callback(self=, cb=, event=None) 793 cb(event) 794 else: --> 795 cb() cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 359.5, 254.5), zoom=0.8958761467889909, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(131.0, 856.2204250238916, 754.5691151505343), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f3b3450fd30>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f3b138f93c0>, <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [131 856 755]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap..get_event at 0x7f3ab34bd510>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f3c0015a680>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})> 796 except Exception as e: # noqa: BLE001 797 # dead Qt object with living python pointer. not importing Qt 798 # here... but this error is consistent across backends 799 if ( 800 isinstance(e, RuntimeError) 801 and 'C++' in str(e) 802 and str(e).endswith(('has been deleted', 'already deleted.')) 803 ):

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/components/viewer_model.py:393, in ViewerModel._update_layers(self=Viewer(camera=Camera(center=(0.0, 359.5, 254.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f3b3450... layer 'cluster_ids_in_space' at 0x7f3b1022a5c0>]) 391 layers = layers or self.layers 392 for layer in layers: --> 393 layer._slice_dims( layer = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> self.dims.order = (0, 1, 2) self = Viewer(camera=Camera(center=(0.0, 359.5, 254.5), zoom=0.8958761467889909, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(131.0, 856.2204250238916, 754.5691151505343), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f3b3450fd30>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f3b138f93c0>, <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [131 856 755]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap..get_event at 0x7f3ab34bd510>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f3c0015a680>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}) self.dims.ndisplay = 2 self.dims = Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(131, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')) 394 self.dims.point, self.dims.ndisplay, self.dims.order 395 ) 396 position = list(self.cursor.position) 397 for ind in self.dims.order[: -self.dims.ndisplay]:

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/base/base.py:1076, in Layer._slice_dims(self=<Labels layer 'cluster_ids_in_space'>, point=(131.0, 359.0, 254.0), ndisplay=2, order=(0, 1, 2)) 1073 self._slice_input = slice_input 1075 # Update the point values -> 1076 self.refresh() self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> 1077 self._reset_editable()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/base/base.py:1264, in Layer.refresh(self=<Labels layer 'cluster_ids_in_space'>, event=None) 1262 """Refresh all layer data based on current view slice.""" 1263 if self.visible: -> 1264 self.set_view_slice() self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> 1265 self.events.set_data() 1266 self._update_thumbnail()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/base/base.py:1029, in Layer.set_view_slice(self=<Labels layer 'cluster_ids_in_space'>) 1027 def set_view_slice(self): 1028 with self.dask_optimized_slicing(): -> 1029 self._set_view_slice() self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/image/image.py:834, in _ImageBase._set_view_slice(self=<Labels layer 'cluster_ids_in_space'>) 830 # Load our images, might be sync or async. 831 data = self._SliceDataClass( 832 self, image_indices, image, thumbnail_source 833 ) --> 834 self._load_slice(data) data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f3bea6fec50> self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> 835 if self._should_calc_clims: 836 self.reset_contrast_limits_range()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/image/image.py:862, in _ImageBase._load_slice(self=<Labels layer 'cluster_ids_in_space'>, data=) 854 """Load the image and maybe thumbnail source. 855 856 Parameters 857 ---------- 858 data : Slice 859 """ 860 if self._slice.load(data): 861 # The load was synchronous. --> 862 self._on_data_loaded(data, sync=True) data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f3bea6fec50> self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> 863 else: 864 # The load will be asynchronous. Signal that our self.loaded 865 # property is now false, since the load is in progress. 866 self.events.loaded()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/image/image.py:886, in _ImageBase._on_data_loaded(self=<Labels layer 'cluster_ids_in_space'>, data=, sync=True) 883 data.transpose(self._get_order()) 885 # Pass the loaded data to the slice. --> 886 if not self._slice.on_loaded(data): self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f3bea6fec50> self._slice = <napari.layers.image._image_slice.ImageSlice object at 0x7f3b138f8070> 887 # Slice rejected it, was it for the wrong indices? 888 return 890 # Notify the world.

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/image/_image_slice.py:144, in ImageSlice.on_loaded(self=, data=) 141 return False # data was not used. 143 # Display the newly loaded data. --> 144 self._set_raw_images(data.image, data.thumbnail_source) data.image = <class 'numpy.ndarray'> (720, 510) uint64 data.thumbnail_source = None self = <napari.layers.image._image_slice.ImageSlice object at 0x7f3b138f8070> data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f3bea6fec50> 145 self.loaded = True 146 return True # data was used.

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/image/_image_slice.py:102, in ImageSlice._set_raw_images(self=, image=<class 'numpy.ndarray'> (720, 510) uint64, thumbnail_source=<class 'numpy.ndarray'> (720, 510) uint64) 100 image = np.clip(image, 0, 1) 101 thumbnail_source = np.clip(thumbnail_source, 0, 1) --> 102 self.image.raw = image image = <class 'numpy.ndarray'> (720, 510) uint64 self.image = <napari.layers.image._image_view.ImageView object at 0x7f3b138f8ac0> self = <napari.layers.image._image_slice.ImageSlice object at 0x7f3b138f8070> 104 # save a computation of view image if thumbnail and image is equal 105 if thumbnail_source is image:

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/image/_image_view.py:78, in ImageView.raw(self=, raw_image=<class 'numpy.ndarray'> (720, 510) uint64) 75 self._raw = raw_image 77 # Update the view image based on this new raw image. ---> 78 self._view = self.image_converter(raw_image) raw_image = <class 'numpy.ndarray'> (720, 510) uint64 self._view = <class 'numpy.ndarray'> (1, 1) float64 self = <napari.layers.image._image_view.ImageView object at 0x7f3b138f8ac0> self.image_converter = <bound method _weakref_hide._raw_to_displayed of <napari.layers.image.image._weakref_hide object at 0x7f3b10431300>>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/image/image.py:1120, in _weakref_hide._raw_to_displayed(self=, *args=(<class 'numpy.ndarray'> (720, 510) uint64,), kwarg={}) 1119 def _raw_to_displayed(self, *args, *kwarg): -> 1120 return self.obj()._raw_to_displayed(args, kwarg) args = (<class 'numpy.ndarray'> (720, 510) uint64,) kwarg = {} self.obj = <weakref at 0x7f3b100f5ad0; to 'Labels' at 0x7f3b1022a5c0> self = <napari.layers.image.image._weakref_hide object at 0x7f3b10431300>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/labels/labels.py:999, in Labels._raw_to_displayed(self=<Labels layer 'cluster_ids_in_space'>, raw=<class 'numpy.ndarray'> (720, 510) uint64, data_slice=(slice(0, 720, None), slice(0, 510, None))) 996 if labels_to_map.size == 0: 997 return self._cached_mapped_labels[data_slice] --> 999 mapped_labels = self._map_labels_to_colors(labels_to_map) labels_to_map = <class 'numpy.ndarray'> (8108,) uint64 self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> 1001 if update_mask is not None: 1002 self._cached_mapped_labels[data_slice][update_mask] = mapped_labels

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/napari/layers/labels/labels.py:1036, in Labels._map_labels_to_colors(self=<Labels layer 'cluster_ids_in_space'>, labels_to_map=<class 'numpy.ndarray'> (8108,) uint64) 1030 none_color_index = self._label_color_index[None] 1032 if upper_bound_n_unique_labels < 65536: 1033 mapping = np.array( 1034 [ 1035 self._label_color_index.get(label_id, none_color_index) -> 1036 for label_id in range(min_label_id, max_label_id + 1) np = <module 'numpy' from '/mnt/nfs/clustersw/Debian/bullseye/napari/0.4.18-py310/lib/python3.10/site-packages/numpy/init.py'> none_color_index = 0.5 self = <Labels layer 'cluster_ids_in_space' at 0x7f3b1022a5c0> self._label_color_index = {0: 0.16666667, 2: 0.8333334, None: 0.5} min_label_id = 0 max_label_id = 2 1037 ] 1038 ) 1039 mapped_labels = mapping[labels_to_map - min_label_id] 1040 else:

TypeError: 'numpy.float64' object cannot be interpreted as an integer`

thorstenwagner commented 9 months ago

Probably same reason as with Jesse: You are using napari 0.4.18 instead of 0.4.17

Have you followed the installation instructions by using mamba? Or you try to install it natively on cluster?

I highly recommend to use mamba and integrate it in your module system. Analog to the description given for crYOLO:

https://cryolo.readthedocs.io/en/stable/other/other.html#cryolo-integration-as-environment-module

Best, Thorsten

ffigueiredo85 commented 9 months ago

Once again, thank you for your feedback. I passed the information to our IT team. The Napari 0.4.17 is installed, but unfortunately the error persists:

`--------------------------------------------------------------------------- TypeError Traceback (most recent call last) File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/_qt/widgets/qt_dims_slider.py:142, in QtDimSliderWidget._value_changed(self=, value=134) 137 def _value_changed(self, value): 138 """Slider changed to this new value. 139 140 We split this out as a separate function for perfmon. 141 """ --> 142 self.dims.set_current_step(self.axis, value) self.axis = 0 value = 134 self.dims = Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')) self = <napari._qt.widgets.qt_dims_slider.QtDimSliderWidget object at 0x7f6cce2b37f0>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/components/dims.py:290, in Dims.set_current_step(self=Dims(ndim=3, ndisplay=2, last_used=0, range=((0....4), order=(0, 1, 2), axis_labels=('0', '1', '2')), axis=0, value=134) 288 full_current_step = list(self.current_step) 289 full_current_step[axis] = step --> 290 self.current_step = full_current_step full_current_step = [134, 359, 254] self.current_step = (134, 359, 254) self = Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')) 291 else: 292 full_current_step = list(self.current_step)

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/utils/events/evented_model.py:326, in EventedModel.setattr(self=Dims(ndim=3, ndisplay=2, last_used=0, range=((0....4), order=(0, 1, 2), axis_labels=('0', '1', '2')), name='current_step', value=[134, 359, 254]) 323 if areequal(after, before): 324 # no change 325 return --> 326 emitter(value=after) # emit event emitter = <napari.utils.events.event.EventEmitter object at 0x7f6d9739fca0> after = (134, 359, 254) 328 # emit events for any dependent computed properties as well 329 for dep, value in before_deps.items():

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/utils/events/event.py:768, in EventEmitter.call(self=, *args=(), **kwargs={'value': (134, 359, 254)}) 765 self._block_counter.update([cb]) 766 continue --> 768 self._invoke_callback(cb, event if pass_event else None) event = self = <napari.utils.events.event.EventEmitter object at 0x7f6d9739fca0> cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 352.05096100824113, 286.81826215885934), zoom=1.1249673838161474, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(134.0, 731.617555322664, 665.4959388189567), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f6cce9703a0>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f6cce1cd360>, <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [134 732 665]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap_magic..get_event at 0x7f6c33d31b40>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f6d9a114f70>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})> pass_event = False 769 if event.blocked: 770 break

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/utils/events/event.py:806, in EventEmitter._invoke_callback(self=, cb=, event=None) 804 self.disconnect(cb) 805 return --> 806 _handle_exception( self = <napari.utils.events.event.EventEmitter object at 0x7f6d9739fca0> event = None cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 352.05096100824113, 286.81826215885934), zoom=1.1249673838161474, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(134.0, 731.617555322664, 665.4959388189567), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f6cce9703a0>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f6cce1cd360>, <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [134 732 665]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap_magic..get_event at 0x7f6c33d31b40>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f6d9a114f70>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})> (cb, event) = (<bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 352.05096100824113, 286.81826215885934), zoom=1.1249673838161474, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(134.0, 731.617555322664, 665.4959388189567), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f6cce9703a0>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f6cce1cd360>, <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [134 732 665]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap_magic..get_event at 0x7f6c33d31b40>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f6d9a114f70>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, None) 807 self.ignore_callback_errors, 808 self.print_callback_errors, 809 self, 810 cb_event=(cb, event), 811 )

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/utils/events/event.py:795, in EventEmitter._invoke_callback(self=, cb=, event=None) 793 cb(event) 794 else: --> 795 cb() cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 352.05096100824113, 286.81826215885934), zoom=1.1249673838161474, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(134.0, 731.617555322664, 665.4959388189567), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f6cce9703a0>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f6cce1cd360>, <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [134 732 665]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap_magic..get_event at 0x7f6c33d31b40>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f6d9a114f70>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})> 796 except Exception as e: # noqa: BLE001 797 # dead Qt object with living python pointer. not importing Qt 798 # here... but this error is consistent across backends 799 if ( 800 isinstance(e, RuntimeError) 801 and 'C++' in str(e) 802 and str(e).endswith(('has been deleted', 'already deleted.')) 803 ):

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/components/viewer_model.py:393, in ViewerModel._update_layers(self=Viewer(camera=Camera(center=(0.0, 352.0509610082...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f6cce97... layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0>]) 391 layers = layers or self.layers 392 for layer in layers: --> 393 layer._slice_dims( layer = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> self.dims.order = (0, 1, 2) self = Viewer(camera=Camera(center=(0.0, 352.05096100824113, 286.81826215885934), zoom=1.1249673838161474, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(134.0, 731.617555322664, 665.4959388189567), scaled=True, size=10, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'L2_3_002_bin8pix10' at 0x7f6cce9703a0>, <Labels layer '...x10_embeddings_label_mask.mrci' at 0x7f6cce1cd360>, <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0>], help='use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the fill bucket, use <4> for pick mode', status={'layer_base': 'L2_3_002_bin8pix10_embeddings_label_mask.mrci', 'source_type': 'plugin', 'plugin': 'Box Manager', 'coordinates': ' [134 732 665]'}, tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[], mouse_drag_callbacks=[<function load_umap_magic..get_event at 0x7f6c33d31b40>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f6d9a114f70>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}) self.dims.ndisplay = 2 self.dims = Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 250.0, 1.0), (0.0, 720.0, 1.0), (0.0, 510.0, 1.0)), current_step=(134, 359, 254), order=(0, 1, 2), axis_labels=('0', '1', '2')) 394 self.dims.point, self.dims.ndisplay, self.dims.order 395 ) 396 position = list(self.cursor.position) 397 for ind in self.dims.order[: -self.dims.ndisplay]:

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/base/base.py:1076, in Layer._slice_dims(self=<Labels layer 'cluster_ids_in_space'>, point=(134.0, 359.0, 254.0), ndisplay=2, order=(0, 1, 2)) 1073 self._slice_input = slice_input 1075 # Update the point values -> 1076 self.refresh() self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> 1077 self._reset_editable()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/base/base.py:1264, in Layer.refresh(self=<Labels layer 'cluster_ids_in_space'>, event=None) 1262 """Refresh all layer data based on current view slice.""" 1263 if self.visible: -> 1264 self.set_view_slice() self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> 1265 self.events.set_data() 1266 self._update_thumbnail()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/base/base.py:1029, in Layer.set_view_slice(self=<Labels layer 'cluster_ids_in_space'>) 1027 def set_view_slice(self): 1028 with self.dask_optimized_slicing(): -> 1029 self._set_view_slice() self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/image/image.py:834, in _ImageBase._set_view_slice(self=<Labels layer 'cluster_ids_in_space'>) 830 # Load our images, might be sync or async. 831 data = self._SliceDataClass( 832 self, image_indices, image, thumbnail_source 833 ) --> 834 self._load_slice(data) data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f6d875df7c0> self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> 835 if self._should_calc_clims: 836 self.reset_contrast_limits_range()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/image/image.py:862, in _ImageBase._load_slice(self=<Labels layer 'cluster_ids_in_space'>, data=) 854 """Load the image and maybe thumbnail source. 855 856 Parameters 857 ---------- 858 data : Slice 859 """ 860 if self._slice.load(data): 861 # The load was synchronous. --> 862 self._on_data_loaded(data, sync=True) data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f6d875df7c0> self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> 863 else: 864 # The load will be asynchronous. Signal that our self.loaded 865 # property is now false, since the load is in progress. 866 self.events.loaded()

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/image/image.py:886, in _ImageBase._on_data_loaded(self=<Labels layer 'cluster_ids_in_space'>, data=, sync=True) 883 data.transpose(self._get_order()) 885 # Pass the loaded data to the slice. --> 886 if not self._slice.on_loaded(data): self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f6d875df7c0> self._slice = <napari.layers.image._image_slice.ImageSlice object at 0x7f6ccc0b6bf0> 887 # Slice rejected it, was it for the wrong indices? 888 return 890 # Notify the world.

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/image/_image_slice.py:144, in ImageSlice.on_loaded(self=, data=) 141 return False # data was not used. 143 # Display the newly loaded data. --> 144 self._set_raw_images(data.image, data.thumbnail_source) data.image = <class 'numpy.ndarray'> (720, 510) uint64 data.thumbnail_source = None self = <napari.layers.image._image_slice.ImageSlice object at 0x7f6ccc0b6bf0> data = <napari.layers.image._image_slice_data.ImageSliceData object at 0x7f6d875df7c0> 145 self.loaded = True 146 return True # data was used.

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/image/_image_slice.py:102, in ImageSlice._set_raw_images(self=, image=<class 'numpy.ndarray'> (720, 510) uint64, thumbnail_source=<class 'numpy.ndarray'> (720, 510) uint64) 100 image = np.clip(image, 0, 1) 101 thumbnail_source = np.clip(thumbnail_source, 0, 1) --> 102 self.image.raw = image image = <class 'numpy.ndarray'> (720, 510) uint64 self.image = <napari.layers.image._image_view.ImageView object at 0x7f6ccc0b6c20> self = <napari.layers.image._image_slice.ImageSlice object at 0x7f6ccc0b6bf0> 104 # save a computation of view image if thumbnail and image is equal 105 if thumbnail_source is image:

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/image/_image_view.py:78, in ImageView.raw(self=, raw_image=<class 'numpy.ndarray'> (720, 510) uint64) 75 self._raw = raw_image 77 # Update the view image based on this new raw image. ---> 78 self._view = self.image_converter(raw_image) raw_image = <class 'numpy.ndarray'> (720, 510) uint64 self._view = <class 'numpy.ndarray'> (1, 1) float64 self = <napari.layers.image._image_view.ImageView object at 0x7f6ccc0b6c20> self.image_converter = <bound method _weakref_hide._raw_to_displayed of <napari.layers.image.image._weakref_hide object at 0x7f6ccc0b7a90>>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/image/image.py:1120, in _weakref_hide._raw_to_displayed(self=, *args=(<class 'numpy.ndarray'> (720, 510) uint64,), kwarg={}) 1119 def _raw_to_displayed(self, *args, *kwarg): -> 1120 return self.obj()._raw_to_displayed(args, kwarg) args = (<class 'numpy.ndarray'> (720, 510) uint64,) kwarg = {} self.obj = <weakref at 0x7f6c6c4f5170; to 'Labels' at 0x7f6c0ef5fcd0> self = <napari.layers.image.image._weakref_hide object at 0x7f6ccc0b7a90>

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/labels/labels.py:999, in Labels._raw_to_displayed(self=<Labels layer 'cluster_ids_in_space'>, raw=<class 'numpy.ndarray'> (720, 510) uint64, data_slice=(slice(0, 720, None), slice(0, 510, None))) 996 if labels_to_map.size == 0: 997 return self._cached_mapped_labels[data_slice] --> 999 mapped_labels = self._map_labels_to_colors(labels_to_map) labels_to_map = <class 'numpy.ndarray'> (10828,) uint64 self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> 1001 if update_mask is not None: 1002 self._cached_mapped_labels[data_slice][update_mask] = mapped_labels

File /mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/napari/layers/labels/labels.py:1036, in Labels._map_labels_to_colors(self=<Labels layer 'cluster_ids_in_space'>, labels_to_map=<class 'numpy.ndarray'> (10828,) uint64) 1030 none_color_index = self._label_color_index[None] 1032 if upper_bound_n_unique_labels < 65536: 1033 mapping = np.array( 1034 [ 1035 self._label_color_index.get(label_id, none_color_index) -> 1036 for label_id in range(min_label_id, max_label_id + 1) np = <module 'numpy' from '/mnt/nfs/clustersw/Debian/bullseye/napari/0.4.17-py310/lib/python3.10/site-packages/numpy/init.py'> none_color_index = 0.5 self = <Labels layer 'cluster_ids_in_space' at 0x7f6c0ef5fcd0> self._label_color_index = {0: 0.16666667, 2: 0.8333334, None: 0.5} min_label_id = 0 max_label_id = 2 1037 ] 1038 ) 1039 mapped_labels = mapping[labels_to_map - min_label_id] 1040 else:

TypeError: 'numpy.float64' object cannot be interpreted as an integer`

I will try to answer if they used mamba for the installation.

thorstenwagner commented 9 months ago

mamba or conda should not play any role - its just how fast the the things get installed. But still, it does not look like a conda environment. Could you ask them to send your the list of packages they installed with:

conda activate napari-tomotwin
conda list >> packages_conda.txt
pip freeze >> packages_pip.txt

I would like to see both txt files.

I also tried to reproduce it. I open a umap, I select a region with a the lasso tool and then I use the slider. This way you get the error, right? For me everything works.

I'm sorry that you have so much trouble getting this running.

ffigueiredo85 commented 9 months ago

Thank you!

Here are the files: packages_conda.txt packages_pip.txt

That is correct about we get the error.

Thank you for the help!

thorstenwagner commented 9 months ago

Looking at your your conda file it tells me that you installed both napari and tomotwin in the same environment. Please tell your IT to follow the instructions and install it separately. Thanks :-)

ffigueiredo85 commented 9 months ago

Thank you! I passed that information. Hoping that it could be fixed easily.

A instruction to test if the installation of napari-tomotwin was successfully would be to follow the tutorial and not obtain any errors?

thorstenwagner commented 9 months ago

You should not see any errors, yes. Of course I can't promise that there are no bugs ^^

thorstenwagner commented 8 months ago

As there is no activity anymore, I hope this is solved. Otherwise reopen.