haesleinhuepf / napari-assistant

BSD 3-Clause "New" or "Revised" License
20 stars 5 forks source link

Cannot run any operation on 3d data, error `INVALID_ARG_SIZE` #37

Open StRigaud opened 1 year ago

StRigaud commented 1 year ago

Trying to use the NA to build a workflow.

I have created a fresh conda environement with python 3.9 and I install have installed napari and pyclesperanto-prototype using pip.

conda create -y -n napari-env -c conda-forge python=3.9
conda activate napari-env
pip install napari[all]
pip install pycleseperanto-prototype

and then in napari, I have install the napari-assistant using the conda pluging menu. I then loaded a nice volume data (1 channel 3d image tiff, nothing special) and started the NA (Tools>Utilities>Assistant(na)).

Then I tried to run some operation from the NA menu which all ended in

LogicError: clSetKernelArg failed: INVALID_ARG_SIZE - when processing arg#13 (1-based): 

The error does not occur if the data is 2d though. Is the assistant only 2d?

ERRATUM: it works if I convert my data into a 2d+time using the time-slicer. Is it the way to go?

haesleinhuepf commented 1 year ago

Hey @StRigaud ,

I'd love to reproduce this error. Can you give details about the dataset (dimensionality/shape?) and then which function you call via the assistant?

Thanks! Robert

StRigaud commented 1 year ago

Here a clean description of my error:

conda create -y -n napari-env -c conda-forge python=3.9
conda activate napari-env
pip install napari[all]
pip install imageio-ffmpeg   # <- missing import for napari, fail to start if not installed
pip install pycleseperanto-prototype
napari

then, inside napari, I installed the assistant, loaded an image, and tried an operation which leads to the error. My understanding is that it is related to the kernel range when the call occur,

File <pyopencl invoker for 'range'>:7, in enqueue_knl_range(self=<pyopencl._cl.Kernel object>, queue=<pyopencl._cl.CommandQueue object>, global_size=(852, 746, 1), local_size=None, arg0=<class 'numpy.ndarray'> (1,) int32, arg1=<class 'numpy.ndarray'> (1,) int32, arg2=<class 'numpy.ndarray'> (1,) int32, arg3=<pyopencl._cl.Buffer object>, arg4=<class 'numpy.ndarray'> (1,) int32, arg5=<class 'numpy.ndarray'> (1,) int32, arg6=<class 'numpy.ndarray'> (1,) int32, arg7=<pyopencl._cl.Buffer object>, arg8=<class 'numpy.ndarray'> (1,) int32, arg9=<class 'numpy.ndarray'> (1,) int32, arg10=<class 'numpy.ndarray'> (1,) int32, arg11=<class 'numpy.ndarray'> (1,) int32, arg12=<class 'numpy.ndarray'> (1,) int64, arg13=<class 'numpy.ndarray'> (1,) int32, global_offset=None, g_times_l=None, allow_empty_ndrange=False, wait_for=None)

LogicError: clSetKernelArg failed: INVALID_ARG_SIZE - when processing arg#13 (1-based): 

I copy-past the full error log at the end.

in napari prompt:

viewer.layers[0].ndim
Out[3]: 3

viewer.layers[0].data.shape
Out[5]: (90, 746, 852)

Full error log:

2022-10-12 10:43:20.585 | INFO     | napari_assistant._gui._category_widget:call_op:174 - threshold_otsu (clesperanto)(..., )
/home/stephane/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyopencl/array.py:956: UserWarning: str.__repr__ was expected to return a string starting with 'array', got '"<class 'nu"'!
---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari_assistant/_gui/_category_widget.py:278, in _show_result(gpu_out=<class 'numpy.ndarray'> (90, 746, 852) uint8, viewer=Viewer(axes=Axes(visible=False, labels=True, col...ings._transform_active_layer at 0x7f33c4187ee0>}), name='Result of threshold_otsu (clesperanto)', layer_type='labels', op_id=139859793511472, translate=None, cmap='gray', blending=None, scale=<class 'numpy.ndarray'> (3,) float64)
    276 try:
    277     # look for an existing layer
--> 278     layer = next(x for x in viewer.layers if isinstance(x.metadata, dict) and x.metadata.get(OP_ID) == op_id)
        viewer = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 372.5, 425.5), zoom=2.2709123775342532, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(45.0, 144.17766827294827, 1085.1467382796895), scaled=True, size=1, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 90.0, 1.0), (0.0, 746.0, 1.0), (0.0, 852.0, 1.0)), current_step=(45, 373, 426), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=-1, shape=(-1, -1), enabled=False), layers=[<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=<Position.BOTTOM_RIGHT: 'bottom_right'>, font_size=10, unit=None), text_overlay=TextOverlay(visible=False, color=(0.5, 0.5, 0.5, 1.0), font_size=10, position=<TextOverlayPosition.TOP_LEFT: 'top_left'>, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4ac0>, transform_drag=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b20>, transform_final=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b80>, transform=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4be0>, allow_new_selection=True, selected_vertex=None)), help='', status='C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1 [  45  144 1085]', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_move at 0x7f33c4111700>], mouse_drag_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_drag at 0x7f33c4111040>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f33ec190dc0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': <function InteractionBoxMouseBindings.initialize_key_events.<locals>.hold_to_lock_aspect_ratio at 0x7f33c417e820>, 'Control-Shift-R': <function InteractionBoxMouseBindings._reset_active_layer_affine at 0x7f33c4187b80>, 'Control-Shift-A': <function InteractionBoxMouseBindings._transform_active_layer at 0x7f33c4187ee0>})
        OP_ID = 'op_id'
        op_id = 139859793511472
    279     # logger.debug(f"updating existing layer: {layer}, with id: {op_id}")

StopIteration: 

During handling of the above exception, another exception occurred:

LogicError                                Traceback (most recent call last)
File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari_assistant/_gui/_Assistant.py:194, in Assistant._on_item_clicked(self=<napari_pyclesperanto_assistant._gui._Assistant.Assistant object>, item=<PyQt5.QtWidgets.QListWidgetItem object>)
    193 def _on_item_clicked(self, item):
--> 194     self._activate(CATEGORIES.get(item.text()))
        self = <napari_pyclesperanto_assistant._gui._Assistant.Assistant object at 0x7f33c41aeee0>
        CATEGORIES = {'Remove noise': Category(name='Remove noise', description='Remove noise from images, e.g. by local averaging and blurring.', inputs=(typing.Annotated[napari.layers.image.image.Image, {'label': 'Image'}],), default_op='gaussian_blur (clesperanto)', default_values=[1, 1, 0], next_step_suggestions=['Remove noise', 'Remove background', 'Binarize', 'Label', 'Combine', 'Filter'], output='image', include=('filter', 'denoise'), exclude=('combine',), color_map='gray', blending=None, tool_tip='Remove noise from images, e.g. by local averaging and blurring.\n\nOperations:\n* gaussian blur (clesperanto)\n* mean box (clesperanto)\n* mean sphere (clesperanto)\n* median box (clesperanto)\n* median sphere (clesperanto)', tools_menu='Filtering / noise removal', auto_call=True), 'Remove background': Category(name='Remove background', description='Remove background intensity, e.g. caused\nby out-of-focus light or uneven illumination.', inputs=(typing.Annotated[napari.layers.image.image.Image, {'label': 'Image'}],), default_op='top_hat_box (clesperanto)', default_values=[10, 10, 0], next_step_suggestions=['Binarize', 'Label', 'Combine', 'Filter'], output='image', include=('filter', 'background removal'), exclude=('combine',), color_map='gray', blending=None, tool_tip='Remove background intensity, e.g. caused\nby out-of-focus light or uneven illumination.\n\nOperations:\n* bottom hat box (clesperanto)\n* bottom hat sphere (clesperanto)\n* divide by gaussian background (clesperanto)\n* subtract gaussian background (clesperanto)\n* top hat box (clesperanto)\n* top hat sphere (clesperanto)', tools_menu='Filtering / background removal', auto_call=True), 'Filter': Category(name='Filter', description='Filter images, e.g. to adjust gamma or detect edges.', inputs=(typing.Annotated[napari.layers.image.image.Image, {'label': 'Image'}],), default_op='gamma_correction (clesperanto)', default_values=[1, 1, 0], next_step_suggestions=['Binarize', 'Label', 'Combine'], output='image', include=('filter',), exclude=('combine', 'denoise', 'background removal', 'binary processing'), color_map='gray', blending=None, tool_tip='Filter images, e.g. to adjust gamma or detect edges.\n\nOperations:\n* absolute (clesperanto)\n* add image and scalar (clesperanto)\n* cbrt (clesperanto)\n* closing box (clesperanto)\n* closing sphere (clesperanto)\n* cubic root (clesperanto)\n* divide scalar by image (clesperanto)\n* exp (clesperanto)\n* exponential (clesperanto)\n* fabs (clesperanto)\n* fill zeros inpainting (clesperanto)\n* gamma correction (clesperanto)\n* gradient x (clesperanto)\n* gradient y (clesperanto)\n* gradient z (clesperanto)\n* laplace box (clesperanto)\n* large hessian eigenvalue (clesperanto)\n* log (clesperanto)\n* logarithm (clesperanto)\n* maximum box (clesperanto)\n* maximum image and scalar (clesperanto)\n* maximum sphere (clesperanto)\n* minimum box (clesperanto)\n* minimum image and scalar (clesperanto)\n* minimum sphere (clesperanto)\n* multiply image and scalar (clesperanto)\n* opening box (clesperanto)\n* opening sphere (clesperanto)\n* power (clesperanto)\n* reciprocal (clesperanto)\n* small hessian eigenvalue (clesperanto)\n* sobel (clesperanto)\n* sqrt (clesperanto)\n* square root (clesperanto)\n* standard deviation box (clesperanto)\n* standard deviation sphere (clesperanto)\n* subtract image from scalar (clesperanto)\n* variance box (clesperanto)\n* variance sphere (clesperanto)', tools_menu='Filtering', auto_call=True), 'Combine': Category(name='Combine', description='Combine images using pixel-wise mathematical operations.', inputs=(typing.Annotated[napari.layers.base.base.Layer, {'label': 'Image or labels'}], typing.Annotated[napari.layers.base.base.Layer, {'label': 'Image or labels'}]), default_op='add_images (clesperanto)', default_values=[1, 1], next_step_suggestions=['Binarize', 'Label'], output='image', include=('combine',), exclude=('map', 'combine labels'), color_map='gray', blending=None, tool_tip='Combine images using pixel-wise mathematical operations.\n\nOperations:\n* absolute difference (clesperanto)\n* add images (clesperanto)\n* add images weighted (clesperanto)\n* combine horizontally (clesperanto)\n* combine vertically (clesperanto)\n* concatenate stacks (clesperanto)\n* convolve (clesperanto)\n* divide images (clesperanto)\n* equal (clesperanto)\n* exclude labels with average values out of range (clesperanto)\n* exclude labels with average values within range (clesperanto)\n* exclude labels with map values equal to constant (clesperanto)\n* exclude labels with map values not equal to constant (clesperanto)\n* exclude labels with map values out of range (clesperanto)\n* exclude labels with map values within range (clesperanto)\n* greater (clesperanto)\n* greater or equal (clesperanto)\n* local cross correlation (clesperanto)\n* local threshold (clesperanto)\n* maximum (clesperanto)\n* maximum images (clesperanto)\n* minimum (clesperanto)\n* minimum images (clesperanto)\n* multiply images (clesperanto)\n* not equal (clesperanto)\n* power images (clesperanto)\n* smaller (clesperanto)\n* smaller or equal (clesperanto)\n* squared difference (clesperanto)\n* subtract images (clesperanto)', tools_menu='Image math', auto_call=True), 'Transform': Category(name='Transform', description='Apply spatial transformation to images.', inputs=(typing.Annotated[napari.layers.base.base.Layer, {'label': 'Image or labels'}],), default_op='sub_stack (clesperanto)', default_values=[0, 0, 0, 1, 1], next_step_suggestions=['Remove noise', 'Remove background', 'Binarize', 'Label', 'Combine', 'Filter'], output='image', include=('transform',), exclude=('combine',), color_map='gray', blending=None, tool_tip='Apply spatial transformation to images.\n\nOperations:\n* deskew x (clesperanto)\n* deskew y (clesperanto)\n* reduce stack (clesperanto)\n* rigid transform (clesperanto)\n* rotate (clesperanto)\n* scale (clesperanto)\n* sub stack (clesperanto)\n* translate (clesperanto)', tools_menu='Transform', auto_call=True), 'Projection': Category(name='Projection', description='Reduce dimensionality of images\nfrom three to two dimensions.', inputs=(typing.Annotated[napari.layers.base.base.Layer, {'label': 'Image or labels'}],), default_op='maximum_z_projection (clesperanto)', default_values=[1, 1, 1], next_step_suggestions=['Remove noise', 'Remove background', 'Binarize', 'Label', 'Combine', 'Filter'], output='image', include=('projection',), exclude=(), color_map='gray', blending=None, tool_tip='Reduce dimensionality of images\nfrom three to two dimensions.\n\nOperations:\n* arg maximum z projection (clesperanto)\n* arg minimum z projection (clesperanto)\n* maximum z projection (clesperanto)\n* mean z projection (clesperanto)\n* minimum z projection (clesperanto)\n* standard deviation z projection (clesperanto)\n* sum z projection (clesperanto)\n* z position of maximum z projection (clesperanto)\n* z position of minimum z projection (clesperanto)', tools_menu='Projection', auto_call=True), 'Binarize': Category(name='Binarize', description='Turn images into binary images.', inputs=(typing.Annotated[napari.layers.base.base.Layer, {'label': 'Image or labels'}],), default_op='threshold_otsu (clesperanto)', default_values=[1, 1, 0], next_step_suggestions=['Label', 'Process labels'], output='labels', include=('binarize',), exclude=('combine',), color_map='gray', blending=None, tool_tip='Turn images into binary images.\n\nOperations:\n* detect label edges (clesperanto)\n* detect maxima box (clesperanto)\n* detect minima box (clesperanto)\n* equal constant (clesperanto)\n* greater constant (clesperanto)\n* greater or equal constant (clesperanto)\n* label to mask (clesperanto)\n* not equal constant (clesperanto)\n* smaller constant (clesperanto)\n* smaller or equal constant (clesperanto)\n* threshold (clesperanto)\n* threshold otsu (clesperanto)', tools_menu='Segmentation / binarization', auto_call=True), 'Label': Category(name='Label', description='Turn images into label images by labeling objects.', inputs=(typing.Annotated[napari.layers.base.base.Layer, {'label': 'Image or labels'}],), default_op='voronoi_otsu_labeling (clesperanto)', default_values=[2, 2], next_step_suggestions=['Process labels', 'Combine labels', 'Measure labels', 'Measure labeled image', 'Compare label images', 'Measurement', 'Mesh'], output='labels', include=('label',), exclude=(), color_map='gray', blending=None, tool_tip='Turn images into label images by labeling objects.\n\nOperations:\n* Connected component labeling (clesperanto)\n* connected components labeling box (clesperanto)\n* connected components labeling diamond (clesperanto)\n* eroded otsu labeling (clesperanto)\n* gauss otsu labeling (clesperanto)\n* label (clesperanto)\n* label spots (clesperanto)\n* Voronoi-Otsu-labeling (clesperanto)\n* voronoi labeling (clesperanto)\n* voronoi otsu labeling (clesperanto)', tools_menu='Segmentation / labeling', auto_call=True), 'Process labels': Category(name='Process labels', description="Process label images to improve\nby changing their shape and/or removing\nobjects which don't fulfill certain conditions.", inputs=(typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}],), default_op='exclude_labels_on_edges (clesperanto)', default_values=[2, 100], next_step_suggestions=['Process labels', 'Combine labels', 'Measure labels', 'Measure labeled image', 'Compare label images', 'Measurement', 'Mesh'], output='labels', include=('label processing',), exclude=('combine',), color_map='gray', blending=None, tool_tip="Process label images to improve\nby changing their shape and/or removing\nobjects which don't fulfill certain conditions.\n\nOperations:\n* binary edge detection (clesperanto)\n* binary not (clesperanto)\n* close index gaps in label map (clesperanto)\n* closing labels (clesperanto)\n* detect label edges (clesperanto)\n* dilate labels (clesperanto)\n* erode connected labels (clesperanto)\n* erode labels (clesperanto)\n* exclude labels on edges (clesperanto)\n* exclude labels out of size range (clesperanto)\n* exclude labels outside size range (clesperanto)\n* exclude large labels (clesperanto)\n* exclude small labels (clesperanto)\n* extend labeling via voronoi (clesperanto)\n* extend labels with maximum radius (clesperanto)\n* logical not (clesperanto)\n* Merge touching labels (clesperanto)\n* merge touching labels (clesperanto)\n* opening labels (clesperanto)\n* reduce labels to centroids (clesperanto)\n* reduce labels to label edges (clesperanto)\n* relabel sequential (clesperanto)\n* Smooth labels (clesperanto)\n* smooth labels (clesperanto)", tools_menu='Segmentation post-processing', auto_call=True), 'Combine labels': Category(name='Combine labels', description='Process label images multiple label image\nto create a new label image.', inputs=(typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}], typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}]), default_op='combine_labels (clesperanto)', default_values=[2, 100], next_step_suggestions=['Process labels', 'Combine labels', 'Measure labels', 'Measure labeled image', 'Compare label images', 'Measurement', 'Mesh'], output='labels', include=('label processing', 'combine labels'), exclude=(), color_map='gray', blending=None, tool_tip='Process label images multiple label image\nto create a new label image.\n\nOperations:\n* binary and (clesperanto)\n* binary intersection (clesperanto)\n* binary or (clesperanto)\n* binary subtract (clesperanto)\n* binary union (clesperanto)\n* binary xor (clesperanto)\n* combine labels (clesperanto)\n* exclude labels with average values out of range (clesperanto)\n* exclude labels with average values within range (clesperanto)\n* exclude labels with map values equal to constant (clesperanto)\n* exclude labels with map values not equal to constant (clesperanto)\n* exclude labels with map values out of range (clesperanto)\n* exclude labels with map values within range (clesperanto)\n* logical and (clesperanto)\n* logical or (clesperanto)\n* logical xor (clesperanto)\n* Merge touching labels with intensity along borders within range (clesperanto)\n* merge labels with border intensity within range (clesperanto)\n* subtract labels (clesperanto)', tools_menu='Segmentation post-processing', auto_call=True), 'Measure labels': Category(name='Measure labels', description='Measure and visualize spatial\nfeatures of labeled objects.', inputs=(typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}],), default_op='pixel_count_map (clesperanto)', default_values=[1, 1], next_step_suggestions=['Label filters', 'Label neighbor filters'], output='image', include=('label measurement', 'map'), exclude=('combine',), color_map='turbo', blending=None, tool_tip='Measure and visualize spatial\nfeatures of labeled objects.\n\nOperations:\n* average distance of n closest neighbors map (clesperanto)\n* average distance of n nearest neighbors map (clesperanto)\n* extension ratio map (clesperanto)\n* label maximum extension map (clesperanto)\n* label maximum extension ratio map (clesperanto)\n* label mean extension map (clesperanto)\n* label pixel count map (clesperanto)\n* maximum extension map (clesperanto)\n* mean extension map (clesperanto)\n* pixel count map (clesperanto)\n* proximal neighbor count map (clesperanto)\n* touch portion within range neighbor count map (clesperanto)\n* touching neighbor count map (clesperanto)', tools_menu='None', auto_call=True), 'Measure labeled image': Category(name='Measure labeled image', description='Measure and visualize intensity-based\nfeatures of labeled objects.', inputs=(typing.Annotated[napari.layers.image.image.Image, {'label': 'Image'}], typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}]), default_op='mean_intensity_map (clesperanto)', default_values=[1, 1], next_step_suggestions=['Label filters', 'Label neighbor filters'], output='image', include=('combine', 'label measurement', 'map'), exclude=('label comparison',), color_map='turbo', blending=None, tool_tip='Measure and visualize intensity-based\nfeatures of labeled objects.\n\nOperations:\n* average distance to n nearest other labels map (clesperanto)\n* label maximum intensity map (clesperanto)\n* label mean intensity map (clesperanto)\n* label minimum intensity map (clesperanto)\n* label nonzero pixel count map (clesperanto)\n* label nonzero pixel count ratio map (clesperanto)\n* label overlap count map (clesperanto)\n* label standard deviation intensity map (clesperanto)\n* maximum intensity map (clesperanto)\n* mean intensity map (clesperanto)\n* minimum intensity map (clesperanto)\n* proximal other labels count map (clesperanto)\n* standard deviation intensity map (clesperanto)', tools_menu='None', auto_call=True), 'Compare label images': Category(name='Compare label images', description='Measure and visualize differences \nof labeled objects in two label images.', inputs=(typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}], typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}]), default_op='label_overlap_count_map (clesperanto)', default_values=[], next_step_suggestions=['Label filters', 'Label neighbor filters'], output='image', include=('combine', 'label measurement', 'map', 'label comparison'), exclude=(), color_map='turbo', blending=None, tool_tip='Measure and visualize differences \nof labeled objects in two label images.\n\nOperations:\n* average distance to n nearest other labels map (clesperanto)\n* label maximum intensity map (clesperanto)\n* label mean intensity map (clesperanto)\n* label minimum intensity map (clesperanto)\n* label nonzero pixel count map (clesperanto)\n* label nonzero pixel count ratio map (clesperanto)\n* label overlap count map (clesperanto)\n* label standard deviation intensity map (clesperanto)\n* maximum intensity map (clesperanto)\n* mean intensity map (clesperanto)\n* minimum intensity map (clesperanto)\n* proximal other labels count map (clesperanto)\n* standard deviation intensity map (clesperanto)', tools_menu='None', auto_call=True), 'Label neighbor filters': Category(name='Label neighbor filters', description='Process values associated with labeled objects\naccording to the neighborhood-graph of the labels.', inputs=(typing.Annotated[napari.layers.image.image.Image, {'label': 'Image'}], typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}]), default_op='mean_of_n_nearest_neighbors_map (clesperanto)', default_values=[1, 100], next_step_suggestions=['Process labels', 'Combine labels', 'Measure labels', 'Measure labeled image', 'Compare label images', 'Measurement', 'Mesh'], output='image', include=('neighbor',), exclude=(), color_map='turbo', blending=None, tool_tip='Process values associated with labeled objects\naccording to the neighborhood-graph of the labels.\n\nOperations:\n* maximum of distal neighbors map (clesperanto)\n* maximum of n most touching neighbors map (clesperanto)\n* maximum of n nearest neighbors map (clesperanto)\n* maximum of proximal neighbors map (clesperanto)\n* maximum of touch portion within range neighbors map (clesperanto)\n* maximum of touching neighbors map (clesperanto)\n* mean of distal neighbors map (clesperanto)\n* mean of n most touching neighbors map (clesperanto)\n* mean of n nearest neighbors map (clesperanto)\n* mean of proximal neighbors map (clesperanto)\n* mean of touch portion within range neighbors map (clesperanto)\n* mean of touching neighbors map (clesperanto)\n* minimum of distal neighbors map (clesperanto)\n* minimum of n most touching neighbors map (clesperanto)\n* minimum of n nearest neighbors map (clesperanto)\n* minimum of proximal neighbors map (clesperanto)\n* minimum of touch portion within range neighbors map (clesperanto)\n* minimum of touching neighbors map (clesperanto)\n* mode of distal neighbors map (clesperanto)\n* mode of n most touching neighbors map (clesperanto)\n* mode of n nearest neighbors map (clesperanto)\n* mode of proximal neighbors map (clesperanto)\n* mode of touch portion within range neighbors map (clesperanto)\n* mode of touching neighbors map (clesperanto)\n* standard deviation of distal neighbors map (clesperanto)\n* standard deviation of n most touching neighbors map (clesperanto)\n* standard deviation of n nearest neighbors map (clesperanto)\n* standard deviation of proximal neighbors map (clesperanto)\n* standard deviation of touch portion within range neighbors map (clesperanto)\n* standard deviation of touching neighbors map (clesperanto)', tools_menu='Label neighbor filters', auto_call=True), 'Label filters': Category(name='Label filters', description='Process label images depending on values in corresponding images.\nPleease use parametric maps only as input image.', inputs=(typing.Annotated[napari.layers.image.image.Image, {'label': 'Image'}], typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}]), default_op='exclude_labels_with_map_values_out_of_range (clesperanto)', default_values=[1, 100], next_step_suggestions=['Process labels', 'Combine labels', 'Measure labels', 'Measure labeled image', 'Compare label images', 'Measurement', 'Mesh'], output='labels', include=('label processing', 'combine'), exclude=('neighbor',), color_map='gray', blending=None, tool_tip='Process label images depending on values in corresponding images.\nPleease use parametric maps only as input image.\n\nOperations:\n* binary and (clesperanto)\n* binary intersection (clesperanto)\n* binary or (clesperanto)\n* binary subtract (clesperanto)\n* binary union (clesperanto)\n* binary xor (clesperanto)\n* combine labels (clesperanto)\n* exclude labels with average values out of range (clesperanto)\n* exclude labels with average values within range (clesperanto)\n* exclude labels with map values equal to constant (clesperanto)\n* exclude labels with map values not equal to constant (clesperanto)\n* exclude labels with map values out of range (clesperanto)\n* exclude labels with map values within range (clesperanto)\n* logical and (clesperanto)\n* logical or (clesperanto)\n* logical xor (clesperanto)\n* Merge touching labels with intensity along borders within range (clesperanto)\n* merge labels with border intensity within range (clesperanto)\n* subtract labels (clesperanto)', tools_menu='Segmentation post-processing', auto_call=True), 'Mesh': Category(name='Mesh', description='Draw connectivity meshes between\ncentroids of labeled objects.', inputs=(typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}],), default_op='draw_mesh_between_touching_labels (clesperanto)', default_values=[1], next_step_suggestions=[], output='image', include=('label measurement', 'mesh'), exclude=(), color_map='green', blending='additive', tool_tip='Draw connectivity meshes between\ncentroids of labeled objects.\n\nOperations:\n* draw distance mesh between n nearest labels (clesperanto)\n* draw distance mesh between proximal labels (clesperanto)\n* draw distance mesh between touching labels (clesperanto)\n* draw mesh between n closest labels (clesperanto)\n* draw mesh between proximal labels (clesperanto)\n* draw mesh between touching labels (clesperanto)\n* draw touch portion mesh between touching labels (clesperanto)\n* draw touch portion ratio mesh between touching labels (clesperanto)', tools_menu='Visualization', auto_call=True), 'Measurement': Category(name='Measurement', description='Measure features and show results in a table.', inputs=(typing.Annotated[napari.layers.image.image.Image, {'label': 'Image'}], typing.Annotated[napari.layers.labels.labels.Labels, {'label': 'Labels'}]), default_op='Regionprops (nsr)', default_values=[], next_step_suggestions=[], output='dataframe', include=(), exclude=(), color_map='gray', blending=None, tool_tip='Measure features and show results in a table.\n\nOperations:\n* Label statistics (clEsperanto)\n* Label statistics of all frames (clEsperanto)\n* Regionprops (scikit-image, nsr)\n* Regionprops of all frames (nsr)\n* Statistics of labeled pixels including neighborhood statistics (deprecated, clEsperanto)\n* Statistics of labeled pixels including neighborhood statistics of all frames (clEsperanto)', tools_menu='Measurement', auto_call=False), 'Generate code...': <bound method Assistant._code_menu of <napari_pyclesperanto_assistant._gui._Assistant.Assistant object at 0x7f33c41aeee0>>, 'Save and load workflows': <bound method Assistant._workflow_menu of <napari_pyclesperanto_assistant._gui._Assistant.Assistant object at 0x7f33c41aeee0>>, 'Undo': <bound method Assistant.undo_action of <napari_pyclesperanto_assistant._gui._Assistant.Assistant object at 0x7f33c41aeee0>>, 'Search napari hub': <bound method Assistant.search_napari_hub of <napari_pyclesperanto_assistant._gui._Assistant.Assistant object at 0x7f33c41aeee0>>, 'Search image.sc': <bound method Assistant.search_image_sc of <napari_pyclesperanto_assistant._gui._Assistant.Assistant object at 0x7f33c41aeee0>>, 'Search BIII': <bound method Assistant.search_biii of <napari_pyclesperanto_assistant._gui._Assistant.Assistant object at 0x7f33c41aeee0>>}
        item = <PyQt5.QtWidgets.QListWidgetItem object at 0x7f33d6da9af0>

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari_assistant/_gui/_Assistant.py:228, in Assistant._activate(self=<napari_pyclesperanto_assistant._gui._Assistant.Assistant object>, category=Category(name='Binarize', description='Turn imag...nu='Segmentation / binarization', auto_call=True))
    225 # call the function widget &
    226 # track the association between the layer and the gui that generated it
    227 if category.output in ['image', 'labels']:
--> 228     layer = gui()
        gui = <FunctionGui do_binarize(*, input0: napari.layers.base.base.Layer = <Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>, op_name: str = 'threshold_otsu (clesperanto)', x: float = 1.0, y: float = 1.0, z: float = 0.0, u: float = 0.0, v: float = 0.0, w: float = 0.0, a: bool = False, b: bool = False, c: bool = False, d: bool = False, e: bool = False, f: bool = False, g: bool = False, h: bool = False, i: bool = False, j: bool = False, k: str = '', l: str = '', m: str = '', o: Union[pathlib.Path, str, bytes] = PosixPath('.'), p: Union[pathlib.Path, str, bytes] = PosixPath('.'), q: Union[pathlib.Path, str, bytes] = PosixPath('.'), viewer: napari.viewer.Viewer = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 372.5, 425.5), zoom=2.2709123775342532, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(45.0, 144.17766827294827, 1085.1467382796895), scaled=True, size=1, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 90.0, 1.0), (0.0, 746.0, 1.0), (0.0, 852.0, 1.0)), current_step=(45, 373, 426), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=-1, shape=(-1, -1), enabled=False), layers=[<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=<Position.BOTTOM_RIGHT: 'bottom_right'>, font_size=10, unit=None), text_overlay=TextOverlay(visible=False, color=(0.5, 0.5, 0.5, 1.0), font_size=10, position=<TextOverlayPosition.TOP_LEFT: 'top_left'>, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4ac0>, transform_drag=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b20>, transform_final=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b80>, transform=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4be0>, allow_new_selection=True, selected_vertex=None)), help='', status='C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1 [  45  144 1085]', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_move at 0x7f33c4111700>], mouse_drag_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_drag at 0x7f33c4111040>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f33ec190dc0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': <function InteractionBoxMouseBindings.initialize_key_events.<locals>.hold_to_lock_aspect_ratio at 0x7f33c417e820>, 'Control-Shift-R': <function InteractionBoxMouseBindings._reset_active_layer_affine at 0x7f33c4187b80>, 'Control-Shift-A': <function InteractionBoxMouseBindings._transform_active_layer at 0x7f33c4187ee0>}))>
    229     if layer is not None:
    230         self._layers[layer] = (dw, gui)

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/magicgui/widgets/_function_gui.py:318, in FunctionGui.__call__(self=<FunctionGui do_binarize(*, input0: napari.layer...gs._transform_active_layer at 0x7f33c4187ee0>}))>, update_widget=False, *args=(), **kwargs={})
    316 self._tqdm_depth = 0  # reset the tqdm stack count
    317 with _function_name_pointing_to_widget(self):
--> 318     value = self._function(*bound.args, **bound.kwargs)
        self = <FunctionGui do_binarize(*, input0: napari.layers.base.base.Layer = <Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>, op_name: str = 'threshold_otsu (clesperanto)', x: float = 1.0, y: float = 1.0, z: float = 0.0, u: float = 0.0, v: float = 0.0, w: float = 0.0, a: bool = False, b: bool = False, c: bool = False, d: bool = False, e: bool = False, f: bool = False, g: bool = False, h: bool = False, i: bool = False, j: bool = False, k: str = '', l: str = '', m: str = '', o: Union[pathlib.Path, str, bytes] = PosixPath('.'), p: Union[pathlib.Path, str, bytes] = PosixPath('.'), q: Union[pathlib.Path, str, bytes] = PosixPath('.'), viewer: napari.viewer.Viewer = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 372.5, 425.5), zoom=2.2709123775342532, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(45.0, 144.17766827294827, 1085.1467382796895), scaled=True, size=1, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 90.0, 1.0), (0.0, 746.0, 1.0), (0.0, 852.0, 1.0)), current_step=(45, 373, 426), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=-1, shape=(-1, -1), enabled=False), layers=[<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=<Position.BOTTOM_RIGHT: 'bottom_right'>, font_size=10, unit=None), text_overlay=TextOverlay(visible=False, color=(0.5, 0.5, 0.5, 1.0), font_size=10, position=<TextOverlayPosition.TOP_LEFT: 'top_left'>, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4ac0>, transform_drag=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b20>, transform_final=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b80>, transform=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4be0>, allow_new_selection=True, selected_vertex=None)), help='', status='C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1 [  45  144 1085]', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_move at 0x7f33c4111700>], mouse_drag_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_drag at 0x7f33c4111040>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f33ec190dc0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': <function InteractionBoxMouseBindings.initialize_key_events.<locals>.hold_to_lock_aspect_ratio at 0x7f33c417e820>, 'Control-Shift-R': <function InteractionBoxMouseBindings._reset_active_layer_affine at 0x7f33c4187b80>, 'Control-Shift-A': <function InteractionBoxMouseBindings._transform_active_layer at 0x7f33c4187ee0>}))>
        bound = <BoundArguments (input0=<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>, op_name='threshold_otsu (clesperanto)', x=1.0, y=1.0, z=0.0, u=0.0, v=0.0, w=0.0, a=False, b=False, c=False, d=False, e=False, f=False, g=False, h=False, i=False, j=False, k='', l='', m='', o=PosixPath('.'), p=PosixPath('.'), q=PosixPath('.'), viewer=Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 372.5, 425.5), zoom=2.2709123775342532, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(45.0, 144.17766827294827, 1085.1467382796895), scaled=True, size=1, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 90.0, 1.0), (0.0, 746.0, 1.0), (0.0, 852.0, 1.0)), current_step=(45, 373, 426), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=-1, shape=(-1, -1), enabled=False), layers=[<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=<Position.BOTTOM_RIGHT: 'bottom_right'>, font_size=10, unit=None), text_overlay=TextOverlay(visible=False, color=(0.5, 0.5, 0.5, 1.0), font_size=10, position=<TextOverlayPosition.TOP_LEFT: 'top_left'>, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4ac0>, transform_drag=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b20>, transform_final=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b80>, transform=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4be0>, allow_new_selection=True, selected_vertex=None)), help='', status='C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1 [  45  144 1085]', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_move at 0x7f33c4111700>], mouse_drag_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_drag at 0x7f33c4111040>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f33ec190dc0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': <function InteractionBoxMouseBindings.initialize_key_events.<locals>.hold_to_lock_aspect_ratio at 0x7f33c417e820>, 'Control-Shift-R': <function InteractionBoxMouseBindings._reset_active_layer_affine at 0x7f33c4187b80>, 'Control-Shift-A': <function InteractionBoxMouseBindings._transform_active_layer at 0x7f33c4187ee0>}))>
        self._function = <function make_gui_for_category.<locals>.gui_function at 0x7f33a54f8430>
    320 self._call_count += 1
    321 if self._result_widget is not None:

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari_assistant/_gui/_category_widget.py:443, in make_gui_for_category.<locals>.gui_function(**kwargs={'a': False, 'b': False, 'c': False, 'd': False, 'e': False, 'f': False, 'g': False, 'h': False, 'i': False, 'j': False, ...})
    441 from napari.layers._source import layer_source
    442 with layer_source(widget=widget):
--> 443     result_layer = _show_result(
        result_layer = None
        result = <class 'numpy.ndarray'> (90, 746, 852) uint8
        viewer = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 372.5, 425.5), zoom=2.2709123775342532, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(45.0, 144.17766827294827, 1085.1467382796895), scaled=True, size=1, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 90.0, 1.0), (0.0, 746.0, 1.0), (0.0, 852.0, 1.0)), current_step=(45, 373, 426), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=-1, shape=(-1, -1), enabled=False), layers=[<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=<Position.BOTTOM_RIGHT: 'bottom_right'>, font_size=10, unit=None), text_overlay=TextOverlay(visible=False, color=(0.5, 0.5, 0.5, 1.0), font_size=10, position=<TextOverlayPosition.TOP_LEFT: 'top_left'>, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4ac0>, transform_drag=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b20>, transform_final=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b80>, transform=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4be0>, allow_new_selection=True, selected_vertex=None)), help='', status='C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1 [  45  144 1085]', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_move at 0x7f33c4111700>], mouse_drag_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_drag at 0x7f33c4111040>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f33ec190dc0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': <function InteractionBoxMouseBindings.initialize_key_events.<locals>.hold_to_lock_aspect_ratio at 0x7f33c417e820>, 'Control-Shift-R': <function InteractionBoxMouseBindings._reset_active_layer_affine at 0x7f33c4187b80>, 'Control-Shift-A': <function InteractionBoxMouseBindings._transform_active_layer at 0x7f33c4187ee0>})
        LAYER_NAME_PREFIX = 'Result of '
        category.output = 'labels'
        category = Category(name='Binarize', description='Turn images into binary images.', inputs=(typing.Annotated[napari.layers.base.base.Layer, {'label': 'Image or labels'}],), default_op='threshold_otsu (clesperanto)', default_values=[1, 1, 0], next_step_suggestions=['Label', 'Process labels'], output='labels', include=('binarize',), exclude=('combine',), color_map='gray', blending=None, tool_tip='Turn images into binary images.\n\nOperations:\n* detect label edges (clesperanto)\n* detect maxima box (clesperanto)\n* detect minima box (clesperanto)\n* equal constant (clesperanto)\n* greater constant (clesperanto)\n* greater or equal constant (clesperanto)\n* label to mask (clesperanto)\n* not equal constant (clesperanto)\n* smaller constant (clesperanto)\n* smaller or equal constant (clesperanto)\n* threshold (clesperanto)\n* threshold otsu (clesperanto)', tools_menu='Segmentation / binarization', auto_call=True)
        id(gui_function) = 139859793511472
        gui_function = <function make_gui_for_category.<locals>.gui_function at 0x7f33a54f8430>
        category.color_map = 'gray'
        category.blending = None
        inputs = [<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>]
        inputs[0] = <Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>
    444         result,
    445         viewer,
    446         name=LAYER_NAME_PREFIX + f"{op_name}",
    447         layer_type=category.output,
    448         op_id=id(gui_function),
    449         cmap=category.color_map,
    450         blending=category.blending,
    451         scale=inputs[0].scale,
    452     )
    453 if result_layer is None:
    454     return None

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari_assistant/_gui/_category_widget.py:293, in _show_result(gpu_out=<class 'numpy.ndarray'> (90, 746, 852) uint8, viewer=Viewer(axes=Axes(visible=False, labels=True, col...ings._transform_active_layer at 0x7f33c4187ee0>}), name='Result of threshold_otsu (clesperanto)', layer_type='labels', op_id=139859793511472, translate=None, cmap='gray', blending=None, scale=<class 'numpy.ndarray'> (3,) float64)
    290         kwargs["blending"] = blending
    291         kwargs['contrast_limits'] = clims
--> 293     layer = add_layer(data, **kwargs)
        data = <class 'numpy.ndarray'> (90, 746, 852) uint8
        add_layer = <bound method add_labels of Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 372.5, 425.5), zoom=2.2709123775342532, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(45.0, 144.17766827294827, 1085.1467382796895), scaled=True, size=1, style=<CursorStyle.STANDARD: 'standard'>), dims=Dims(ndim=3, ndisplay=2, last_used=0, range=((0.0, 90.0, 1.0), (0.0, 746.0, 1.0), (0.0, 852.0, 1.0)), current_step=(45, 373, 426), order=(0, 1, 2), axis_labels=('0', '1', '2')), grid=GridCanvas(stride=-1, shape=(-1, -1), enabled=False), layers=[<Image layer 'C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1' at 0x7f339f33d310>], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=<Position.BOTTOM_RIGHT: 'bottom_right'>, font_size=10, unit=None), text_overlay=TextOverlay(visible=False, color=(0.5, 0.5, 0.5, 1.0), font_size=10, position=<TextOverlayPosition.TOP_LEFT: 'top_left'>, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4ac0>, transform_drag=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b20>, transform_final=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4b80>, transform=<napari.utils.transforms.transforms.Affine object at 0x7f33d6dd4be0>, allow_new_selection=True, selected_vertex=None)), help='', status='C1-20201109_worGal4_x_white_ALH66_4_VNC-1_ 8b 2d-1 [  45  144 1085]', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_move_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_move at 0x7f33c4111700>], mouse_drag_callbacks=[<function InteractionBoxMouseBindings.initialize_mouse_events.<locals>.mouse_drag at 0x7f33c4111040>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f33ec190dc0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': <function InteractionBoxMouseBindings.initialize_key_events.<locals>.hold_to_lock_aspect_ratio at 0x7f33c417e820>, 'Control-Shift-R': <function InteractionBoxMouseBindings._reset_active_layer_affine at 0x7f33c4187b80>, 'Control-Shift-A': <function InteractionBoxMouseBindings._transform_active_layer at 0x7f33c4187ee0>})>
        kwargs = {'name': 'Result of threshold_otsu (clesperanto)', 'metadata': {'op_id': 139859793511472}}
    295 if scale is not None:
    296     if len(layer.data.shape) == len(scale):

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari/components/viewer_model.py:4, in add_labels(self=Viewer(axes=Axes(visible=False, labels=True, col...ings._transform_active_layer at 0x7f33c4187ee0>}), data=<class 'numpy.ndarray'> (90, 746, 852) uint8, num_colors=50, features=None, properties=None, color=None, seed=0.5, name='Result of threshold_otsu (clesperanto)', metadata={'op_id': 139859793511472}, scale=None, translate=None, rotate=None, shear=None, affine=None, opacity=0.7, blending='translucent', rendering='iso_categorical', depiction='volume', visible=True, multiscale=None, cache=True, plane=None, experimental_clipping_planes=None)
      1 from __future__ import annotations
      3 import inspect
----> 4 import itertools
      5 import os
      6 import warnings

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari/layers/labels/labels.py:264, in Labels.__init__(self=<Labels layer 'Result of threshold_otsu (clesperanto)'>, data=<class 'numpy.ndarray'> (90, 746, 852) uint8, num_colors=50, features=None, properties=None, color=None, seed=0.5, name='Result of threshold_otsu (clesperanto)', metadata={'op_id': 139859793511472}, scale=None, translate=None, rotate=None, shear=None, affine=None, opacity=0.7, blending='translucent', rendering='iso_categorical', depiction='volume', visible=True, multiscale=None, cache=True, plane=None, experimental_clipping_planes=None)
    261 data = self._ensure_int_labels(data)
    262 self._color_lookup_func = None
--> 264 super().__init__(
        data = <class 'numpy.ndarray'> (90, 746, 852) uint8
        self._random_colormap = Colormap(colors=<class 'numpy.ndarray'> (50, 4) float64, name='label_colormap', interpolation=<ColormapInterpolationMode.ZERO: 'zero'>, controls=<class 'numpy.ndarray'> (51,) float64)
        self = <Labels layer 'Result of threshold_otsu (clesperanto)' at 0x7f33c4371850>
        rendering = 'iso_categorical'
        depiction = 'volume'
        name = 'Result of threshold_otsu (clesperanto)'
        metadata = {'op_id': 139859793511472}
        scale = None
        translate = None
        rotate = None
        shear = None
        affine = None
        opacity = 0.7
        blending = 'translucent'
        visible = True
        multiscale = None
        cache = True
        plane = None
        experimental_clipping_planes = None
    265     data,
    266     rgb=False,
    267     colormap=self._random_colormap,
    268     contrast_limits=[0.0, 1.0],
    269     interpolation='nearest',
    270     rendering=rendering,
    271     depiction=depiction,
    272     iso_threshold=0,
    273     name=name,
    274     metadata=metadata,
    275     scale=scale,
    276     translate=translate,
    277     rotate=rotate,
    278     shear=shear,
    279     affine=affine,
    280     opacity=opacity,
    281     blending=blending,
    282     visible=visible,
    283     multiscale=multiscale,
    284     cache=cache,
    285     plane=plane,
    286     experimental_clipping_planes=experimental_clipping_planes,
    287 )
    289 self.events.add(
    290     preserve_labels=Event,
    291     properties=Event,
   (...)
    298     contour=Event,
    299 )
    301 self._feature_table = _FeatureTable.from_layer(
    302     features=features, properties=properties
    303 )

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari/layers/image/image.py:365, in _ImageBase.__init__(self=<Labels layer 'Result of threshold_otsu (clesperanto)'>, data=<class 'numpy.ndarray'> (90, 746, 852) uint8, rgb=False, colormap=Colormap(colors=<class 'numpy.ndarray'> (50, 4) ..., controls=<class 'numpy.ndarray'> (51,) float64), contrast_limits=[0.0, 1.0], gamma=1, interpolation='nearest', rendering='iso_categorical', iso_threshold=0, attenuation=0.05, name='Result of threshold_otsu (clesperanto)', metadata={'op_id': 139859793511472}, scale=None, translate=None, rotate=None, shear=None, affine=None, opacity=0.7, blending='translucent', visible=True, multiscale=False, cache=True, depiction='volume', plane=None, experimental_clipping_planes=None)
    362     self.plane = plane
    364 # Trigger generation of view slice and thumbnail
--> 365 self._update_dims()
        self = <Labels layer 'Result of threshold_otsu (clesperanto)' at 0x7f33c4371850>

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari/layers/base/base.py:674, in Layer._update_dims(self=<Labels layer 'Result of threshold_otsu (clesperanto)'>, event=None)
    671 if 'extent' in self.__dict__:
    672     del self.extent
--> 674 self.refresh()
        self = <Labels layer 'Result of threshold_otsu (clesperanto)' at 0x7f33c4371850>

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari/layers/base/base.py:1178, in Layer.refresh(self=<Labels layer 'Result of threshold_otsu (clesperanto)'>, event=None)
   1176 """Refresh all layer data based on current view slice."""
   1177 if self.visible:
-> 1178     self.set_view_slice()
        self = <Labels layer 'Result of threshold_otsu (clesperanto)' at 0x7f33c4371850>
   1179     self.events.set_data()  # refresh is called in _update_dims which means that extent cache is invalidated. Then, base on this event extent cache in layerlist is invalidated.
   1180     self._update_thumbnail()

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari/layers/base/base.py:928, in Layer.set_view_slice(self=<Labels layer 'Result of threshold_otsu (clesperanto)'>)
    926 def set_view_slice(self):
    927     with self.dask_optimized_slicing():
--> 928         self._set_view_slice()
        self = <Labels layer 'Result of threshold_otsu (clesperanto)' at 0x7f33c4371850>

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/napari/layers/image/image.py:742, in _ImageBase._set_view_slice(self=<Labels layer 'Result of threshold_otsu (clesperanto)'>)
    740 self._transforms['tile2data'].scale = np.ones(self.ndim)
    741 image_indices = self._slice_indices
--> 742 image = self.data[image_indices]
        self = <Labels layer 'Result of threshold_otsu (clesperanto)' at 0x7f33c4371850>
        image_indices = (0, slice(None, None, None), slice(None, None, None))
    744 # For single-scale we don't request a separate thumbnail_source
    745 # from the ChunkLoader because in ImageSlice.chunk_loaded we
    746 # call request.thumbnail_source() and it knows to just use the
    747 # image itself is there is no explicit thumbnail_source.
    748 thumbnail_source = None

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier0/_array_operators.py:323, in ArrayOperators.__getitem__(self=<class 'numpy.ndarray'> (90, 746, 852) uint8, index=(0, slice(None, None, None), slice(None, None, None)))
    320     eliminate_z = True
    322 from .._tier1 import range as arange
--> 323 result = arange(self, start_x=x_range.start, stop_x=x_range.stop, step_x=x_range.step,
        result = None
        self = <class 'numpy.ndarray'> (90, 746, 852) uint8
        x_range = slice(None, None, None)
        arange = <function range at 0x7f33bf290af0>
        x_range.start = None
        x_range.stop = None
        x_range.step = None
        y_range = slice(None, None, None)
        y_range.start = None
        y_range.stop = None
        y_range.step = None
        z_range = slice(0, 1, 1)
        z_range.start = 0
        z_range.stop = 1
        z_range.step = 1
    324                start_y=y_range.start, stop_y=y_range.stop, step_y=y_range.step,
    325                start_z=z_range.start, stop_z=z_range.stop, step_z=z_range.step)
    327 if (eliminate_x * 1) + (eliminate_y * 1) + (eliminate_z * 1) <= 1:
    328     from .._tier0 import create

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier0/_plugin_function.py:71, in plugin_function.<locals>.worker_function(*args=(<class 'numpy.ndarray'> (90, 746, 852) uint8,), **kwargs={'start_x': None, 'start_y': None, 'start_z': 0, 'step_x': None, 'step_y': None, 'step_z': 1, 'stop_x': None, 'stop_y': None, 'stop_z': 1})
     68         bound.arguments[key] = output_creator(*bound.args[:len(sig2.parameters)])
     70 # call the decorated function
---> 71 return function(*bound.args, **bound.kwargs)
        bound = <BoundArguments (source=<class 'numpy.ndarray'> (90, 746, 852) uint8, destination=None, start_x=None, stop_x=None, step_x=None, start_y=None, stop_y=None, step_y=None, start_z=0, stop_z=1, step_z=1)>
        function = <function range at 0x7f33bf290a60>

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier1/_range.py:81, in range(source=<class 'numpy.ndarray'> (90, 746, 852) uint8, destination=<class 'numpy.ndarray'> (1, 746, 852) uint8, start_x=0, stop_x=852, step_x=1, start_y=0, stop_y=746, step_y=1, start_z=0, stop_z=1, step_z=1)
     68         destination = create((stop_y - start_y, stop_x - start_x), source.dtype)
     70 parameters = {
     71     "dst":destination,
     72     "src":source,
   (...)
     78     "step_z": step_z,
     79 }
---> 81 execute(__file__, 'range_x.cl', 'range', destination.shape, parameters)
        parameters = {'dst': <class 'numpy.ndarray'> (1, 746, 852) uint8, 'src': <class 'numpy.ndarray'> (90, 746, 852) uint8, 'start_x': 0, 'step_x': 1, 'start_y': 0, 'step_y': 1, 'start_z': 0, 'step_z': 1}
        destination = <class 'numpy.ndarray'> (1, 746, 852) uint8
        __file__ = '/home/stephane/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier1/_range.py'
        destination.shape = (1, 746, 852)
     82 return destination

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier0/_execute.py:3, in execute(anchor='/home/stephane/Libraries/miniconda3/envs/toto/li...packages/pyclesperanto_prototype/_tier1/_range.py', opencl_kernel_filename='range_x.cl', kernel_name='range', global_size=(1, 746, 852), parameters={'dst': <class 'numpy.ndarray'> (1, 746, 852) uint8, 'src': <class 'numpy.ndarray'> (90, 746, 852) uint8, 'start_x': 0, 'start_y': 0, 'start_z': 0, 'step_x': 1, 'step_y': 1, 'step_z': 1}, prog=None, constants=None, image_size_independent_kernel_compilation=None, device=None)
      2 def execute(anchor, opencl_kernel_filename, kernel_name, global_size, parameters, prog = None, constants = None, image_size_independent_kernel_compilation : bool = None, device = None):
----> 3     return Backend.get_instance().get().execute(anchor, opencl_kernel_filename, kernel_name, global_size, parameters, prog, constants, image_size_independent_kernel_compilation, device)
        anchor = '/home/stephane/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier1/_range.py'
        opencl_kernel_filename = 'range_x.cl'
        kernel_name = 'range'
        global_size = (1, 746, 852)
        parameters = {'dst': <class 'numpy.ndarray'> (1, 746, 852) uint8, 'src': <class 'numpy.ndarray'> (90, 746, 852) uint8, 'start_x': 0, 'step_x': 1, 'start_y': 0, 'step_y': 1, 'start_z': 0, 'step_z': 1}
        prog = None
        constants = None
        image_size_independent_kernel_compilation = None
        device = None

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier0/_opencl_backend.py:41, in OpenCLBackend.execute(self=<pyclesperanto_prototype._tier0._opencl_backend.OpenCLBackend object>, anchor='/home/stephane/Libraries/miniconda3/envs/toto/li...packages/pyclesperanto_prototype/_tier1/_range.py', opencl_kernel_filename='range_x.cl', kernel_name='range', global_size=(1, 746, 852), parameters={'dst': <class 'numpy.ndarray'> (1, 746, 852) uint8, 'src': <class 'numpy.ndarray'> (90, 746, 852) uint8, 'start_x': 0, 'start_y': 0, 'start_z': 0, 'step_x': 1, 'step_y': 1, 'step_z': 1}, prog=None, constants=None, image_size_independent_kernel_compilation=None, device=None)
     40 def execute(self, anchor, opencl_kernel_filename, kernel_name, global_size, parameters, prog = None, constants = None, image_size_independent_kernel_compilation : bool = None, device = None):
---> 41     return execute(anchor, opencl_kernel_filename, kernel_name, global_size, parameters, prog, constants, image_size_independent_kernel_compilation, device)
        anchor = '/home/stephane/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier1/_range.py'
        opencl_kernel_filename = 'range_x.cl'
        kernel_name = 'range'
        global_size = (1, 746, 852)
        parameters = {'dst': <class 'numpy.ndarray'> (1, 746, 852) uint8, 'src': <class 'numpy.ndarray'> (90, 746, 852) uint8, 'start_x': 0, 'step_x': 1, 'start_y': 0, 'step_y': 1, 'start_z': 0, 'step_z': 1}
        prog = None
        constants = None
        image_size_independent_kernel_compilation = None
        device = None

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier0/_opencl_execute.py:322, in execute(anchor='/home/stephane/Libraries/miniconda3/envs/toto/li...packages/pyclesperanto_prototype/_tier1/_range.py', opencl_kernel_filename='range_x.cl', kernel_name='range', global_size=(1, 746, 852), parameters={'dst': <class 'numpy.ndarray'> (1, 746, 852) uint8, 'src': <class 'numpy.ndarray'> (90, 746, 852) uint8, 'start_x': 0, 'start_y': 0, 'start_z': 0, 'step_x': 1, 'step_y': 1, 'step_z': 1}, prog=<pyclesperanto_prototype._tier0._program.OCLProgram object>, constants=None, image_size_independent_kernel_compilation=True, device=<NVIDIA GeForce GTX 1050 Ti on Platform: NVIDIA CUDA (2 refs)>)
    312     #prog = OCLProgram.from_source("\n".join(defines))
    313 
    314     # Todo: the order of the arguments matters; fix that
    315     # print("Compilation " + opencl_kernel_filename + " took " + str((time.time() - time_stamp) * 1000) + " ms")
    316 else:
    317     warnings.warn(
    318         "The `prog` parameter of pyclesperanto_prototype.execute is deprecated since 0.11.0. It will be removed in 0.12.0.",
    319         DeprecationWarning
    320     )
--> 322 prog.run_kernel(kernel_name, tuple(global_size[::-1]), None, *arguments)
        arguments = [<class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object at 0x7f33c43639a0>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object at 0x7f33c437f400>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int64, <class 'numpy.ndarray'> (1,) int32]
        prog = <pyclesperanto_prototype._tier0._program.OCLProgram object at 0x7f339f1bf070>
        kernel_name = 'range'
        tuple(global_size[::-1]) = (852, 746, 1)
        global_size[::-1] = (852, 746, 1)
        global_size = (1, 746, 852)
    324 return prog

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyclesperanto_prototype/_tier0/_program.py:34, in OCLProgram.run_kernel(self=<pyclesperanto_prototype._tier0._program.OCLProgram object>, name='range', global_size=(852, 746, 1), local_size=None, *args=(<class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int64, <class 'numpy.ndarray'> (1,) int32), **kwargs={})
     31 if name not in self._kernel_dict:
     32     self._kernel_dict[name] = getattr(self, name)
---> 34 self._kernel_dict[name](
        name = 'range'
        self._kernel_dict = {'range': <pyopencl._cl.Kernel object at 0x7f33c4363400>}
        self._kernel_dict[name] = <pyopencl._cl.Kernel object at 0x7f33c4363400>
        self = <pyclesperanto_prototype._tier0._program.OCLProgram object at 0x7f339f1bf070>
        self._dev.queue = <pyopencl._cl.CommandQueue object at 0x7f33c436cae0>
        global_size = (852, 746, 1)
        local_size = None
        self._dev = <NVIDIA GeForce GTX 1050 Ti on Platform: NVIDIA CUDA (2 refs)>
        args = (<class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object at 0x7f33c43639a0>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object at 0x7f33c437f400>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int64, <class 'numpy.ndarray'> (1,) int32)
        kwargs = {}
     35     self._dev.queue, global_size, local_size, *args, **kwargs
     36 )
     37 if OCLProgram._wait_for_kernel_finish:
     38     self._dev.queue.finish()

File ~/Libraries/miniconda3/envs/toto/lib/python3.9/site-packages/pyopencl/__init__.py:895, in _add_functionality.<locals>.kernel_call(self=<pyopencl._cl.Kernel object>, queue=<pyopencl._cl.CommandQueue object>, global_size=(852, 746, 1), local_size=None, *args=(<class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int64, <class 'numpy.ndarray'> (1,) int32), **kwargs={})
    889 def kernel_call(self, queue, global_size, local_size, *args, **kwargs):
    890     # __call__ can't be overridden directly, so we need this
    891     # trampoline hack.
    892 
    893     # Note: This is only used for the generic __call__, before
    894     # kernel_set_scalar_arg_dtypes is called.
--> 895     return self._enqueue(self, queue, global_size, local_size, *args, **kwargs)
        self._enqueue = <function enqueue_knl_range at 0x7f33c4361820>
        self = <pyopencl._cl.Kernel object at 0x7f33c4363400>
        queue = <pyopencl._cl.CommandQueue object at 0x7f33c436cae0>
        global_size = (852, 746, 1)
        local_size = None
        args = (<class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object at 0x7f33c43639a0>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <pyopencl._cl.Buffer object at 0x7f33c437f400>, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int32, <class 'numpy.ndarray'> (1,) int64, <class 'numpy.ndarray'> (1,) int32)
        kwargs = {}

File <pyopencl invoker for 'range'>:7, in enqueue_knl_range(self=<pyopencl._cl.Kernel object>, queue=<pyopencl._cl.CommandQueue object>, global_size=(852, 746, 1), local_size=None, arg0=<class 'numpy.ndarray'> (1,) int32, arg1=<class 'numpy.ndarray'> (1,) int32, arg2=<class 'numpy.ndarray'> (1,) int32, arg3=<pyopencl._cl.Buffer object>, arg4=<class 'numpy.ndarray'> (1,) int32, arg5=<class 'numpy.ndarray'> (1,) int32, arg6=<class 'numpy.ndarray'> (1,) int32, arg7=<pyopencl._cl.Buffer object>, arg8=<class 'numpy.ndarray'> (1,) int32, arg9=<class 'numpy.ndarray'> (1,) int32, arg10=<class 'numpy.ndarray'> (1,) int32, arg11=<class 'numpy.ndarray'> (1,) int32, arg12=<class 'numpy.ndarray'> (1,) int64, arg13=<class 'numpy.ndarray'> (1,) int32, global_offset=None, g_times_l=None, allow_empty_ndrange=False, wait_for=None)

LogicError: clSetKernelArg failed: INVALID_ARG_SIZE - when processing arg#13 (1-based): 
haesleinhuepf commented 1 year ago

Hi Stephane @StRigaud ,

what GPU are you runnning on? Is it an older Mac by chance? (-:

Could you please execute this snippet from the napari terminal and post its output:

import pyclesperanto_prototype as cle
print(cle.cl_info())
print(cle.get_device())

Thanks! Robert

StRigaud commented 1 year ago

Nope, running it on my main Unix workstation at work. GPU is my good old GTX 1050. See beflow the cl_info() output log

I tried with the calibZAPWfixed sample shipped with the assistant. It also fail if I do not reshape it into a time-lapse.

I will tried on an other computer soon.


>>> import pyclesperanto_prototype as cle
>>> print(cle.cl_info())
NVIDIA CUDA
EXTENSIONS:cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_device_uuid cl_khr_pci_bus_info cl_khr_external_semaphore cl_khr_external_memory cl_khr_external_semaphore_opaque_fd cl_khr_external_memory_opaque_fd
EXTENSIONS_WITH_VERSION:[<pyopencl._cl.NameVersion object at 0x7ff9a88b72b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b74b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b74f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7530>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7570>, <pyopencl._cl.NameVersion object at 0x7ff9a88b75f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7630>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7670>, <pyopencl._cl.NameVersion object at 0x7ff9a88b76b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b75b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b76f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7730>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7770>, <pyopencl._cl.NameVersion object at 0x7ff9a88b77b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b77f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7830>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7870>, <pyopencl._cl.NameVersion object at 0x7ff9a88b78b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b78f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7930>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7970>, <pyopencl._cl.NameVersion object at 0x7ff9a88b79b0>]
HOST_TIMER_RESOLUTION:0
NAME:NVIDIA CUDA
NUMERIC_VERSION:12582912
PROFILE:FULL_PROFILE
VENDOR:NVIDIA Corporation
VERSION:OpenCL 3.0 CUDA 11.7.101

    NVIDIA GeForce GTX 1050 Ti
       ADDRESS_BITS:64
       ATOMIC_FENCE_CAPABILITIES:19
       ATOMIC_MEMORY_CAPABILITIES:17
       ATTRIBUTE_ASYNC_ENGINE_COUNT_NV:2
       AVAILABLE:1
       AVAILABLE_ASYNC_QUEUES_AMD:None
       BOARD_NAME_AMD:None
       BUILT_IN_KERNELS:
       BUILT_IN_KERNELS_WITH_VERSION:[]
       COMPILER_AVAILABLE:1
       COMPUTE_CAPABILITY_MAJOR_NV:6
       COMPUTE_CAPABILITY_MINOR_NV:1
       DEVICE_ENQUEUE_CAPABILITIES:140720308486144
       DOUBLE_FP_CONFIG:63
       DRIVER_VERSION:515.65.01
       ENDIAN_LITTLE:1
       ERROR_CORRECTION_SUPPORT:0
       EXECUTION_CAPABILITIES:1
       EXTENSIONS:cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_device_uuid cl_khr_pci_bus_info cl_khr_external_semaphore cl_khr_external_memory cl_khr_external_semaphore_opaque_fd cl_khr_external_memory_opaque_fd
       EXTENSIONS_WITH_VERSION:[<pyopencl._cl.NameVersion object at 0x7ff9a88b74b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b74f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7530>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7570>, <pyopencl._cl.NameVersion object at 0x7ff9a88b75f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7670>, <pyopencl._cl.NameVersion object at 0x7ff9a88b76b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b75b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b76f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7630>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7730>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7770>, <pyopencl._cl.NameVersion object at 0x7ff9a88b77b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b77f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7830>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7870>, <pyopencl._cl.NameVersion object at 0x7ff9a88b78b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b78f0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7930>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7970>, <pyopencl._cl.NameVersion object at 0x7ff9a88b79b0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7a70>]
       EXT_MEM_PADDING_IN_BYTES_QCOM:None
       GENERIC_ADDRESS_SPACE_SUPPORT:0
       GFXIP_MAJOR_AMD:None
       GFXIP_MINOR_AMD:None
       GLOBAL_FREE_MEMORY_AMD:None
       GLOBAL_MEM_CACHELINE_SIZE:128
       GLOBAL_MEM_CACHE_SIZE:294912
       GLOBAL_MEM_CACHE_TYPE:2
       GLOBAL_MEM_CHANNELS_AMD:None
       GLOBAL_MEM_CHANNEL_BANKS_AMD:None
       GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD:None
       GLOBAL_MEM_SIZE:4233166848
       GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE:0
       GPU_OVERLAP_NV:1
       HALF_FP_CONFIG:None
       HOST_UNIFIED_MEMORY:0
       ILS_WITH_VERSION:[]
       IL_VERSION:
       IMAGE2D_MAX_HEIGHT:32768
       IMAGE2D_MAX_WIDTH:16384
       IMAGE3D_MAX_DEPTH:16384
       IMAGE3D_MAX_HEIGHT:16384
       IMAGE3D_MAX_WIDTH:16384
       IMAGE_MAX_ARRAY_SIZE:2048
       IMAGE_MAX_BUFFER_SIZE:268435456
       IMAGE_SUPPORT:1
       INTEGRATED_MEMORY_NV:0
       KERNEL_EXEC_TIMEOUT_NV:1
       LINKER_AVAILABLE:1
       LOCAL_MEM_BANKS_AMD:None
       LOCAL_MEM_SIZE:49152
       LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD:None
       LOCAL_MEM_TYPE:1
       MAX_CLOCK_FREQUENCY:1455
       MAX_COMPUTE_UNITS:6
       MAX_CONSTANT_ARGS:9
       MAX_CONSTANT_BUFFER_SIZE:65536
       MAX_GLOBAL_VARIABLE_SIZE:0
       MAX_MEM_ALLOC_SIZE:1058291712
       MAX_NUM_SUB_GROUPS:0
       MAX_ON_DEVICE_EVENTS:0
       MAX_ON_DEVICE_QUEUES:0
       MAX_PARAMETER_SIZE:4352
       MAX_PIPE_ARGS:0
       MAX_READ_IMAGE_ARGS:256
       MAX_READ_WRITE_IMAGE_ARGS:0
       MAX_SAMPLERS:32
       MAX_WORK_GROUP_SIZE:1024
       MAX_WORK_GROUP_SIZE_AMD:None
       MAX_WORK_ITEM_DIMENSIONS:3
       MAX_WORK_ITEM_SIZES:[1024, 1024, 64]
       MAX_WRITE_IMAGE_ARGS:16
       MEM_BASE_ADDR_ALIGN:4096
       ME_VERSION_INTEL:None
       MIN_DATA_TYPE_ALIGN_SIZE:128
       NAME:NVIDIA GeForce GTX 1050 Ti
       NATIVE_VECTOR_WIDTH_CHAR:1
       NATIVE_VECTOR_WIDTH_DOUBLE:1
       NATIVE_VECTOR_WIDTH_FLOAT:1
       NATIVE_VECTOR_WIDTH_HALF:0
       NATIVE_VECTOR_WIDTH_INT:1
       NATIVE_VECTOR_WIDTH_LONG:1
       NATIVE_VECTOR_WIDTH_SHORT:1
       NON_UNIFORM_WORK_GROUP_SUPPORT:0
       NUMERIC_VERSION:12582912
       NUM_SIMULTANEOUS_INTEROPS_INTEL:None
       OPENCL_C_ALL_VERSIONS:[<pyopencl._cl.NameVersion object at 0x7ff9a88b7b70>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7bb0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7bf0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7c30>]
       OPENCL_C_FEATURES:[<pyopencl._cl.NameVersion object at 0x7ff9a88b7cb0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7cf0>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7d30>, <pyopencl._cl.NameVersion object at 0x7ff9a88b7d70>]
       OPENCL_C_VERSION:OpenCL C 1.2 
       PAGE_SIZE_QCOM:None
       PARTITION_AFFINITY_DOMAIN:[0]
       PARTITION_MAX_SUB_DEVICES:1
       PARTITION_PROPERTIES:[0]
       PARTITION_TYPE:[0]
       PCIE_ID_AMD:None
       PCI_BUS_ID_NV:101
       PCI_DOMAIN_ID_NV:0
       PCI_SLOT_ID_NV:0
       PIPE_MAX_ACTIVE_RESERVATIONS:0
       PIPE_MAX_PACKET_SIZE:0
       PIPE_SUPPORT:0
       PLATFORM:<pyopencl.Platform 'NVIDIA CUDA' at 0x562b4df37ad0>
       PREFERRED_CONSTANT_BUFFER_SIZE_AMD:None
       PREFERRED_GLOBAL_ATOMIC_ALIGNMENT:0
       PREFERRED_INTEROP_USER_SYNC:0
       PREFERRED_LOCAL_ATOMIC_ALIGNMENT:0
       PREFERRED_PLATFORM_ATOMIC_ALIGNMENT:0
       PREFERRED_VECTOR_WIDTH_CHAR:1
       PREFERRED_VECTOR_WIDTH_DOUBLE:1
       PREFERRED_VECTOR_WIDTH_FLOAT:1
       PREFERRED_VECTOR_WIDTH_HALF:0
       PREFERRED_VECTOR_WIDTH_INT:1
       PREFERRED_VECTOR_WIDTH_LONG:1
       PREFERRED_VECTOR_WIDTH_SHORT:1
       PREFERRED_WORK_GROUP_SIZE_AMD:None
       PREFERRED_WORK_GROUP_SIZE_MULTIPLE:32
       PRINTF_BUFFER_SIZE:None
       PROFILE:FULL_PROFILE
       PROFILING_TIMER_OFFSET_AMD:None
       PROFILING_TIMER_RESOLUTION:1000
       QUEUE_ON_DEVICE_MAX_SIZE:0
       QUEUE_ON_DEVICE_PREFERRED_SIZE:0
       QUEUE_ON_DEVICE_PROPERTIES:0
       QUEUE_ON_HOST_PROPERTIES:3
       QUEUE_PROPERTIES:3
       REFERENCE_COUNT:1
       REGISTERS_PER_BLOCK_NV:65536
       SIMD_INSTRUCTION_WIDTH_AMD:None
       SIMD_PER_COMPUTE_UNIT_AMD:None
       SIMD_WIDTH_AMD:None
       SIMULTANEOUS_INTEROPS_INTEL:None
       SINGLE_FP_CONFIG:191
       SPIR_VERSIONS:None
       SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS:0
       SVM_CAPABILITIES:1
       THREAD_TRACE_SUPPORTED_AMD:None
       TOPOLOGY_AMD:None
       TYPE:4
       VENDOR:NVIDIA Corporation
       VENDOR_ID:4318
       VERSION:OpenCL 3.0 CUDA
       WARP_SIZE_NV:32
       WAVEFRONT_WIDTH_AMD:None
       WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT:0

Current device: NVIDIA GeForce GTX 1050 Ti
>>>