diff --git a/CMakeLists.txt b/CMakeLists.txt index 360eba89..af0cdfbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ option(BUILD_SHARED_LIBS OFF) ## CLIc dependency -set(CLIC_REPO_TAG 0.11.1) # branch name for dev +set(CLIC_REPO_TAG 0.12.0) # branch name for dev set(CLIC_REPO_URL https://github.com/clEsperanto/CLIc.git) set(BUILD_OPENCL_BACKEND ON CACHE BOOL "Build with OCL if FOUND" FORCE) set(BUILD_CUDA_BACKEND ON CACHE BOOL "Build with CUDA if FOUND" FORCE) diff --git a/demos/interoperability/napari.ipynb b/demos/interoperability/napari.ipynb new file mode 100644 index 00000000..25f9df81 --- /dev/null +++ b/demos/interoperability/napari.ipynb @@ -0,0 +1,113 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "id": "50b170a2-98e2-4257-b5af-9e008a264a83", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(OpenCL) NVIDIA GeForce RTX 4090 (OpenCL 3.0 CUDA)\n", + "\tVendor: NVIDIA Corporation\n", + "\tDriver Version: 535.183.06\n", + "\tDevice Type: GPU\n", + "\tCompute Units: 128\n", + "\tGlobal Memory Size: 24217 MB\n", + "\tMaximum Object Size: 6054 MB\n", + "\tMax Clock Frequency: 2625 MHz\n", + "\tImage Support: Yes" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import napari\n", + "import numpy as np\n", + "import pyclesperanto as cle\n", + "\n", + "cle.select_device()" + ] + }, + { + "cell_type": "markdown", + "id": "8df18a3d", + "metadata": {}, + "source": [ + "Let's create a numpy array and process it with clesperanto, in this case applying a gaussian blur" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "c5791a69", + "metadata": {}, + "outputs": [], + "source": [ + "img = np.random.randint(0, 65536, size=(1024, 1024), dtype=np.uint16)\n", + "blurred = cle.gaussian_blur(img, sigma_x=2, sigma_y=2)" + ] + }, + { + "cell_type": "markdown", + "id": "4517fe36", + "metadata": {}, + "source": [ + "Both images can be seemlessly added to the napari viewer. In the background, clesperanto implement internal method which allows napari to call back the data from the GPU to the host memory. Hence for napari, a clesperanto array is treated the same as a numpy array." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "14da0d8e", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "viewer = napari.Viewer()\n", + "viewer.add_image(img)\n", + "viewer.add_image(blurred)\n", + "napari.run()" + ] + }, + { + "cell_type": "markdown", + "id": "d9006505", + "metadata": {}, + "source": [ + "Enjoy!" + ] + }, + { + "cell_type": "markdown", + "id": "5fd04493", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.19" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/pyclesperanto/_tier1.py b/pyclesperanto/_tier1.py index 2c5bc92d..4c384685 100644 --- a/pyclesperanto/_tier1.py +++ b/pyclesperanto/_tier1.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier1.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier1.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) def absolute( @@ -26,9 +28,9 @@ def absolute( ---------- input_image: Image The input image to be processed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -40,9 +42,7 @@ def absolute( [1] https://clij.github.io/clij2-docs/reference_absolute """ - from ._pyclesperanto import _absolute as op - - return op(device=device, src=input_image, dst=output_image) + return clic._absolute(device, input_image, output_image) @plugin_function(category=["combine", "in assistant"]) @@ -63,13 +63,13 @@ def add_images_weighted( The first input image to added. input_image1: Image The second image to be added. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - factor0: float = 1 + factor0: float (= 1) Multiplication factor of each pixel of src0 before adding it. - factor1: float = 1 + factor1: float (= 1) Multiplication factor of each pixel of src1 before adding it. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -81,15 +81,8 @@ def add_images_weighted( [1] https://clij.github.io/clij2-docs/reference_addImagesWeighted """ - from ._pyclesperanto import _add_images_weighted as op - - return op( - device=device, - src0=input_image0, - src1=input_image1, - dst=output_image, - factor0=float(factor0), - factor1=float(factor1), + return clic._add_images_weighted( + device, input_image0, input_image1, output_image, float(factor0), float(factor1) ) @@ -107,11 +100,11 @@ def add_image_and_scalar( ---------- input_image: Image The input image where scalare should be added. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - scalar: float = 1 + scalar: float (= 1) The constant number which will be added to all pixels. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -123,9 +116,7 @@ def add_image_and_scalar( [1] https://clij.github.io/clij2-docs/reference_addImageAndScalar """ - from ._pyclesperanto import _add_image_and_scalar as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._add_image_and_scalar(device, input_image, output_image, float(scalar)) @plugin_function( @@ -155,9 +146,9 @@ def binary_and( The first binary input image to be processed. input_image1: Image The second binary input image to be processed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -169,9 +160,7 @@ def binary_and( [1] https://clij.github.io/clij2-docs/reference_binaryAnd """ - from ._pyclesperanto import _binary_and as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._binary_and(device, input_image0, input_image1, output_image) @plugin_function( @@ -194,9 +183,9 @@ def binary_edge_detection( ---------- input_image: Image The binary input image where edges will be searched. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where edge pixels will be 1. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -208,9 +197,7 @@ def binary_edge_detection( [1] https://clij.github.io/clij2-docs/reference_binaryEdgeDetection """ - from ._pyclesperanto import _binary_edge_detection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._binary_edge_detection(device, input_image, output_image) @plugin_function( @@ -235,9 +222,9 @@ def binary_not( ---------- input_image: Image The binary input image to be inverted. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -249,9 +236,7 @@ def binary_not( [1] https://clij.github.io/clij2-docs/reference_binaryNot """ - from ._pyclesperanto import _binary_not as op - - return op(device=device, src=input_image, dst=output_image) + return clic._binary_not(device, input_image, output_image) @plugin_function( @@ -281,9 +266,9 @@ def binary_or( The first binary input image to be processed. input_image1: Image The second binary input image to be processed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -295,9 +280,7 @@ def binary_or( [1] https://clij.github.io/clij2-docs/reference_binaryOr """ - from ._pyclesperanto import _binary_or as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._binary_or(device, input_image0, input_image1, output_image) @plugin_function( @@ -324,9 +307,9 @@ def binary_subtract( The first binary input image to be processed. input_image1: Image The second binary input image to be subtracted from the first. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -338,9 +321,7 @@ def binary_subtract( [1] https://clij.github.io/clij2-docs/reference_binarySubtract """ - from ._pyclesperanto import _binary_subtract as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._binary_subtract(device, input_image0, input_image1, output_image) @plugin_function( @@ -370,9 +351,9 @@ def binary_xor( The first binary input image to be processed. input_image1: Image The second binary input image to be processed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -384,9 +365,7 @@ def binary_xor( [1] https://clij.github.io/clij2-docs/reference_binaryXOr """ - from ._pyclesperanto import _binary_xor as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._binary_xor(device, input_image0, input_image1, output_image) @plugin_function(category=["filter", "binary processing"]) @@ -402,20 +381,17 @@ def binary_supinf( ---------- input_image: Image The binary input image to be processed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _binary_supinf as op - - return op(device=device, src=input_image, dst=output_image) + return clic._binary_supinf(device, input_image, output_image) @plugin_function(category=["filter", "binary processing"]) @@ -431,20 +407,17 @@ def binary_infsup( ---------- input_image: Image The binary input image to be processed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _binary_infsup as op - - return op(device=device, src=input_image, dst=output_image) + return clic._binary_infsup(device, input_image, output_image) @plugin_function @@ -469,26 +442,20 @@ def block_enumerate( input binary vector image input_image1: Image precomputed sums of blocks - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) output enumerated vector image - blocksize: int = 256 - device: Optional[Device] = None + blocksize: int (= 256) + + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _block_enumerate as op - - return op( - device=device, - src0=input_image0, - src1=input_image1, - dst=output_image, - blocksize=int(blocksize), + return clic._block_enumerate( + device, input_image0, input_image1, output_image, int(blocksize) ) @@ -508,9 +475,9 @@ def convolve( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -522,9 +489,7 @@ def convolve( [1] https://clij.github.io/clij2-docs/reference_convolve """ - from ._pyclesperanto import _convolve as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._convolve(device, input_image0, input_image1, output_image) @plugin_function @@ -539,9 +504,9 @@ def copy( ---------- input_image: Image Input image to copy. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output copy image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -553,9 +518,7 @@ def copy( [1] https://clij.github.io/clij2-docs/reference_copy """ - from ._pyclesperanto import _copy as op - - return op(device=device, src=input_image, dst=output_image) + return clic._copy(device, input_image, output_image) @plugin_function @@ -576,10 +539,11 @@ def copy_slice( ---------- input_image: Image Input image to copy from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output copy image slice. - slice: int = 0 - device: Optional[Device] = None + slice: int (= 0) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -591,9 +555,7 @@ def copy_slice( [1] https://clij.github.io/clij2-docs/reference_copySlice """ - from ._pyclesperanto import _copy_slice as op - - return op(device=device, src=input_image, dst=output_image, slice=int(slice)) + return clic._copy_slice(device, input_image, output_image, int(slice)) @plugin_function @@ -611,10 +573,11 @@ def copy_horizontal_slice( ---------- input_image: Image Input image to copy from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output copy image slice. - slice: int = 0 - device: Optional[Device] = None + slice: int (= 0) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -626,9 +589,7 @@ def copy_horizontal_slice( [1] https://clij.github.io/clij2-docs/reference_copySlice """ - from ._pyclesperanto import _copy_horizontal_slice as op - - return op(device=device, src=input_image, dst=output_image, slice=int(slice)) + return clic._copy_horizontal_slice(device, input_image, output_image, int(slice)) @plugin_function @@ -646,10 +607,11 @@ def copy_vertical_slice( ---------- input_image: Image Input image to copy from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output copy image slice. - slice: int = 0 - device: Optional[Device] = None + slice: int (= 0) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -661,9 +623,7 @@ def copy_vertical_slice( [1] https://clij.github.io/clij2-docs/reference_copySlice """ - from ._pyclesperanto import _copy_vertical_slice as op - - return op(device=device, src=input_image, dst=output_image, slice=int(slice)) + return clic._copy_vertical_slice(device, input_image, output_image, int(slice)) @plugin_function @@ -685,21 +645,21 @@ def crop( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - start_x: int = 0 + start_x: int (= 0) Starting index coordicante x. - start_y: int = 0 + start_y: int (= 0) Starting index coordicante y. - start_z: int = 0 + start_z: int (= 0) Starting index coordicante z. - width: int = 1 + width: int (= 1) Width size of the region to crop. - height: int = 1 + height: int (= 1) Height size of the region to crop. - depth: int = 1 + depth: int (= 1) Depth size of the region to crop. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -711,18 +671,16 @@ def crop( [1] https://clij.github.io/clij2-docs/reference_crop3D """ - from ._pyclesperanto import _crop as op - - return op( - device=device, - src=input_image, - dst=output_image, - start_x=int(start_x), - start_y=int(start_y), - start_z=int(start_z), - width=int(width), - height=int(height), - depth=int(depth), + return clic._crop( + device, + input_image, + output_image, + int(start_x), + int(start_y), + int(start_z), + int(width), + int(height), + int(depth), ) @@ -738,20 +696,17 @@ def cubic_root( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _cubic_root as op - - return op(device=device, src=input_image, dst=output_image) + return clic._cubic_root(device, input_image, output_image) @plugin_function( @@ -769,9 +724,9 @@ def detect_label_edges( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -783,9 +738,7 @@ def detect_label_edges( [1] https://clij.github.io/clij2-docs/reference_detectLabelEdges """ - from ._pyclesperanto import _detect_label_edges as op - - return op(device=device, src=input_image, dst=output_image) + return clic._detect_label_edges(device, input_image, output_image) @plugin_function(category=["binary processing"]) @@ -805,9 +758,9 @@ def dilate_box( ---------- input_image: Image Input image to process. Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -819,13 +772,11 @@ def dilate_box( [1] https://clij.github.io/clij2-docs/reference_dilateBox """ - from ._pyclesperanto import _dilate_box as op - warnings.warn( - "dilate_box : This function is deprecated. Consider using dilate() instead.", + "pyclesperanto.dilate_box: This function is deprecated. Consider using dilate() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst=output_image) + return clic._dilate_box(device, input_image, output_image) @plugin_function(category=["binary processing", "bia-bob-suggestion"]) @@ -843,9 +794,9 @@ def dilate_sphere( ---------- input_image: Image Input image to process. Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -857,13 +808,11 @@ def dilate_sphere( [1] https://clij.github.io/clij2-docs/reference_dilateSphere """ - from ._pyclesperanto import _dilate_sphere as op - warnings.warn( - "dilate_sphere : This function is deprecated. Consider using dilate() instead.", + "pyclesperanto.dilate_sphere: This function is deprecated. Consider using dilate() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst=output_image) + return clic._dilate_sphere(device, input_image, output_image) @plugin_function(category=["binary processing", "bia-bob-suggestion"]) @@ -883,11 +832,11 @@ def dilate( ---------- input_image: Image Input image to process. Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. Output result image. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere". - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -897,14 +846,10 @@ def dilate( References ---------- [1] https://clij.github.io/clij2-docs/reference_dilateBox - [2] https://clij.github.io/clij2-docs/reference_dilateSphere + [2] https://clij.github.io/clij2-docs/reference_dilateSphere """ - from ._pyclesperanto import _dilate as op - - return op( - device=device, src=input_image, dst=output_image, connectivity=connectivity - ) + return clic._dilate(device, input_image, output_image, str(connectivity)) @plugin_function(category=["combine", "in assistant"]) @@ -922,9 +867,9 @@ def divide_images( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -936,9 +881,7 @@ def divide_images( [1] https://clij.github.io/clij2-docs/reference_divideImages """ - from ._pyclesperanto import _divide_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._divide_images(device, input_image0, input_image1, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -954,21 +897,21 @@ def divide_scalar_by_image( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 - device: Optional[Device] = None + scalar: float (= 0) + + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _divide_scalar_by_image as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._divide_scalar_by_image( + device, input_image, output_image, float(scalar) + ) @plugin_function(category=["combine", "binarize", "in assistant"]) @@ -987,9 +930,9 @@ def equal( The first image to be compared with. input_image1: Image The second image to be compared with the first. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The resulting binary image where pixels will be 1 only if source1 - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1001,9 +944,7 @@ def equal( [1] https://clij.github.io/clij2-docs/reference_equal """ - from ._pyclesperanto import _equal as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._equal(device, input_image0, input_image1, output_image) @plugin_function(category=["binarize", "in assistant"]) @@ -1020,11 +961,11 @@ def equal_constant( ---------- input_image: Image The image where every pixel is compared to the constant. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The resulting binary image where pixels will be 1 only if source1 - scalar: float = 0 + scalar: float (= 0) The constant where every pixel is compared to. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1036,9 +977,7 @@ def equal_constant( [1] https://clij.github.io/clij2-docs/reference_equalConstant """ - from ._pyclesperanto import _equal_constant as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._equal_constant(device, input_image, output_image, float(scalar)) @plugin_function(category=["binary processing"]) @@ -1058,9 +997,9 @@ def erode_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1072,13 +1011,11 @@ def erode_box( [1] https://clij.github.io/clij2-docs/reference_erodeBox """ - from ._pyclesperanto import _erode_box as op - warnings.warn( - "erode_box : This function is deprecated. Consider using erode() instead.", + "pyclesperanto.erode_box: This function is deprecated. Consider using erode() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst=output_image) + return clic._erode_box(device, input_image, output_image) @plugin_function(category=["binary processing", "bia-bob-suggestion"]) @@ -1096,9 +1033,9 @@ def erode_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1110,13 +1047,11 @@ def erode_sphere( [1] https://clij.github.io/clij2-docs/reference_erodeSphere """ - from ._pyclesperanto import _erode_sphere as op - warnings.warn( - "erode_sphere : This function is deprecated. Consider using erode() instead.", + "pyclesperanto.erode_sphere: This function is deprecated. Consider using erode() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst=output_image) + return clic._erode_sphere(device, input_image, output_image) @plugin_function(category=["binary processing", "bia-bob-suggestion"]) @@ -1136,11 +1071,11 @@ def erode( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere". - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1150,14 +1085,10 @@ def erode( References ---------- [1] https://clij.github.io/clij2-docs/reference_erodeBox - [2] https://clij.github.io/clij2-docs/reference_erodeSphere + [2] https://clij.github.io/clij2-docs/reference_erodeSphere """ - from ._pyclesperanto import _erode as op - - return op( - device=device, src=input_image, dst=output_image, connectivity=connectivity - ) + return clic._erode(device, input_image, output_image, str(connectivity)) @plugin_function(category=["filter", "in assistant"]) @@ -1173,9 +1104,9 @@ def exponential( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1187,9 +1118,7 @@ def exponential( [1] https://clij.github.io/clij2-docs/reference_exponential """ - from ._pyclesperanto import _exponential as op - - return op(device=device, src=input_image, dst=output_image) + return clic._exponential(device, input_image, output_image) @plugin_function @@ -1207,15 +1136,15 @@ def flip( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - flip_x: bool = True + flip_x: bool (= True) Flip along the x axis if true. - flip_y: bool = True + flip_y: bool (= True) Flip along the y axis if true. - flip_z: bool = True + flip_z: bool (= True) Flip along the z axis if true. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1227,16 +1156,7 @@ def flip( [1] https://clij.github.io/clij2-docs/reference_flip3D """ - from ._pyclesperanto import _flip as op - - return op( - device=device, - src=input_image, - dst=output_image, - flip_x=bool(flip_x), - flip_y=bool(flip_y), - flip_z=bool(flip_z), - ) + return clic._flip(device, input_image, output_image, flip_x, flip_y, flip_z) @plugin_function(category=["filter", "denoise", "in assistant", "bia-bob-suggestion"]) @@ -1256,15 +1176,15 @@ def gaussian_blur( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - sigma_x: float = 0 + sigma_x: float (= 0) Sigma value along the x axis. - sigma_y: float = 0 + sigma_y: float (= 0) Sigma value along the y axis. - sigma_z: float = 0 + sigma_z: float (= 0) Sigma value along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1276,15 +1196,13 @@ def gaussian_blur( [1] https://clij.github.io/clij2-docs/reference_gaussianBlur3D """ - from ._pyclesperanto import _gaussian_blur as op - - return op( - device=device, - src=input_image, - dst=output_image, - sigma_x=float(sigma_x), - sigma_y=float(sigma_y), - sigma_z=float(sigma_z), + return clic._gaussian_blur( + device, + input_image, + output_image, + float(sigma_x), + float(sigma_y), + float(sigma_z), ) @@ -1311,9 +1229,9 @@ def generate_distance_matrix( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1325,9 +1243,9 @@ def generate_distance_matrix( [1] https://clij.github.io/clij2-docs/reference_generateDistanceMatrix """ - from ._pyclesperanto import _generate_distance_matrix as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._generate_distance_matrix( + device, input_image0, input_image1, output_image + ) @plugin_function(category=["filter", "edge detection", "in assistant"]) @@ -1344,9 +1262,9 @@ def gradient_x( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1358,9 +1276,7 @@ def gradient_x( [1] https://clij.github.io/clij2-docs/reference_gradientX """ - from ._pyclesperanto import _gradient_x as op - - return op(device=device, src=input_image, dst=output_image) + return clic._gradient_x(device, input_image, output_image) @plugin_function(category=["filter", "edge detection", "in assistant"]) @@ -1377,9 +1293,9 @@ def gradient_y( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1391,9 +1307,7 @@ def gradient_y( [1] https://clij.github.io/clij2-docs/reference_gradientY """ - from ._pyclesperanto import _gradient_y as op - - return op(device=device, src=input_image, dst=output_image) + return clic._gradient_y(device, input_image, output_image) @plugin_function(category=["filter", "edge detection", "in assistant"]) @@ -1410,9 +1324,9 @@ def gradient_z( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1424,9 +1338,7 @@ def gradient_z( [1] https://clij.github.io/clij2-docs/reference_gradientZ """ - from ._pyclesperanto import _gradient_z as op - - return op(device=device, src=input_image, dst=output_image) + return clic._gradient_z(device, input_image, output_image) @plugin_function(category=["combine", "binarize", "in assistant"]) @@ -1445,9 +1357,9 @@ def greater( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1459,9 +1371,7 @@ def greater( [1] https://clij.github.io/clij2-docs/reference_greater """ - from ._pyclesperanto import _greater as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._greater(device, input_image0, input_image1, output_image) @plugin_function(category=["binarize", "in assistant"]) @@ -1478,10 +1388,11 @@ def greater_constant( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 - device: Optional[Device] = None + scalar: float (= 0) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1493,9 +1404,7 @@ def greater_constant( [1] https://clij.github.io/clij2-docs/reference_greaterConstant """ - from ._pyclesperanto import _greater_constant as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._greater_constant(device, input_image, output_image, float(scalar)) @plugin_function(category=["combine", "binarize", "in assistant"]) @@ -1514,9 +1423,9 @@ def greater_or_equal( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1528,9 +1437,7 @@ def greater_or_equal( [1] https://clij.github.io/clij2-docs/reference_greaterOrEqual """ - from ._pyclesperanto import _greater_or_equal as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._greater_or_equal(device, input_image0, input_image1, output_image) @plugin_function(category=["binarize", "in assistant"]) @@ -1547,11 +1454,11 @@ def greater_or_equal_constant( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 + scalar: float (= 0) Scalar value used in the comparison. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1563,9 +1470,9 @@ def greater_or_equal_constant( [1] https://clij.github.io/clij2-docs/reference_greaterOrEqualConstant """ - from ._pyclesperanto import _greater_or_equal_constant as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._greater_or_equal_constant( + device, input_image, output_image, float(scalar) + ) @plugin_function @@ -1575,7 +1482,7 @@ def hessian_eigenvalues( middle_eigenvalue: Optional[Image] = None, large_eigenvalue: Optional[Image] = None, device: Optional[Device] = None, -) -> list: +) -> Image: """Computes the eigenvalues of the hessian matrix of a 2d or 3d image. Hessian matrix or 2D images: [Ixx, Ixy] [Ixy, Iyy] Hessian matrix for 3D images: [Ixx, Ixy, Ixz] [Ixy, Iyy, Iyz] [Ixz, Iyz, Izz] Ixx denotes the second derivative in @@ -1590,29 +1497,22 @@ def hessian_eigenvalues( ---------- input_image: Image Input image to process. - small_eigenvalue: Optional[Image] = None + small_eigenvalue: Optional[Image] (= None) Output result image. - middle_eigenvalue: Optional[Image] = None + middle_eigenvalue: Optional[Image] (= None) Output result image, null if input is 2D. - large_eigenvalue: Optional[Image] = None + large_eigenvalue: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- - list - + Image """ - from ._pyclesperanto import _hessian_eigenvalues as op - - return op( - device=device, - src=input_image, - small_eigenvalue=small_eigenvalue, - middle_eigenvalue=middle_eigenvalue, - large_eigenvalue=large_eigenvalue, + return clic._hessian_eigenvalues( + device, input_image, small_eigenvalue, middle_eigenvalue, large_eigenvalue ) @@ -1630,9 +1530,9 @@ def laplace_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1644,13 +1544,11 @@ def laplace_box( [1] https://clij.github.io/clij2-docs/reference_laplaceBox """ - from ._pyclesperanto import _laplace_box as op - warnings.warn( - "laplace_box : This function is deprecated. Consider using laplace() instead.", + "pyclesperanto.laplace_box: This function is deprecated. Consider using laplace() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst=output_image) + return clic._laplace_box(device, input_image, output_image) @plugin_function(category=["filter", "edge detection", "bia-bob-suggestion"]) @@ -1665,9 +1563,9 @@ def laplace_diamond( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1679,13 +1577,11 @@ def laplace_diamond( [1] https://clij.github.io/clij2-docs/reference_laplaceDiamond """ - from ._pyclesperanto import _laplace_diamond as op - warnings.warn( - "laplace_diamond : This function is deprecated. Consider using laplace() instead.", + "pyclesperanto.laplace_diamond: This function is deprecated. Consider using laplace() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst=output_image) + return clic._laplace_diamond(device, input_image, output_image) @plugin_function(category=["filter", "edge detection", "bia-bob-suggestion"]) @@ -1702,11 +1598,11 @@ def laplace( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1718,11 +1614,7 @@ def laplace( [1] https://clij.github.io/clij2-docs/reference_laplaceDiamond """ - from ._pyclesperanto import _laplace as op - - return op( - device=device, src=input_image, dst=output_image, connectivity=connectivity - ) + return clic._laplace(device, input_image, output_image, str(connectivity)) @plugin_function(category=["filter", "combine", "in assistant"]) @@ -1740,20 +1632,19 @@ def local_cross_correlation( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _local_cross_correlation as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._local_cross_correlation( + device, input_image0, input_image1, output_image + ) @plugin_function(category=["filter", "in assistant"]) @@ -1769,9 +1660,9 @@ def logarithm( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1783,9 +1674,7 @@ def logarithm( [1] https://clij.github.io/clij2-docs/reference_logarithm """ - from ._pyclesperanto import _logarithm as op - - return op(device=device, src=input_image, dst=output_image) + return clic._logarithm(device, input_image, output_image) @plugin_function(category=["bia-bob-suggestion"]) @@ -1806,9 +1695,9 @@ def mask( Input image to process. mask: Image Mask image to apply. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1820,9 +1709,7 @@ def mask( [1] https://clij.github.io/clij2-docs/reference_mask """ - from ._pyclesperanto import _mask as op - - return op(device=device, src=input_image, mask=mask, dst=output_image) + return clic._mask(device, input_image, mask, output_image) @plugin_function(category=["bia-bob-suggestion"]) @@ -1844,11 +1731,11 @@ def mask_label( Input Intensity image. input_image1: Image Input Label image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - label: float = 1 + label: float (= 1) Label value to use. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1860,14 +1747,8 @@ def mask_label( [1] https://clij.github.io/clij2-docs/reference_maskLabel """ - from ._pyclesperanto import _mask_label as op - - return op( - device=device, - src0=input_image0, - src1=input_image1, - dst=output_image, - label=float(label), + return clic._mask_label( + device, input_image0, input_image1, output_image, float(label) ) @@ -1885,11 +1766,11 @@ def maximum_image_and_scalar( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 + scalar: float (= 0) Scalar value used in the comparison. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1901,9 +1782,9 @@ def maximum_image_and_scalar( [1] https://clij.github.io/clij2-docs/reference_maximumImageAndScalar """ - from ._pyclesperanto import _maximum_image_and_scalar as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._maximum_image_and_scalar( + device, input_image, output_image, float(scalar) + ) @plugin_function(category=["combine", "in assistant", "bia-bob-suggestion"]) @@ -1922,9 +1803,9 @@ def maximum_images( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1936,9 +1817,7 @@ def maximum_images( [1] https://clij.github.io/clij2-docs/reference_maximumImages """ - from ._pyclesperanto import _maximum_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._maximum_images(device, input_image0, input_image1, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -1957,15 +1836,15 @@ def maximum_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1977,19 +1856,12 @@ def maximum_box( [1] https://clij.github.io/clij2-docs/reference_maximum3DBox """ - from ._pyclesperanto import _maximum_box as op - warnings.warn( - "maximum_box : This function is deprecated. Consider using maximum() instead.", + "pyclesperanto.maximum_box: This function is deprecated. Consider using maximum() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._maximum_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2011,17 +1883,17 @@ def maximum( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius size along x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius size along y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius size along z axis. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2031,19 +1903,17 @@ def maximum( References ---------- [1] https://clij.github.io/clij2-docs/reference_maximum3DBox - [2] https://clij.github.io/clij2-docs/reference_maximum3DSphere + [2] https://clij.github.io/clij2-docs/reference_maximum3DSphere """ - from ._pyclesperanto import _maximum as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._maximum( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -2059,9 +1929,9 @@ def maximum_x_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2073,9 +1943,7 @@ def maximum_x_projection( [1] https://clij.github.io/clij2-docs/reference_maximumXProjection """ - from ._pyclesperanto import _maximum_x_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._maximum_x_projection(device, input_image, output_image) @plugin_function(category=["projection"]) @@ -2090,9 +1958,9 @@ def maximum_y_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2104,9 +1972,7 @@ def maximum_y_projection( [1] https://clij.github.io/clij2-docs/reference_maximumYProjection """ - from ._pyclesperanto import _maximum_y_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._maximum_y_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) @@ -2121,9 +1987,9 @@ def maximum_z_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2135,9 +2001,7 @@ def maximum_z_projection( [1] https://clij.github.io/clij2-docs/reference_maximumZProjection """ - from ._pyclesperanto import _maximum_z_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._maximum_z_projection(device, input_image, output_image) @plugin_function(category=["filter", "denoise", "in assistant"]) @@ -2156,15 +2020,15 @@ def mean_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2176,19 +2040,12 @@ def mean_box( [1] https://clij.github.io/clij2-docs/reference_mean3DBox """ - from ._pyclesperanto import _mean_box as op - warnings.warn( - "mean_box : This function is deprecated. Consider using mean() instead.", + "pyclesperanto.mean_box: This function is deprecated. Consider using mean() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._mean_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2208,15 +2065,15 @@ def mean_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2228,19 +2085,12 @@ def mean_sphere( [1] https://clij.github.io/clij2-docs/reference_mean3DSphere """ - from ._pyclesperanto import _mean_sphere as op - warnings.warn( - "mean_sphere : This function is deprecated. Consider using mean() instead.", + "pyclesperanto.mean_sphere: This function is deprecated. Consider using mean() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._mean_sphere( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2262,17 +2112,17 @@ def mean( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2284,16 +2134,14 @@ def mean( [1] https://clij.github.io/clij2-docs/reference_mean3DSphere """ - from ._pyclesperanto import _mean as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._mean( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -2309,9 +2157,9 @@ def mean_x_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2323,9 +2171,7 @@ def mean_x_projection( [1] https://clij.github.io/clij2-docs/reference_meanXProjection """ - from ._pyclesperanto import _mean_x_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._mean_x_projection(device, input_image, output_image) @plugin_function(category=["projection"]) @@ -2340,9 +2186,9 @@ def mean_y_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2354,9 +2200,7 @@ def mean_y_projection( [1] https://clij.github.io/clij2-docs/reference_meanYProjection """ - from ._pyclesperanto import _mean_y_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._mean_y_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) @@ -2371,9 +2215,9 @@ def mean_z_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2385,9 +2229,7 @@ def mean_z_projection( [1] https://clij.github.io/clij2-docs/reference_meanZProjection """ - from ._pyclesperanto import _mean_z_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._mean_z_projection(device, input_image, output_image) @plugin_function(category=["filter", "denoise", "in assistant"]) @@ -2407,15 +2249,15 @@ def median_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2427,19 +2269,12 @@ def median_box( [1] https://clij.github.io/clij2-docs/reference_median3DBox """ - from ._pyclesperanto import _median_box as op - warnings.warn( - "median_box : This function is deprecated. Consider using median() instead.", + "pyclesperanto.median_box: This function is deprecated. Consider using median() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._median_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2460,15 +2295,15 @@ def median_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2480,19 +2315,12 @@ def median_sphere( [1] https://clij.github.io/clij2-docs/reference_median3DSphere """ - from ._pyclesperanto import _median_sphere as op - warnings.warn( - "median_sphere : This function is deprecated. Consider using median() instead.", + "pyclesperanto.median_sphere: This function is deprecated. Consider using median() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._median_sphere( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2515,17 +2343,17 @@ def median( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2537,16 +2365,14 @@ def median( [1] https://clij.github.io/clij2-docs/reference_median3DSphere """ - from ._pyclesperanto import _median as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._median( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -2566,15 +2392,15 @@ def minimum_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius size along x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius size along y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2586,19 +2412,12 @@ def minimum_box( [1] https://clij.github.io/clij2-docs/reference_minimum3DBox """ - from ._pyclesperanto import _minimum_box as op - warnings.warn( - "minimum_box : This function is deprecated. Consider using minimum() instead.", + "pyclesperanto.minimum_box: This function is deprecated. Consider using minimum() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._minimum_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2619,17 +2438,17 @@ def minimum( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius size along x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius size along y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius size along z axis. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2639,19 +2458,17 @@ def minimum( References ---------- [1] https://clij.github.io/clij2-docs/reference_minimum3DBox - [2] https://clij.github.io/clij2-docs/reference_minimum3DSphere + [2] https://clij.github.io/clij2-docs/reference_minimum3DSphere """ - from ._pyclesperanto import _minimum as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._minimum( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -2669,11 +2486,11 @@ def minimum_image_and_scalar( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 + scalar: float (= 0) Scalar value used in the comparison. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2685,9 +2502,9 @@ def minimum_image_and_scalar( [1] https://clij.github.io/clij2-docs/reference_minimumImageAndScalar """ - from ._pyclesperanto import _minimum_image_and_scalar as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._minimum_image_and_scalar( + device, input_image, output_image, float(scalar) + ) @plugin_function(category=["combine", "in assistant"]) @@ -2706,9 +2523,9 @@ def minimum_images( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2720,9 +2537,7 @@ def minimum_images( [1] https://clij.github.io/clij2-docs/reference_minimumImages """ - from ._pyclesperanto import _minimum_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._minimum_images(device, input_image0, input_image1, output_image) @plugin_function(category=["projection"]) @@ -2737,9 +2552,9 @@ def minimum_x_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2751,9 +2566,7 @@ def minimum_x_projection( [1] https://clij.github.io/clij2-docs/reference_minimumXProjection """ - from ._pyclesperanto import _minimum_x_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._minimum_x_projection(device, input_image, output_image) @plugin_function(category=["projection"]) @@ -2768,9 +2581,9 @@ def minimum_y_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2782,9 +2595,7 @@ def minimum_y_projection( [1] https://clij.github.io/clij2-docs/reference_minimumYProjection """ - from ._pyclesperanto import _minimum_y_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._minimum_y_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) @@ -2799,9 +2610,9 @@ def minimum_z_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -2813,9 +2624,7 @@ def minimum_z_projection( [1] https://clij.github.io/clij2-docs/reference_minimumZProjection """ - from ._pyclesperanto import _minimum_z_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._minimum_z_projection(device, input_image, output_image) @plugin_function(category=["label processing", "in assistant"]) @@ -2837,36 +2646,28 @@ def mode_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _mode_box as op - warnings.warn( - "mode_box : This function is deprecated. Consider using mode() instead.", + "pyclesperanto.mode_box: This function is deprecated. Consider using mode() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._mode_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2889,36 +2690,28 @@ def mode_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _mode_sphere as op - warnings.warn( - "mode_sphere : This function is deprecated. Consider using mode() instead.", + "pyclesperanto.mode_sphere: This function is deprecated. Consider using mode() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._mode_sphere( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -2943,35 +2736,32 @@ def mode( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _mode as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._mode( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -2990,20 +2780,17 @@ def modulo_images( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _modulo_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._modulo_images(device, input_image0, input_image1, output_image) @plugin_function @@ -3020,11 +2807,11 @@ def multiply_image_and_position( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - dimension: int = 0 + dimension: int (= 0) Dimension (0,1,2) to use in the operation. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3036,10 +2823,8 @@ def multiply_image_and_position( [1] https://clij.github.io/clij2-docs/reference_multiplyImageAndCoordinate """ - from ._pyclesperanto import _multiply_image_and_position as op - - return op( - device=device, src=input_image, dst=output_image, dimension=int(dimension) + return clic._multiply_image_and_position( + device, input_image, output_image, int(dimension) ) @@ -3057,11 +2842,11 @@ def multiply_image_and_scalar( ---------- input_image: Image The input image to be multiplied with a constant. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - scalar: float = 0 + scalar: float (= 0) The number with which every pixel will be multiplied with. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3073,9 +2858,9 @@ def multiply_image_and_scalar( [1] https://clij.github.io/clij2-docs/reference_multiplyImageAndScalar """ - from ._pyclesperanto import _multiply_image_and_scalar as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._multiply_image_and_scalar( + device, input_image, output_image, float(scalar) + ) @plugin_function(category=["combine", "in assistant"]) @@ -3094,9 +2879,9 @@ def multiply_images( The first input image to be multiplied. input_image1: Image The second image to be multiplied. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3108,9 +2893,7 @@ def multiply_images( [1] https://clij.github.io/clij2-docs/reference_multiplyImages """ - from ._pyclesperanto import _multiply_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._multiply_images(device, input_image0, input_image1, output_image) @plugin_function @@ -3132,15 +2915,15 @@ def nan_to_num( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - nan: float = 0 + nan: float (= 0) Value to replace - posinf: float = np.nan_to_num(float('inf')) + posinf: float (= np.nan_to_num(float('inf'))) Value to replace +inf with. - neginf: float = np.nan_to_num(float('-inf')) + neginf: float (= np.nan_to_num(float('-inf'))) Value to replace -inf with. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3152,15 +2935,8 @@ def nan_to_num( [1] https://numpy.org/doc/stable/reference/generated/numpy.nan_to_num.html """ - from ._pyclesperanto import _nan_to_num as op - - return op( - device=device, - src=input_image, - dst=output_image, - nan=float(nan), - posinf=float(posinf), - neginf=float(neginf), + return clic._nan_to_num( + device, input_image, output_image, float(nan), float(posinf), float(neginf) ) @@ -3182,9 +2958,9 @@ def nonzero_maximum_box( Input image to process. output_image0: Image Output flag (0 or 1). - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3196,13 +2972,11 @@ def nonzero_maximum_box( [1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumBox """ - from ._pyclesperanto import _nonzero_maximum_box as op - warnings.warn( - "nonzero_maximum_box : This function is deprecated. Consider using nonzero_maximum() instead.", + "pyclesperanto.nonzero_maximum_box: This function is deprecated. Consider using nonzero_maximum() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst0=output_image0, dst1=output_image1) + return clic._nonzero_maximum_box(device, input_image, output_image0, output_image1) @plugin_function @@ -3223,9 +2997,9 @@ def nonzero_maximum_diamond( Input image to process. output_image0: Image Output flag (0 or 1). - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3237,13 +3011,13 @@ def nonzero_maximum_diamond( [1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumDiamond """ - from ._pyclesperanto import _nonzero_maximum_diamond as op - warnings.warn( - "nonzero_maximum_diamond : This function is deprecated. Consider using nonzero_maximum() instead.", + "pyclesperanto.nonzero_maximum_diamond: This function is deprecated. Consider using nonzero_maximum() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst0=output_image0, dst1=output_image1) + return clic._nonzero_maximum_diamond( + device, input_image, output_image0, output_image1 + ) @plugin_function @@ -3266,11 +3040,11 @@ def nonzero_maximum( Input image to process. output_image0: Image Output flag (0 or 1). - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image where results are written into. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3280,17 +3054,11 @@ def nonzero_maximum( References ---------- [1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumBox - [2] https://clij.github.io/clij2-docs/reference_nonzeroMaximumDiamond + [2] https://clij.github.io/clij2-docs/reference_nonzeroMaximumDiamond """ - from ._pyclesperanto import _nonzero_maximum as op - - return op( - device=device, - src=input_image, - dst0=output_image0, - dst1=output_image1, - connectivity=connectivity, + return clic._nonzero_maximum( + device, input_image, output_image0, output_image1, str(connectivity) ) @@ -3312,9 +3080,9 @@ def nonzero_minimum_box( Input image to process. output_image0: Image Output flag (0 or 1). - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3326,13 +3094,11 @@ def nonzero_minimum_box( [1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumBox """ - from ._pyclesperanto import _nonzero_minimum_box as op - warnings.warn( - "nonzero_minimum_box : This function is deprecated. Consider using nonzero_minimum() instead.", + "pyclesperanto.nonzero_minimum_box: This function is deprecated. Consider using nonzero_minimum() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst0=output_image0, dst1=output_image1) + return clic._nonzero_minimum_box(device, input_image, output_image0, output_image1) @plugin_function @@ -3353,9 +3119,9 @@ def nonzero_minimum_diamond( Input image to process. output_image0: Image Output flag (0 or 1). - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3367,13 +3133,13 @@ def nonzero_minimum_diamond( [1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumDiamond """ - from ._pyclesperanto import _nonzero_minimum_diamond as op - warnings.warn( - "nonzero_minimum_diamond : This function is deprecated. Consider using nonzero_minimum() instead.", + "pyclesperanto.nonzero_minimum_diamond: This function is deprecated. Consider using nonzero_minimum() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst0=output_image0, dst1=output_image1) + return clic._nonzero_minimum_diamond( + device, input_image, output_image0, output_image1 + ) @plugin_function @@ -3396,11 +3162,11 @@ def nonzero_minimum( Input image to process. output_image0: Image Output flag (0 or 1). - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image where results are written into. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3410,17 +3176,11 @@ def nonzero_minimum( References ---------- [1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumBox - [2] https://clij.github.io/clij2-docs/reference_nonzeroMinimumDiamond + [2] https://clij.github.io/clij2-docs/reference_nonzeroMinimumDiamond """ - from ._pyclesperanto import _nonzero_minimum as op - - return op( - device=device, - src=input_image, - dst0=output_image0, - dst1=output_image1, - connectivity=connectivity, + return clic._nonzero_minimum( + device, input_image, output_image0, output_image1, str(connectivity) ) @@ -3440,9 +3200,9 @@ def not_equal( The first image to be compared with. input_image1: Image The second image to be compared with the first. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The resulting binary image where pixels will be 1 only if source1 - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3454,9 +3214,7 @@ def not_equal( [1] https://clij.github.io/clij2-docs/reference_notEqual """ - from ._pyclesperanto import _not_equal as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._not_equal(device, input_image0, input_image1, output_image) @plugin_function(category=["binarize", "in assistant"]) @@ -3473,11 +3231,11 @@ def not_equal_constant( ---------- input_image: Image The image where every pixel is compared to the constant. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The resulting binary image where pixels will be 1 only if source1 - scalar: float = 0 + scalar: float (= 0) The constant where every pixel is compared to. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3489,9 +3247,7 @@ def not_equal_constant( [1] https://clij.github.io/clij2-docs/reference_notEqualConstant """ - from ._pyclesperanto import _not_equal_constant as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._not_equal_constant(device, input_image, output_image, float(scalar)) @plugin_function(category=["combine", "in assistant"]) @@ -3509,15 +3265,15 @@ def paste( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - index_x: int = 0 + index_x: int (= 0) Origin pixel coodinate in x to paste. - index_y: int = 0 + index_y: int (= 0) Origin pixel coodinate in y to paste. - index_z: int = 0 + index_z: int (= 0) Origin pixel coodinate in z to paste. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3529,15 +3285,8 @@ def paste( [1] https://clij.github.io/clij2-docs/reference_paste3D """ - from ._pyclesperanto import _paste as op - - return op( - device=device, - src=input_image, - dst=output_image, - index_x=int(index_x), - index_y=int(index_y), - index_z=int(index_z), + return clic._paste( + device, input_image, output_image, int(index_x), int(index_y), int(index_z) ) @@ -3557,9 +3306,9 @@ def onlyzero_overwrite_maximum_box( Input image to process. output_image0: Image Output flag value, 0 or 1. - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3571,13 +3320,13 @@ def onlyzero_overwrite_maximum_box( [1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumBox """ - from ._pyclesperanto import _onlyzero_overwrite_maximum_box as op - warnings.warn( - "onlyzero_overwrite_maximum_box : This function is deprecated. Consider using onlyzero_overwrite_maximum() instead.", + "pyclesperanto.onlyzero_overwrite_maximum_box: This function is deprecated. Consider using onlyzero_overwrite_maximum() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst0=output_image0, dst1=output_image1) + return clic._onlyzero_overwrite_maximum_box( + device, input_image, output_image0, output_image1 + ) @plugin_function @@ -3596,9 +3345,9 @@ def onlyzero_overwrite_maximum_diamond( Input image to process. output_image0: Image Output flag value, 0 or 1. - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3610,13 +3359,13 @@ def onlyzero_overwrite_maximum_diamond( [1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumDiamond """ - from ._pyclesperanto import _onlyzero_overwrite_maximum_diamond as op - warnings.warn( - "onlyzero_overwrite_maximum_diamond : This function is deprecated. Consider using onlyzero_overwrite_maximum() instead.", + "pyclesperanto.onlyzero_overwrite_maximum_diamond: This function is deprecated. Consider using onlyzero_overwrite_maximum() instead.", DeprecationWarning, ) - return op(device=device, src=input_image, dst0=output_image0, dst1=output_image1) + return clic._onlyzero_overwrite_maximum_diamond( + device, input_image, output_image0, output_image1 + ) @plugin_function @@ -3636,11 +3385,11 @@ def onlyzero_overwrite_maximum( Input image to process. output_image0: Image Output flag value, 0 or 1. - output_image1: Optional[Image] = None + output_image1: Optional[Image] (= None) Output image. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3650,17 +3399,11 @@ def onlyzero_overwrite_maximum( References ---------- [1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumBox - [2] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumDiamond + [2] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumDiamond """ - from ._pyclesperanto import _onlyzero_overwrite_maximum as op - - return op( - device=device, - src=input_image, - dst0=output_image0, - dst1=output_image1, - connectivity=connectivity, + return clic._onlyzero_overwrite_maximum( + device, input_image, output_image0, output_image1, str(connectivity) ) @@ -3678,11 +3421,11 @@ def power( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 1 + scalar: float (= 1) Power value. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3694,9 +3437,7 @@ def power( [1] https://clij.github.io/clij2-docs/reference_power """ - from ._pyclesperanto import _power as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._power(device, input_image, output_image, float(scalar)) @plugin_function(category=["combine", "in assistant"]) @@ -3714,9 +3455,9 @@ def power_images( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3728,9 +3469,7 @@ def power_images( [1] https://clij.github.io/clij2-docs/reference_powerImages """ - from ._pyclesperanto import _power_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._power_images(device, input_image0, input_image1, output_image) @plugin_function(category=["transform", "in assistant"]) @@ -3754,50 +3493,47 @@ def range( ---------- input_image: Image First input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - start_x: Optional[int] = None + start_x: Optional[int] (= None) Range starting value in x - stop_x: Optional[int] = None + stop_x: Optional[int] (= None) Range stop value in x - step_x: Optional[int] = None + step_x: Optional[int] (= None) Range step value in x - start_y: Optional[int] = None + start_y: Optional[int] (= None) Range starting value in y - stop_y: Optional[int] = None + stop_y: Optional[int] (= None) Range stop value in y - step_y: Optional[int] = None + step_y: Optional[int] (= None) Range step value in y - start_z: Optional[int] = None + start_z: Optional[int] (= None) Range starting value in z - stop_z: Optional[int] = None + stop_z: Optional[int] (= None) Range stop value in z - step_z: Optional[int] = None + step_z: Optional[int] (= None) Range step value in z - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _range as op - - return op( - device=device, - src=input_image, - dst=output_image, - start_x=int(start_x) if start_x is not None else None, - stop_x=int(stop_x) if stop_x is not None else None, - step_x=int(step_x) if step_x is not None else None, - start_y=int(start_y) if start_y is not None else None, - stop_y=int(stop_y) if stop_y is not None else None, - step_y=int(step_y) if step_y is not None else None, - start_z=int(start_z) if start_z is not None else None, - stop_z=int(stop_z) if stop_z is not None else None, - step_z=int(step_z) if step_z is not None else None, + return clic._range( + device, + input_image, + output_image, + start_x, + stop_x, + step_x, + start_y, + stop_y, + step_y, + start_z, + stop_z, + step_z, ) @@ -3818,20 +3554,17 @@ def read_values_from_positions( Input image to process. list: Image List of coordinate, as a 2D matrix. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output vector image of intensities. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _read_values_from_positions as op - - return op(device=device, src=input_image, list=list, dst=output_image) + return clic._read_values_from_positions(device, input_image, list, output_image) @plugin_function(category=["bia-bob-suggestion"]) @@ -3851,9 +3584,9 @@ def replace_values( Input image to process. input_image1: Image List of intensities to replace, as a vector of values. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3865,9 +3598,7 @@ def replace_values( [1] https://clij.github.io/clij2-docs/reference_replaceIntensities """ - from ._pyclesperanto import _replace_values as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._replace_values(device, input_image0, input_image1, output_image) @plugin_function @@ -3884,13 +3615,13 @@ def replace_value( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar0: float = 0 + scalar0: float (= 0) Old value. - scalar1: float = 1 + scalar1: float (= 1) New value. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3902,14 +3633,8 @@ def replace_value( [1] https://clij.github.io/clij2-docs/reference_replaceIntensity """ - from ._pyclesperanto import _replace_value as op - - return op( - device=device, - src=input_image, - dst=output_image, - scalar0=float(scalar0), - scalar1=float(scalar1), + return clic._replace_value( + device, input_image, output_image, float(scalar0), float(scalar1) ) @@ -3929,15 +3654,15 @@ def maximum_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: float = 1 + radius_x: float (= 1) Radius size along x axis. - radius_y: float = 1 + radius_y: float (= 1) Radius size along y axis. - radius_z: float = 0 + radius_z: float (= 0) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -3949,19 +3674,17 @@ def maximum_sphere( [1] https://clij.github.io/clij2-docs/reference_maximum3DSphere """ - from ._pyclesperanto import _maximum_sphere as op - warnings.warn( - "maximum_sphere : This function is deprecated. Consider using maximum() instead.", + "pyclesperanto.maximum_sphere: This function is deprecated. Consider using maximum() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), + return clic._maximum_sphere( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), ) @@ -3981,15 +3704,15 @@ def minimum_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: float = 1 + radius_x: float (= 1) Radius size along x axis. - radius_y: float = 1 + radius_y: float (= 1) Radius size along y axis. - radius_z: float = 1 + radius_z: float (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4001,19 +3724,17 @@ def minimum_sphere( [1] https://clij.github.io/clij2-docs/reference_minimum3DSphere """ - from ._pyclesperanto import _minimum_sphere as op - warnings.warn( - "minimum_sphere : This function is deprecated. Consider using minimum() instead.", + "pyclesperanto.minimum_sphere: This function is deprecated. Consider using minimum() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), + return clic._minimum_sphere( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), ) @@ -4033,9 +3754,9 @@ def multiply_matrix( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4047,9 +3768,7 @@ def multiply_matrix( [1] https://clij.github.io/clij2-docs/reference_multiplyMatrix """ - from ._pyclesperanto import _multiply_matrix as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._multiply_matrix(device, input_image0, input_image1, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -4065,9 +3784,9 @@ def reciprocal( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4079,9 +3798,7 @@ def reciprocal( [1] https://numpy.org/doc/stable/reference/generated/numpy.reciprocal.html """ - from ._pyclesperanto import _reciprocal as op - - return op(device=device, src=input_image, dst=output_image) + return clic._reciprocal(device, input_image, output_image) @plugin_function @@ -4095,9 +3812,9 @@ def set( ---------- input_image: Image Input image to process. - scalar: float = 0 + scalar: float (= 0) Value to set. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4109,9 +3826,7 @@ def set( [1] https://clij.github.io/clij2-docs/reference_set """ - from ._pyclesperanto import _set as op - - return op(device=device, src=input_image, scalar=float(scalar)) + return clic._set(device, input_image, float(scalar)) @plugin_function @@ -4127,11 +3842,11 @@ def set_column( ---------- input_image: Image Input image to process. - column: int = 0 + column: int (= 0) Column index. - value: float = 0 + value: float (= 0) Value to set. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4143,9 +3858,7 @@ def set_column( [1] https://clij.github.io/clij2-docs/reference_setColumn """ - from ._pyclesperanto import _set_column as op - - return op(device=device, src=input_image, column=int(column), value=float(value)) + return clic._set_column(device, input_image, int(column), float(value)) @plugin_function @@ -4158,9 +3871,9 @@ def set_image_borders( ---------- input_image: Image Input image to process. - value: float = 0 + value: float (= 0) Value to set. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4172,9 +3885,7 @@ def set_image_borders( [1] https://clij.github.io/clij2-docs/reference_setImageBorders """ - from ._pyclesperanto import _set_image_borders as op - - return op(device=device, src=input_image, value=float(value)) + return clic._set_image_borders(device, input_image, float(value)) @plugin_function @@ -4190,11 +3901,11 @@ def set_plane( ---------- input_image: Image Input image to process. - plane: int = 0 + plane: int (= 0) Plane index. - value: float = 0 + value: float (= 0) Value to set. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4206,9 +3917,7 @@ def set_plane( [1] https://clij.github.io/clij2-docs/reference_setPlane """ - from ._pyclesperanto import _set_plane as op - - return op(device=device, src=input_image, plane=int(plane), value=float(value)) + return clic._set_plane(device, input_image, int(plane), float(value)) @plugin_function @@ -4219,7 +3928,7 @@ def set_ramp_x(input_image: Image, device: Optional[Device] = None) -> Image: ---------- input_image: Image Input image to process. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4231,9 +3940,7 @@ def set_ramp_x(input_image: Image, device: Optional[Device] = None) -> Image: [1] https://clij.github.io/clij2-docs/reference_setRampX """ - from ._pyclesperanto import _set_ramp_x as op - - return op(device=device, src=input_image) + return clic._set_ramp_x(device, input_image) @plugin_function @@ -4244,7 +3951,7 @@ def set_ramp_y(input_image: Image, device: Optional[Device] = None) -> Image: ---------- input_image: Image Input image to process. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4256,9 +3963,7 @@ def set_ramp_y(input_image: Image, device: Optional[Device] = None) -> Image: [1] https://clij.github.io/clij2-docs/reference_setRampY """ - from ._pyclesperanto import _set_ramp_y as op - - return op(device=device, src=input_image) + return clic._set_ramp_y(device, input_image) @plugin_function @@ -4269,7 +3974,7 @@ def set_ramp_z(input_image: Image, device: Optional[Device] = None) -> Image: ---------- input_image: Image Input image to process. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4281,9 +3986,7 @@ def set_ramp_z(input_image: Image, device: Optional[Device] = None) -> Image: [1] https://clij.github.io/clij2-docs/reference_setRampZ """ - from ._pyclesperanto import _set_ramp_z as op - - return op(device=device, src=input_image) + return clic._set_ramp_z(device, input_image) @plugin_function @@ -4296,9 +3999,11 @@ def set_row( ---------- input_image: Image Input image to process. - row: int = 0 - value: float = 0 - device: Optional[Device] = None + row: int (= 0) + + value: float (= 0) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4310,9 +4015,7 @@ def set_row( [1] https://clij.github.io/clij2-docs/reference_setRow """ - from ._pyclesperanto import _set_row as op - - return op(device=device, src=input_image, row=int(row), value=float(value)) + return clic._set_row(device, input_image, int(row), float(value)) @plugin_function @@ -4328,22 +4031,21 @@ def set_nonzero_pixels_to_pixelindex( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output image. - offset: int = 1 + offset: int (= 1) Offset value to start the indexing. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _set_nonzero_pixels_to_pixelindex as op - - return op(device=device, src=input_image, dst=output_image, offset=int(offset)) + return clic._set_nonzero_pixels_to_pixelindex( + device, input_image, output_image, int(offset) + ) @plugin_function @@ -4358,9 +4060,9 @@ def set_where_x_equals_y( ---------- input_image: Image Input image to process. - value: float = 0 + value: float (= 0) Value to set. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4372,9 +4074,7 @@ def set_where_x_equals_y( [1] https://clij.github.io/clij2-docs/reference_setWhereXequalsY """ - from ._pyclesperanto import _set_where_x_equals_y as op - - return op(device=device, src=input_image, value=float(value)) + return clic._set_where_x_equals_y(device, input_image, float(value)) @plugin_function @@ -4389,9 +4089,9 @@ def set_where_x_greater_than_y( ---------- input_image: Image Input image to process. - value: float = 0 + value: float (= 0) Value to set. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4403,9 +4103,7 @@ def set_where_x_greater_than_y( [1] https://clij.github.io/clij2-docs/reference_setWhereXgreaterThanY """ - from ._pyclesperanto import _set_where_x_greater_than_y as op - - return op(device=device, src=input_image, value=float(value)) + return clic._set_where_x_greater_than_y(device, input_image, float(value)) @plugin_function @@ -4420,9 +4118,9 @@ def set_where_x_smaller_than_y( ---------- input_image: Image Input image to process. - value: float = 0 + value: float (= 0) Value to set. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4434,9 +4132,7 @@ def set_where_x_smaller_than_y( [1] https://clij.github.io/clij2-docs/reference_setWhereXsmallerThanY """ - from ._pyclesperanto import _set_where_x_smaller_than_y as op - - return op(device=device, src=input_image, value=float(value)) + return clic._set_where_x_smaller_than_y(device, input_image, float(value)) @plugin_function @@ -4453,20 +4149,17 @@ def sign( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _sign as op - - return op(device=device, src=input_image, dst=output_image) + return clic._sign(device, input_image, output_image) @plugin_function(category=["combine", "binarize", "in assistant"]) @@ -4485,9 +4178,9 @@ def smaller( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4499,9 +4192,7 @@ def smaller( [1] https://clij.github.io/clij2-docs/reference_smaller """ - from ._pyclesperanto import _smaller as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._smaller(device, input_image0, input_image1, output_image) @plugin_function(category=["binarize", "in assistant"]) @@ -4518,11 +4209,11 @@ def smaller_constant( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 + scalar: float (= 0) Scalar used in the comparison. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4534,9 +4225,7 @@ def smaller_constant( [1] https://clij.github.io/clij2-docs/reference_smallerConstant """ - from ._pyclesperanto import _smaller_constant as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._smaller_constant(device, input_image, output_image, float(scalar)) @plugin_function(category=["combine", "binarize", "in assistant"]) @@ -4555,9 +4244,9 @@ def smaller_or_equal( First input image to process. input_image1: Image Second input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4569,9 +4258,7 @@ def smaller_or_equal( [1] https://clij.github.io/clij2-docs/reference_smallerOrEqual """ - from ._pyclesperanto import _smaller_or_equal as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._smaller_or_equal(device, input_image0, input_image1, output_image) @plugin_function(category=["binarize", "in assistant"]) @@ -4588,11 +4275,11 @@ def smaller_or_equal_constant( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 + scalar: float (= 0) Scalar used in the comparison. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4604,9 +4291,9 @@ def smaller_or_equal_constant( [1] https://clij.github.io/clij2-docs/reference_smallerOrEqualConstant """ - from ._pyclesperanto import _smaller_or_equal_constant as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._smaller_or_equal_constant( + device, input_image, output_image, float(scalar) + ) @plugin_function( @@ -4624,9 +4311,9 @@ def sobel( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4638,9 +4325,7 @@ def sobel( [1] https://clij.github.io/clij2-docs/reference_sobel """ - from ._pyclesperanto import _sobel as op - - return op(device=device, src=input_image, dst=output_image) + return clic._sobel(device, input_image, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -4655,20 +4340,17 @@ def square_root( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _square_root as op - - return op(device=device, src=input_image, dst=output_image) + return clic._square_root(device, input_image, output_image) @plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) @@ -4684,9 +4366,9 @@ def std_z_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4698,9 +4380,7 @@ def std_z_projection( [1] https://clij.github.io/clij2-docs/reference_standardDeviationZProjection """ - from ._pyclesperanto import _std_z_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._std_z_projection(device, input_image, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -4716,11 +4396,11 @@ def subtract_image_from_scalar( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - scalar: float = 0 + scalar: float (= 0) Scalar used in the subtraction. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4732,9 +4412,9 @@ def subtract_image_from_scalar( [1] https://clij.github.io/clij2-docs/reference_subtractImageFromScalar """ - from ._pyclesperanto import _subtract_image_from_scalar as op - - return op(device=device, src=input_image, dst=output_image, scalar=float(scalar)) + return clic._subtract_image_from_scalar( + device, input_image, output_image, float(scalar) + ) @plugin_function @@ -4752,24 +4432,19 @@ def sum_reduction_x( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - blocksize: int = 256 + blocksize: int (= 256) Blocksize value. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _sum_reduction_x as op - - return op( - device=device, src=input_image, dst=output_image, blocksize=int(blocksize) - ) + return clic._sum_reduction_x(device, input_image, output_image, int(blocksize)) @plugin_function(category=["projection"]) @@ -4784,9 +4459,9 @@ def sum_x_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4798,9 +4473,7 @@ def sum_x_projection( [1] https://clij.github.io/clij2-docs/reference_sumXProjection """ - from ._pyclesperanto import _sum_x_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._sum_x_projection(device, input_image, output_image) @plugin_function(category=["projection"]) @@ -4815,9 +4488,9 @@ def sum_y_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4829,9 +4502,7 @@ def sum_y_projection( [1] https://clij.github.io/clij2-docs/reference_sumYProjection """ - from ._pyclesperanto import _sum_y_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._sum_y_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) @@ -4846,9 +4517,9 @@ def sum_z_projection( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4860,9 +4531,7 @@ def sum_z_projection( [1] https://clij.github.io/clij2-docs/reference_sumZProjection """ - from ._pyclesperanto import _sum_z_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._sum_z_projection(device, input_image, output_image) @plugin_function(category=["transform"]) @@ -4877,9 +4546,9 @@ def transpose_xy( ---------- input_image: Image The input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4891,9 +4560,7 @@ def transpose_xy( [1] https://clij.github.io/clij2-docs/reference_transposeXY """ - from ._pyclesperanto import _transpose_xy as op - - return op(device=device, src=input_image, dst=output_image) + return clic._transpose_xy(device, input_image, output_image) @plugin_function(category=["transform"]) @@ -4908,9 +4575,9 @@ def transpose_xz( ---------- input_image: Image The input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4922,9 +4589,7 @@ def transpose_xz( [1] https://clij.github.io/clij2-docs/reference_transposeXZ """ - from ._pyclesperanto import _transpose_xz as op - - return op(device=device, src=input_image, dst=output_image) + return clic._transpose_xz(device, input_image, output_image) @plugin_function(category=["transform"]) @@ -4939,9 +4604,9 @@ def transpose_yz( ---------- input_image: Image The input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4953,9 +4618,7 @@ def transpose_yz( [1] https://clij.github.io/clij2-docs/reference_transposeYZ """ - from ._pyclesperanto import _transpose_yz as op - - return op(device=device, src=input_image, dst=output_image) + return clic._transpose_yz(device, input_image, output_image) @plugin_function @@ -4971,9 +4634,9 @@ def undefined_to_zero( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -4985,9 +4648,7 @@ def undefined_to_zero( [1] https://clij.github.io/clij2-docs/reference_undefinedToZero """ - from ._pyclesperanto import _undefined_to_zero as op - - return op(device=device, src=input_image, dst=output_image) + return clic._undefined_to_zero(device, input_image, output_image) @plugin_function(category=["filter", "edge detection", "in assistant"]) @@ -5007,15 +4668,15 @@ def variance_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -5027,19 +4688,12 @@ def variance_box( [1] https://clij.github.io/clij2-docs/reference_varianceBox """ - from ._pyclesperanto import _variance_box as op - warnings.warn( - "variance_box : This function is deprecated. Consider using variance() instead.", + "pyclesperanto.variance_box: This function is deprecated. Consider using variance() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._variance_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -5062,15 +4716,15 @@ def variance_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -5082,19 +4736,12 @@ def variance_sphere( [1] https://clij.github.io/clij2-docs/reference_varianceSphere """ - from ._pyclesperanto import _variance_sphere as op - warnings.warn( - "variance_sphere : This function is deprecated. Consider using variance() instead.", + "pyclesperanto.variance_sphere: This function is deprecated. Consider using variance() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._variance_sphere( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -5116,17 +4763,17 @@ def variance( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius size along x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius size along y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius size along z axis. - connectivity: str = "box" + connectivity: str (= "box") Filter neigborhood - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -5136,19 +4783,17 @@ def variance( References ---------- [1] https://clij.github.io/clij2-docs/reference_varianceBox - [2] https://clij.github.io/clij2-docs/reference_varianceSphere + [2] https://clij.github.io/clij2-docs/reference_varianceSphere """ - from ._pyclesperanto import _variance as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._variance( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -5166,9 +4811,9 @@ def write_values_to_positions( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -5180,9 +4825,7 @@ def write_values_to_positions( [1] https://clij.github.io/clij2-docs/reference_writeValuesToPositions """ - from ._pyclesperanto import _write_values_to_positions as op - - return op(device=device, src=input_image, dst=output_image) + return clic._write_values_to_positions(device, input_image, output_image) @plugin_function(category=["projection", "in assistant"]) @@ -5199,20 +4842,17 @@ def x_position_of_maximum_x_projection( ---------- input_image: Image Input image stack - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) altitude map - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _x_position_of_maximum_x_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._x_position_of_maximum_x_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant"]) @@ -5229,20 +4869,17 @@ def x_position_of_minimum_x_projection( ---------- input_image: Image Input image stack - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) altitude map - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _x_position_of_minimum_x_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._x_position_of_minimum_x_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant"]) @@ -5259,20 +4896,17 @@ def y_position_of_maximum_y_projection( ---------- input_image: Image Input image stack - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) altitude map - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _y_position_of_maximum_y_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._y_position_of_maximum_y_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant"]) @@ -5289,20 +4923,17 @@ def y_position_of_minimum_y_projection( ---------- input_image: Image Input image stack - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) altitude map - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _y_position_of_minimum_y_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._y_position_of_minimum_y_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant"]) @@ -5319,20 +4950,17 @@ def z_position_of_maximum_z_projection( ---------- input_image: Image Input image stack - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) altitude map - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _z_position_of_maximum_z_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._z_position_of_maximum_z_projection(device, input_image, output_image) @plugin_function(category=["projection", "in assistant"]) @@ -5349,17 +4977,14 @@ def z_position_of_minimum_z_projection( ---------- input_image: Image Input image stack - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) altitude map - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _z_position_of_minimum_z_projection as op - - return op(device=device, src=input_image, dst=output_image) + return clic._z_position_of_minimum_z_projection(device, input_image, output_image) diff --git a/pyclesperanto/_tier2.py b/pyclesperanto/_tier2.py index 382b2bd0..e85dfd70 100644 --- a/pyclesperanto/_tier2.py +++ b/pyclesperanto/_tier2.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier2.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier2.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function(category=["combine", "in assistant", "bia-bob-suggestion"]) def absolute_difference( @@ -29,9 +31,9 @@ def absolute_difference( The input image to be subtracted from. input_image1: Image The input image which is subtracted. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -43,9 +45,7 @@ def absolute_difference( [1] https://clij.github.io/clij2-docs/reference_absoluteDifference """ - from ._pyclesperanto import _absolute_difference as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._absolute_difference(device, input_image0, input_image1, output_image) @plugin_function(category=["combine", "in assistant"]) @@ -64,9 +64,9 @@ def add_images( The first input image to added. input_image1: Image The second image to be added. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -78,9 +78,7 @@ def add_images( [1] https://clij.github.io/clij2-docs/reference_addImages """ - from ._pyclesperanto import _add_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._add_images(device, input_image0, input_image1, output_image) @plugin_function(category=["filter", "background removal", "in assistant"]) @@ -98,15 +96,15 @@ def bottom_hat_box( ---------- input_image: Image The input image where the background is subtracted from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - radius_x: int = 1 + radius_x: int (= 1) Radius of the background determination region in X. - radius_y: int = 1 + radius_y: int (= 1) Radius of the background determination region in Y. - radius_z: int = 1 + radius_z: int (= 1) Radius of the background determination region in Z. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -118,19 +116,12 @@ def bottom_hat_box( [1] https://clij.github.io/clij2-docs/reference_bottomHatBox """ - from ._pyclesperanto import _bottom_hat_box as op - warnings.warn( - "bottom_hat_box : This method is deprecated. Consider using bottom_hat() instead.", + "pyclesperanto.bottom_hat_box: This method is deprecated. Consider using bottom_hat() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._bottom_hat_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -151,15 +142,15 @@ def bottom_hat_sphere( ---------- input_image: Image The input image where the background is subtracted from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - radius_x: float = 1 + radius_x: float (= 1) Radius of the background determination region in X. - radius_y: float = 1 + radius_y: float (= 1) Radius of the background determination region in Y. - radius_z: float = 1 + radius_z: float (= 1) Radius of the background determination region in Z. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -171,19 +162,17 @@ def bottom_hat_sphere( [1] https://clij.github.io/clij2-docs/reference_bottomHatSphere """ - from ._pyclesperanto import _bottom_hat_sphere as op - warnings.warn( - "bottom_hat_sphere : This method is deprecated. Consider using bottom_hat() instead.", + "pyclesperanto.bottom_hat_sphere: This method is deprecated. Consider using bottom_hat() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), + return clic._bottom_hat_sphere( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), ) @@ -205,17 +194,17 @@ def bottom_hat( ---------- input_image: Image The input image where the background is subtracted from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - radius_x: float = 1 + radius_x: float (= 1) Radius of the background determination region in X. - radius_y: float = 1 + radius_y: float (= 1) Radius of the background determination region in Y. - radius_z: float = 1 + radius_z: float (= 1) Radius of the background determination region in Z. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere" - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -225,19 +214,17 @@ def bottom_hat( References ---------- [1] https://clij.github.io/clij2-docs/reference_bottomHatBox - [2] https://clij.github.io/clij2-docs/reference_bottomHatSphere + [2] https://clij.github.io/clij2-docs/reference_bottomHatSphere """ - from ._pyclesperanto import _bottom_hat as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), - connectivity=connectivity, + return clic._bottom_hat( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), + str(connectivity), ) @@ -256,13 +243,13 @@ def clip( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - min_intensity: Optional[float] = None + min_intensity: Optional[float] (= None) new, lower limit of the intensity range - max_intensity: Optional[float] = None + max_intensity: Optional[float] (= None) new, upper limit of the intensity range - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -274,15 +261,7 @@ def clip( [1] https://numpy.org/doc/stable/reference/generated/numpy.clip.html """ - from ._pyclesperanto import _clip as op - - return op( - device=device, - src=input_image, - dst=output_image, - min_intensity=float(min_intensity) if min_intensity is not None else None, - max_intensity=float(max_intensity) if max_intensity is not None else None, - ) + return clic._clip(device, input_image, output_image, min_intensity, max_intensity) @plugin_function(category=["filter", "in assistant"]) @@ -301,36 +280,28 @@ def closing_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius along the x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _closing_box as op - warnings.warn( - "closing_box : This method is deprecated. Consider using closing() instead.", + "pyclesperanto.closing_box: This method is deprecated. Consider using closing() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._closing_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -350,36 +321,28 @@ def closing_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius along the x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _closing_sphere as op - warnings.warn( - "closing_sphere : This method is deprecated. Consider using closing() instead.", + "pyclesperanto.closing_sphere: This method is deprecated. Consider using closing() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._closing_sphere( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -400,35 +363,32 @@ def closing( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius along the x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere" - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _closing as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._closing( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -449,9 +409,9 @@ def concatenate_along_x( First input image. input_image1: Image Second input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -463,9 +423,7 @@ def concatenate_along_x( [1] https://clij.github.io/clij2-docs/reference_combineHorizontally """ - from ._pyclesperanto import _concatenate_along_x as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._concatenate_along_x(device, input_image0, input_image1, output_image) @plugin_function( @@ -485,9 +443,9 @@ def concatenate_along_y( First input image. input_image1: Image Second input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -499,9 +457,7 @@ def concatenate_along_y( [1] https://clij.github.io/clij2-docs/reference_combineVertically """ - from ._pyclesperanto import _concatenate_along_y as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._concatenate_along_y(device, input_image0, input_image1, output_image) @plugin_function( @@ -521,9 +477,9 @@ def concatenate_along_z( First input image. input_image1: Image Second input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -535,9 +491,7 @@ def concatenate_along_z( [1] https://clij.github.io/clij2-docs/reference_concatenateStacks """ - from ._pyclesperanto import _concatenate_along_z as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._concatenate_along_z(device, input_image0, input_image1, output_image) @plugin_function(category=["bia-bob-suggestion"]) @@ -556,10 +510,11 @@ def count_touching_neighbors( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - ignore_background: bool = True - device: Optional[Device] = None + ignore_background: bool (= True) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -571,13 +526,8 @@ def count_touching_neighbors( [1] https://clij.github.io/clij2-docs/reference_countTouchingNeighbors """ - from ._pyclesperanto import _count_touching_neighbors as op - - return op( - device=device, - src=input_image, - dst=output_image, - ignore_background=bool(ignore_background), + return clic._count_touching_neighbors( + device, input_image, output_image, ignore_background ) @@ -595,24 +545,19 @@ def crop_border( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - border_size: int = 1 + border_size: int (= 1) Border size to crop. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _crop_border as op - - return op( - device=device, src=input_image, dst=output_image, border_size=int(border_size) - ) + return clic._crop_border(device, input_image, output_image, int(border_size)) @plugin_function( @@ -632,15 +577,15 @@ def divide_by_gaussian_background( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - sigma_x: float = 2 + sigma_x: float (= 2) Gaussian sigma value along x. - sigma_y: float = 2 + sigma_y: float (= 2) Gaussian sigma value along y. - sigma_z: float = 2 + sigma_z: float (= 2) Gaussian sigma value along z. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -652,15 +597,13 @@ def divide_by_gaussian_background( [1] https://clij.github.io/clij2-docs/reference_divideByGaussianBackground """ - from ._pyclesperanto import _divide_by_gaussian_background as op - - return op( - device=device, - src=input_image, - dst=output_image, - sigma_x=float(sigma_x), - sigma_y=float(sigma_y), - sigma_z=float(sigma_z), + return clic._divide_by_gaussian_background( + device, + input_image, + output_image, + float(sigma_x), + float(sigma_y), + float(sigma_z), ) @@ -676,20 +619,17 @@ def degrees_to_radians( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _degrees_to_radians as op - - return op(device=device, src=input_image, dst=output_image) + return clic._degrees_to_radians(device, input_image, output_image) @plugin_function(category=["binarize", "in assistant"]) @@ -709,15 +649,15 @@ def detect_maxima_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius along the x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -729,19 +669,12 @@ def detect_maxima_box( [1] https://clij.github.io/clij2-docs/reference_detectMaximaBox """ - from ._pyclesperanto import _detect_maxima_box as op - warnings.warn( - "detect_maxima_box : This method is deprecated. Consider using detect_maxima() instead.", + "pyclesperanto.detect_maxima_box: This method is deprecated. Consider using detect_maxima() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._detect_maxima_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -763,17 +696,17 @@ def detect_maxima( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius along the x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere" - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -783,19 +716,17 @@ def detect_maxima( References ---------- [1] https://clij.github.io/clij2-docs/reference_detectMaximaBox - [2] https://clij.github.io/clij2-docs/reference_detectMaximaSphere + [2] https://clij.github.io/clij2-docs/reference_detectMaximaSphere """ - from ._pyclesperanto import _detect_maxima as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._detect_maxima( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -816,15 +747,15 @@ def detect_minima_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius along the x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -836,19 +767,12 @@ def detect_minima_box( [1] https://clij.github.io/clij2-docs/reference_detectMinimaBox """ - from ._pyclesperanto import _detect_minima_box as op - warnings.warn( - "detect_minima_box : This method is deprecated. Consider using detect_minima() instead.", + "pyclesperanto.detect_minima_box: This method is deprecated. Consider using detect_minima() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._detect_minima_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -870,17 +794,17 @@ def detect_minima( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius along the x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere" - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -890,19 +814,17 @@ def detect_minima( References ---------- [1] https://clij.github.io/clij2-docs/reference_detectMinimaBox - [2] https://clij.github.io/clij2-docs/reference_detectMinimaSphere + [2] https://clij.github.io/clij2-docs/reference_detectMinimaSphere """ - from ._pyclesperanto import _detect_minima as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._detect_minima( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -927,21 +849,21 @@ def difference_of_gaussian( ---------- input_image: Image The input image to be processed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - sigma1_x: float = 2 + sigma1_x: float (= 2) Sigma of the first Gaussian filter in x - sigma1_y: float = 2 + sigma1_y: float (= 2) Sigma of the first Gaussian filter in y - sigma1_z: float = 2 + sigma1_z: float (= 2) Sigma of the first Gaussian filter in z - sigma2_x: float = 2 + sigma2_x: float (= 2) Sigma of the second Gaussian filter in x - sigma2_y: float = 2 + sigma2_y: float (= 2) Sigma of the second Gaussian filter in y - sigma2_z: float = 2 + sigma2_z: float (= 2) Sigma of the second Gaussian filter in z - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -953,18 +875,16 @@ def difference_of_gaussian( [1] https://clij.github.io/clij2-docs/reference_differenceOfGaussian3D """ - from ._pyclesperanto import _difference_of_gaussian as op - - return op( - device=device, - src=input_image, - dst=output_image, - sigma1_x=float(sigma1_x), - sigma1_y=float(sigma1_y), - sigma1_z=float(sigma1_z), - sigma2_x=float(sigma2_x), - sigma2_y=float(sigma2_y), - sigma2_z=float(sigma2_z), + return clic._difference_of_gaussian( + device, + input_image, + output_image, + float(sigma1_x), + float(sigma1_y), + float(sigma1_z), + float(sigma2_x), + float(sigma2_y), + float(sigma2_z), ) @@ -981,9 +901,9 @@ def extend_labeling_via_voronoi( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -995,9 +915,7 @@ def extend_labeling_via_voronoi( [1] https://clij.github.io/clij2-docs/reference_extendLabelingViaVoronoi """ - from ._pyclesperanto import _extend_labeling_via_voronoi as op - - return op(device=device, src=input_image, dst=output_image) + return clic._extend_labeling_via_voronoi(device, input_image, output_image) @plugin_function(category=["filter"]) @@ -1014,9 +932,9 @@ def invert( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1028,9 +946,7 @@ def invert( [1] https://clij.github.io/clij2-docs/reference_invert """ - from ._pyclesperanto import _invert as op - - return op(device=device, src=input_image, dst=output_image) + return clic._invert(device, input_image, output_image) @plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) @@ -1047,9 +963,9 @@ def label_spots( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1061,9 +977,7 @@ def label_spots( [1] https://clij.github.io/clij2-docs/reference_labelSpots """ - from ._pyclesperanto import _label_spots as op - - return op(device=device, src=input_image, dst=output_image) + return clic._label_spots(device, input_image, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -1078,20 +992,17 @@ def large_hessian_eigenvalue( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _large_hessian_eigenvalue as op - - return op(device=device, src=input_image, dst=output_image) + return clic._large_hessian_eigenvalue(device, input_image, output_image) @plugin_function @@ -1103,7 +1014,7 @@ def maximum_of_all_pixels(input_image: Image, device: Optional[Device] = None) - ---------- input_image: Image Input image to process. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1115,9 +1026,7 @@ def maximum_of_all_pixels(input_image: Image, device: Optional[Device] = None) - [1] https://clij.github.io/clij2-docs/reference_maximumOfAllPixels """ - from ._pyclesperanto import _maximum_of_all_pixels as op - - return op(device=device, src=input_image) + return clic._maximum_of_all_pixels(device, input_image) @plugin_function @@ -1129,7 +1038,7 @@ def minimum_of_all_pixels(input_image: Image, device: Optional[Device] = None) - ---------- input_image: Image Input image to process. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1141,9 +1050,7 @@ def minimum_of_all_pixels(input_image: Image, device: Optional[Device] = None) - [1] https://clij.github.io/clij2-docs/reference_minimumOfAllPixels """ - from ._pyclesperanto import _minimum_of_all_pixels as op - - return op(device=device, src=input_image) + return clic._minimum_of_all_pixels(device, input_image) @plugin_function @@ -1159,7 +1066,7 @@ def minimum_of_masked_pixels( Input image to process. mask: Image Input - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1171,9 +1078,7 @@ def minimum_of_masked_pixels( [1] https://clij.github.io/clij2-docs/reference_minimumOfMaskedPixels """ - from ._pyclesperanto import _minimum_of_masked_pixels as op - - return op(device=device, src=input_image, mask=mask) + return clic._minimum_of_masked_pixels(device, input_image, mask) @plugin_function(category=["filter", "in assistant"]) @@ -1192,36 +1097,28 @@ def opening_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 0 + radius_x: int (= 0) Radius along the x axis. - radius_y: int = 0 + radius_y: int (= 0) Radius along the y axis. - radius_z: int = 0 + radius_z: int (= 0) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _opening_box as op - warnings.warn( - "opening_box : This method is deprecated. Consider using opening() instead.", + "pyclesperanto.opening_box: This method is deprecated. Consider using opening() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._opening_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -1241,36 +1138,33 @@ def opening_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: float = 1 + radius_x: float (= 1) Radius along the x axis. - radius_y: float = 1 + radius_y: float (= 1) Radius along the y axis. - radius_z: float = 0 + radius_z: float (= 0) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _opening_sphere as op - warnings.warn( - "opening_sphere : This method is deprecated. Consider using opening() instead.", + "pyclesperanto.opening_sphere: This method is deprecated. Consider using opening() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), + return clic._opening_sphere( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), ) @@ -1291,35 +1185,32 @@ def opening( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: float = 1 + radius_x: float (= 1) Radius along the x axis. - radius_y: float = 1 + radius_y: float (= 1) Radius along the y axis. - radius_z: float = 0 + radius_z: float (= 0) Radius along the z axis. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere" - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _opening as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), - connectivity=connectivity, + return clic._opening( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), + str(connectivity), ) @@ -1335,20 +1226,17 @@ def radians_to_degrees( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _radians_to_degrees as op - - return op(device=device, src=input_image, dst=output_image) + return clic._radians_to_degrees(device, input_image, output_image) @plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) @@ -1364,9 +1252,9 @@ def reduce_labels_to_label_edges( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1378,9 +1266,7 @@ def reduce_labels_to_label_edges( [1] https://clij.github.io/clij2-docs/reference_reduceLabelsToLabelEdges """ - from ._pyclesperanto import _reduce_labels_to_label_edges as op - - return op(device=device, src=input_image, dst=output_image) + return clic._reduce_labels_to_label_edges(device, input_image, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -1395,20 +1281,17 @@ def small_hessian_eigenvalue( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _small_hessian_eigenvalue as op - - return op(device=device, src=input_image, dst=output_image) + return clic._small_hessian_eigenvalue(device, input_image, output_image) @plugin_function(category=["filter"]) @@ -1424,9 +1307,9 @@ def square( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1438,9 +1321,7 @@ def square( [1] https://numpy.org/doc/stable/reference/generated/numpy.square.html """ - from ._pyclesperanto import _square as op - - return op(device=device, src=input_image, dst=output_image) + return clic._square(device, input_image, output_image) @plugin_function(category=["combine", "in assistant", "bia-bob-suggestion"]) @@ -1458,9 +1339,9 @@ def squared_difference( First input image. input_image1: Image Second input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1472,9 +1353,7 @@ def squared_difference( [1] https://clij.github.io/clij2-docs/reference_squaredDifference """ - from ._pyclesperanto import _squared_difference as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._squared_difference(device, input_image0, input_image1, output_image) @plugin_function(category=["filter", "edge detection", "in assistant"]) @@ -1494,15 +1373,15 @@ def standard_deviation_box( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius along the x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius along the y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1514,19 +1393,12 @@ def standard_deviation_box( [1] https://clij.github.io/clij2-docs/reference_standardDeviationBox """ - from ._pyclesperanto import _standard_deviation_box as op - warnings.warn( - "standard_deviation_box : This method is deprecated. Consider using standard_deviation() instead.", + "pyclesperanto.standard_deviation_box: This method is deprecated. Consider using standard_deviation() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._standard_deviation_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -1549,15 +1421,15 @@ def standard_deviation_sphere( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius along the x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius along the y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1569,19 +1441,12 @@ def standard_deviation_sphere( [1] https://clij.github.io/clij2-docs/reference_standardDeviationSphere """ - from ._pyclesperanto import _standard_deviation_sphere as op - warnings.warn( - "standard_deviation_sphere : This method is deprecated. Consider using standard_deviation() instead.", + "pyclesperanto.standard_deviation_sphere: This method is deprecated. Consider using standard_deviation() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._standard_deviation_sphere( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -1605,17 +1470,17 @@ def standard_deviation( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - radius_x: int = 1 + radius_x: int (= 1) Radius along the x axis. - radius_y: int = 1 + radius_y: int (= 1) Radius along the y axis. - radius_z: int = 1 + radius_z: int (= 1) Radius along the z axis. - connectivity: str = "box" + connectivity: str (= "box") Neigborhood shape, "box" or "sphere" - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1625,19 +1490,17 @@ def standard_deviation( References ---------- [1] https://clij.github.io/clij2-docs/reference_standardDeviationBox - [2] https://clij.github.io/clij2-docs/reference_standardDeviationSphere + [2] https://clij.github.io/clij2-docs/reference_standardDeviationSphere """ - from ._pyclesperanto import _standard_deviation as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), - connectivity=connectivity, + return clic._standard_deviation( + device, + input_image, + output_image, + int(radius_x), + int(radius_y), + int(radius_z), + str(connectivity), ) @@ -1659,15 +1522,15 @@ def subtract_gaussian_background( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - sigma_x: float = 2 + sigma_x: float (= 2) Radius along the x axis. - sigma_y: float = 2 + sigma_y: float (= 2) Radius along the y axis. - sigma_z: float = 2 + sigma_z: float (= 2) Radius along the z axis. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1679,15 +1542,13 @@ def subtract_gaussian_background( [1] https://clij.github.io/clij2-docs/reference_subtractGaussianBackground """ - from ._pyclesperanto import _subtract_gaussian_background as op - - return op( - device=device, - src=input_image, - dst=output_image, - sigma_x=float(sigma_x), - sigma_y=float(sigma_y), - sigma_z=float(sigma_z), + return clic._subtract_gaussian_background( + device, + input_image, + output_image, + float(sigma_x), + float(sigma_y), + float(sigma_z), ) @@ -1706,9 +1567,9 @@ def subtract_images( First input image. input_image1: Image Second input image. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output result image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1720,9 +1581,7 @@ def subtract_images( [1] https://clij.github.io/clij2-docs/reference_subtractImages """ - from ._pyclesperanto import _subtract_images as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._subtract_images(device, input_image0, input_image1, output_image) @plugin_function @@ -1734,9 +1593,9 @@ def sum_of_all_pixels( Parameters ---------- - input_image: Optional[Image] = None + input_image: Optional[Image] (= None) Input image to process. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1748,9 +1607,7 @@ def sum_of_all_pixels( [1] https://clij.github.io/clij2-docs/reference_sumOfAllPixels """ - from ._pyclesperanto import _sum_of_all_pixels as op - - return op(device=device, src=input_image) + return clic._sum_of_all_pixels(device, input_image) @plugin_function(category=["filter", "background removal", "in assistant"]) @@ -1768,15 +1625,15 @@ def top_hat_box( ---------- input_image: Image The input image where the background is subtracted from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - radius_x: int = 1 + radius_x: int (= 1) Radius of the background determination region in X. - radius_y: int = 1 + radius_y: int (= 1) Radius of the background determination region in Y. - radius_z: int = 1 + radius_z: int (= 1) Radius of the background determination region in Z. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1788,19 +1645,12 @@ def top_hat_box( [1] https://clij.github.io/clij2-docs/reference_topHatBox """ - from ._pyclesperanto import _top_hat_box as op - warnings.warn( - "top_hat_box : This method is deprecated. Consider using top_hat() instead.", + "pyclesperanto.top_hat_box: This method is deprecated. Consider using top_hat() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=int(radius_x), - radius_y=int(radius_y), - radius_z=int(radius_z), + return clic._top_hat_box( + device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z) ) @@ -1821,15 +1671,15 @@ def top_hat_sphere( ---------- input_image: Image The input image where the background is subtracted from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - radius_x: float = 1 + radius_x: float (= 1) Radius of the background determination region in X. - radius_y: float = 1 + radius_y: float (= 1) Radius of the background determination region in Y. - radius_z: float = 1 + radius_z: float (= 1) Radius of the background determination region in Z. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1841,19 +1691,17 @@ def top_hat_sphere( [1] https://clij.github.io/clij2-docs/reference_topHatSphere """ - from ._pyclesperanto import _top_hat_sphere as op - warnings.warn( - "top_hat_sphere : This method is deprecated. Consider using top_hat() instead.", + "pyclesperanto.top_hat_sphere: This method is deprecated. Consider using top_hat() instead.", DeprecationWarning, ) - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), + return clic._top_hat_sphere( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), ) @@ -1875,17 +1723,17 @@ def top_hat( ---------- input_image: Image The input image where the background is subtracted from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) The output image where results are written into. - radius_x: float = 1 + radius_x: float (= 1) Radius of the background determination region in X. - radius_y: float = 1 + radius_y: float (= 1) Radius of the background determination region in Y. - radius_z: float = 1 + radius_z: float (= 1) Radius of the background determination region in Z. - connectivity: str = "box" + connectivity: str (= "box") Element shape, "box" or "sphere" - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -1895,17 +1743,15 @@ def top_hat( References ---------- [1] https://clij.github.io/clij2-docs/reference_topHatBox - [2] https://clij.github.io/clij2-docs/reference_topHatSphere + [2] https://clij.github.io/clij2-docs/reference_topHatSphere """ - from ._pyclesperanto import _top_hat as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius_x=float(radius_x), - radius_y=float(radius_y), - radius_z=float(radius_z), - connectivity=connectivity, + return clic._top_hat( + device, + input_image, + output_image, + float(radius_x), + float(radius_y), + float(radius_z), + str(connectivity), ) diff --git a/pyclesperanto/_tier3.py b/pyclesperanto/_tier3.py index 64e3e8d1..cb8da548 100644 --- a/pyclesperanto/_tier3.py +++ b/pyclesperanto/_tier3.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier3.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier3.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function def bounding_box(input_image: Image, device: Optional[Device] = None) -> list: @@ -22,7 +24,8 @@ def bounding_box(input_image: Image, device: Optional[Device] = None) -> list: Parameters ---------- input_image: Image - device: Optional[Device] = None + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -34,9 +37,7 @@ def bounding_box(input_image: Image, device: Optional[Device] = None) -> list: [1] https://clij.github.io/clij2-docs/reference_boundingBox """ - from ._pyclesperanto import _bounding_box as op - - return op(device=device, src=input_image) + return clic._bounding_box(device, input_image) @plugin_function @@ -47,7 +48,8 @@ def center_of_mass(input_image: Image, device: Optional[Device] = None) -> list: Parameters ---------- input_image: Image - device: Optional[Device] = None + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -59,9 +61,7 @@ def center_of_mass(input_image: Image, device: Optional[Device] = None) -> list: [1] https://clij.github.io/clij2-docs/reference_centerOfMass """ - from ._pyclesperanto import _center_of_mass as op - - return op(device=device, src=input_image) + return clic._center_of_mass(device, input_image) @plugin_function @@ -80,9 +80,12 @@ def exclude_labels( Parameters ---------- input_image: Image + list: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -94,9 +97,7 @@ def exclude_labels( [1] https://clij.github.io/clij2-docs/reference_excludeLabels """ - from ._pyclesperanto import _exclude_labels as op - - return op(device=device, src=input_image, list=list, dst=output_image) + return clic._exclude_labels(device, input_image, list, output_image) @plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) @@ -114,14 +115,16 @@ def exclude_labels_on_edges( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - exclude_x: bool = True + + output_image: Optional[Image] (= None) + + exclude_x: bool (= True) Exclude labels along min and max x - exclude_y: bool = True + exclude_y: bool (= True) Exclude labels along min and max y - exclude_z: bool = True + exclude_z: bool (= True) Exclude labels along min and max z - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -133,15 +136,8 @@ def exclude_labels_on_edges( [1] https://clij.github.io/clij2-docs/reference_excludeLabelsOnEdges """ - from ._pyclesperanto import _exclude_labels_on_edges as op - - return op( - device=device, - src=input_image, - dst=output_image, - exclude_x=bool(exclude_x), - exclude_y=bool(exclude_y), - exclude_z=bool(exclude_z), + return clic._exclude_labels_on_edges( + device, input_image, output_image, exclude_x, exclude_y, exclude_z ) @@ -160,20 +156,17 @@ def flag_existing_labels( ---------- input_image: Image a label image - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) binary vector, if given should have size 1*n with n = maximum label + 1 - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _flag_existing_labels as op - - return op(device=device, src=input_image, dst=output_image) + return clic._flag_existing_labels(device, input_image, output_image) @plugin_function(category=["filter", "in assistant"]) @@ -190,9 +183,12 @@ def gamma_correction( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - gamma: float = 1 - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + gamma: float (= 1) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -204,9 +200,7 @@ def gamma_correction( [1] https://clij.github.io/clij2-docs/reference_gammaCorrection """ - from ._pyclesperanto import _gamma_correction as op - - return op(device=device, src=input_image, dst=output_image, gamma=float(gamma)) + return clic._gamma_correction(device, input_image, output_image, float(gamma)) @plugin_function @@ -224,9 +218,12 @@ def generate_binary_overlap_matrix( Parameters ---------- input_image0: Image + input_image1: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -238,9 +235,9 @@ def generate_binary_overlap_matrix( [1] https://clij.github.io/clij2-docs/reference_generateBinaryOverlapMatrix """ - from ._pyclesperanto import _generate_binary_overlap_matrix as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._generate_binary_overlap_matrix( + device, input_image0, input_image1, output_image + ) @plugin_function(category=["bia-bob-suggestion"]) @@ -258,8 +255,10 @@ def generate_touch_matrix( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -271,9 +270,7 @@ def generate_touch_matrix( [1] https://clij.github.io/clij2-docs/reference_generateTouchMatrix """ - from ._pyclesperanto import _generate_touch_matrix as op - - return op(device=device, src=input_image, dst=output_image) + return clic._generate_touch_matrix(device, input_image, output_image) @plugin_function @@ -305,11 +302,16 @@ def histogram( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - nbins: int = 256 - min: Optional[float] = None - max: Optional[float] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + nbins: int (= 256) + + min: Optional[float] (= None) + + max: Optional[float] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -321,16 +323,7 @@ def histogram( [1] https://clij.github.io/clij2-docs/reference_histogram """ - from ._pyclesperanto import _histogram as op - - return op( - device=device, - src=input_image, - dst=output_image, - nbins=int(nbins), - min=float(min) if min is not None else None, - max=float(max) if max is not None else None, - ) + return clic._histogram(device, input_image, output_image, int(nbins), min, max) @plugin_function @@ -346,8 +339,10 @@ def jaccard_index( Parameters ---------- input_image0: Image + input_image1: Image - device: Optional[Device] = None + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -359,9 +354,7 @@ def jaccard_index( [1] https://clij.github.io/clij2-docs/reference_jaccardIndex """ - from ._pyclesperanto import _jaccard_index as op - - return op(device=device, src0=input_image0, src1=input_image1) + return clic._jaccard_index(device, input_image0, input_image1) @plugin_function(category=["bia-bob-suggestion"]) @@ -379,8 +372,10 @@ def labelled_spots_to_pointlist( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -392,9 +387,7 @@ def labelled_spots_to_pointlist( [1] https://clij.github.io/clij2-docs/reference_labelledSpotsToPointList """ - from ._pyclesperanto import _labelled_spots_to_pointlist as op - - return op(device=device, src=input_image, dst=output_image) + return clic._labelled_spots_to_pointlist(device, input_image, output_image) @plugin_function @@ -405,18 +398,15 @@ def maximum_position(input_image: Image, device: Optional[Device] = None) -> lis ---------- input_image: Image The image of which the position of the maximum of all pixels will be determined. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- list - """ - from ._pyclesperanto import _maximum_position as op - - return op(device=device, src=input_image) + return clic._maximum_position(device, input_image) @plugin_function @@ -427,7 +417,7 @@ def mean_of_all_pixels(input_image: Image, device: Optional[Device] = None) -> f ---------- input_image: Image The image of which the mean average of all pixels will be determined. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -439,9 +429,7 @@ def mean_of_all_pixels(input_image: Image, device: Optional[Device] = None) -> f [1] https://clij.github.io/clij2-docs/reference_meanOfAllPixels """ - from ._pyclesperanto import _mean_of_all_pixels as op - - return op(device=device, src=input_image) + return clic._mean_of_all_pixels(device, input_image) @plugin_function @@ -452,18 +440,15 @@ def minimum_position(input_image: Image, device: Optional[Device] = None) -> lis ---------- input_image: Image The image of which the position of the minimum of all pixels will be determined. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- list - """ - from ._pyclesperanto import _minimum_position as op - - return op(device=device, src=input_image) + return clic._minimum_position(device, input_image) @plugin_function @@ -484,33 +469,58 @@ def morphological_chan_vese( ---------- input_image: Image Input image to process. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output contour, can also be use to provide initialisation. - num_iter: int = 100 + num_iter: int (= 100) Number of iterations. - smoothing: int = 1 + smoothing: int (= 1) Number of - lambda1: float = 1 + lambda1: float (= 1) Lambda1. - lambda2: float = 1 + lambda2: float (= 1) Lambda2. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _morphological_chan_vese as op - - return op( - device=device, - src=input_image, - dst=output_image, - num_iter=int(num_iter), - smoothing=int(smoothing), - lambda1=float(lambda1), - lambda2=float(lambda2), + return clic._morphological_chan_vese( + device, + input_image, + output_image, + int(num_iter), + int(smoothing), + float(lambda1), + float(lambda2), ) + + +@plugin_function +def statistics_of_labelled_pixels( + input_image: Image, + intensity: Optional[Image] = None, + device: Optional[Device] = None, +) -> dict: + """Compute the bounding box, area (in pixels/voxels), minimum intensity, maximum + intensity, average intensity, standard deviation of the intensity, and some + shape descriptors of labelled objects in a label image and its corresponding + intensity image. The intensity image is optional and set to 0 if not provided. + + Parameters + ---------- + input_image: Image + Label image to compute the statistics. + intensity: Optional[Image] (= None) + Intensity image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + dict + """ + + return clic._statistics_of_labelled_pixels(device, input_image, intensity) diff --git a/pyclesperanto/_tier4.py b/pyclesperanto/_tier4.py index b85ab8e1..a8cb1509 100644 --- a/pyclesperanto/_tier4.py +++ b/pyclesperanto/_tier4.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier4.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier4.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function def label_bounding_box( @@ -24,8 +26,10 @@ def label_bounding_box( Parameters ---------- input_image: Image + label_id: int - device: Optional[Device] = None + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -37,9 +41,7 @@ def label_bounding_box( [1] https://clij.github.io/clij2-docs/reference_boundingBox """ - from ._pyclesperanto import _label_bounding_box as op - - return op(device=device, src=input_image, label_id=int(label_id)) + return clic._label_bounding_box(device, input_image, int(label_id)) @plugin_function(category=["in assistant", "combine", "bia-bob-suggestion"]) @@ -52,8 +54,10 @@ def mean_squared_error( Parameters ---------- input_image0: Image + input_image1: Image - device: Optional[Device] = None + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -65,9 +69,7 @@ def mean_squared_error( [1] https://clij.github.io/clij2-docs/reference_meanSquaredError """ - from ._pyclesperanto import _mean_squared_error as op - - return op(device=device, src0=input_image0, src1=input_image1) + return clic._mean_squared_error(device, input_image0, input_image1) @plugin_function @@ -83,8 +85,10 @@ def spots_to_pointlist( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -96,9 +100,7 @@ def spots_to_pointlist( [1] https://clij.github.io/clij2-docs/reference_spotsToPointList """ - from ._pyclesperanto import _spots_to_pointlist as op - - return op(device=device, src=input_image, dst=output_image) + return clic._spots_to_pointlist(device, input_image, output_image) @plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) @@ -116,10 +118,12 @@ def relabel_sequential( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - blocksize: int = 4096 + + output_image: Optional[Image] (= None) + + blocksize: int (= 4096) Renumbering is done in blocks for performance reasons. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -131,11 +135,7 @@ def relabel_sequential( [1] https://clij.github.io/clij2-docs/reference_closeIndexGapsInLabelMap """ - from ._pyclesperanto import _relabel_sequential as op - - return op( - device=device, src=input_image, dst=output_image, blocksize=int(blocksize) - ) + return clic._relabel_sequential(device, input_image, output_image, int(blocksize)) @plugin_function(category=["binarize", "in assistant", "bia-bob-suggestion"]) @@ -150,8 +150,10 @@ def threshold_otsu( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -161,10 +163,8 @@ def threshold_otsu( References ---------- [1] https://clij.github.io/clij2-docs/reference_thresholdOtsu - [2] https://scikit-image.org/docs/dev/api/skimage.filters.html#skimage.filters.threshold_otsu - [3] https://ieeexplore.ieee.org/document/4310076 + [2] https://scikit-image.org/docs/dev/api/skimage.filters.html#skimage.filters.threshold_otsu + [3] https://ieeexplore.ieee.org/document/4310076 """ - from ._pyclesperanto import _threshold_otsu as op - - return op(device=device, src=input_image, dst=output_image) + return clic._threshold_otsu(device, input_image, output_image) diff --git a/pyclesperanto/_tier5.py b/pyclesperanto/_tier5.py index a4c36689..34fc009c 100644 --- a/pyclesperanto/_tier5.py +++ b/pyclesperanto/_tier5.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier5.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier5.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function(category=["combine"]) def array_equal( @@ -24,8 +26,10 @@ def array_equal( Parameters ---------- input_image0: Image + input_image1: Image - device: Optional[Device] = None + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -37,9 +41,7 @@ def array_equal( [1] https://numpy.org/doc/stable/reference/generated/numpy.array_equal.html """ - from ._pyclesperanto import _array_equal as op - - return op(device=device, src0=input_image0, src1=input_image1) + return clic._array_equal(device, input_image0, input_image1) @plugin_function( @@ -66,20 +68,17 @@ def combine_labels( label image to add labels to. input_image1: Image label image to add labels from. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _combine_labels as op - - return op(device=device, src0=input_image0, src1=input_image1, dst=output_image) + return clic._combine_labels(device, input_image0, input_image1, output_image) @plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) @@ -96,11 +95,11 @@ def connected_components_labeling( ---------- input_image: Image Binary image to label. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label image. - connectivity: str = 'box' + connectivity: str (= 'box') Defines pixel neighborhood relationship, "box" or "sphere". - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -112,8 +111,6 @@ def connected_components_labeling( [1] https://clij.github.io/clij2-docs/reference_connectedComponentsLabelingBox """ - from ._pyclesperanto import _connected_components_labeling as op - - return op( - device=device, src=input_image, dst=output_image, connectivity=connectivity + return clic._connected_components_labeling( + device, input_image, output_image, str(connectivity) ) diff --git a/pyclesperanto/_tier6.py b/pyclesperanto/_tier6.py index 71504567..09b666ef 100644 --- a/pyclesperanto/_tier6.py +++ b/pyclesperanto/_tier6.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier6.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier6.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) def dilate_labels( @@ -28,21 +30,19 @@ def dilate_labels( ---------- input_image: Image label image to erode - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) result - radius: int = 2 - device: Optional[Device] = None + radius: int (= 2) + + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _dilate_labels as op - - return op(device=device, src=input_image, dst=output_image, radius=int(radius)) + return clic._dilate_labels(device, input_image, output_image, int(radius)) @plugin_function(category=["label processing", "in assistant"]) @@ -62,28 +62,21 @@ def erode_labels( ---------- input_image: Image result - output_image: Optional[Image] = None - radius: int = 1 - relabel: bool = False + output_image: Optional[Image] (= None) + + radius: int (= 1) + + relabel: bool (= False) and all label indices exist. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _erode_labels as op - - return op( - device=device, - src=input_image, - dst=output_image, - radius=int(radius), - relabel=bool(relabel), - ) + return clic._erode_labels(device, input_image, output_image, int(radius), relabel) @plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) @@ -103,11 +96,11 @@ def gauss_otsu_labeling( ---------- input_image0: Image intensity image to add labels - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label image. - outline_sigma: float = 0 + outline_sigma: float (= 0) Gaussian blur sigma along all axes - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -117,16 +110,11 @@ def gauss_otsu_labeling( References ---------- [1] https://ieeexplore.ieee.org/document/4310076 - [2] https://en.wikipedia.org/wiki/Connected-component_labeling + [2] https://en.wikipedia.org/wiki/Connected-component_labeling """ - from ._pyclesperanto import _gauss_otsu_labeling as op - - return op( - device=device, - src0=input_image0, - dst=output_image, - outline_sigma=float(outline_sigma), + return clic._gauss_otsu_labeling( + device, input_image0, output_image, float(outline_sigma) ) @@ -144,9 +132,12 @@ def masked_voronoi_labeling( Parameters ---------- input_image: Image + mask: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -158,9 +149,7 @@ def masked_voronoi_labeling( [1] https://clij.github.io/clij2-docs/reference_maskedVoronoiLabeling """ - from ._pyclesperanto import _masked_voronoi_labeling as op - - return op(device=device, src=input_image, mask=mask, dst=output_image) + return clic._masked_voronoi_labeling(device, input_image, mask, output_image) @plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) @@ -176,8 +165,10 @@ def voronoi_labeling( Parameters ---------- input_image: Image - output_image: Optional[Image] = None - device: Optional[Device] = None + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -189,6 +180,4 @@ def voronoi_labeling( [1] https://clij.github.io/clij2-docs/reference_voronoiLabeling """ - from ._pyclesperanto import _voronoi_labeling as op - - return op(device=device, src=input_image, dst=output_image) + return clic._voronoi_labeling(device, input_image, output_image) diff --git a/pyclesperanto/_tier7.py b/pyclesperanto/_tier7.py index 0c90c6e6..86dcf25f 100644 --- a/pyclesperanto/_tier7.py +++ b/pyclesperanto/_tier7.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier7.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier7.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function def affine_transform( @@ -31,32 +33,24 @@ def affine_transform( ---------- input_image: Image Input Array to be transformed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output Array. - transform_matrix: Optional[list] = None + transform_matrix: Optional[list] (= None) Affine transformation matrix (3x3 or 4x4). - interpolate: bool = False + interpolate: bool (= False) If true, bi/trilinear interpolation will be applied, if hardware allows. - resize: bool = False + resize: bool (= False) Automatically determines the size of the output depending on the rotation angles. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _affine_transform as op - - return op( - device=device, - src=input_image, - dst=output_image, - transform_matrix=transform_matrix, - interpolate=bool(interpolate), - resize=bool(resize), + return clic._affine_transform( + device, input_image, output_image, transform_matrix, interpolate, resize ) @@ -82,13 +76,13 @@ def eroded_otsu_labeling( ---------- input_image: Image Input Array to be transformed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output Array. - number_of_erosions: int = 5 + number_of_erosions: int (= 5) Number of iteration of erosion. - outline_sigma: float = 2 + outline_sigma: float (= 2) Gaussian blur sigma applied before Otsu thresholding. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -98,17 +92,11 @@ def eroded_otsu_labeling( References ---------- [1] https://github.com/biovoxxel/bv3dbox (BV_LabelSplitter.java#L83) - [2] https://zenodo.org/badge/latestdoi/434949702 + [2] https://zenodo.org/badge/latestdoi/434949702 """ - from ._pyclesperanto import _eroded_otsu_labeling as op - - return op( - device=device, - src=input_image, - dst=output_image, - number_of_erosions=int(number_of_erosions), - outline_sigma=float(outline_sigma), + return clic._eroded_otsu_labeling( + device, input_image, output_image, int(number_of_erosions), float(outline_sigma) ) @@ -135,50 +123,47 @@ def rigid_transform( ---------- input_image: Image Input Array to be transformed. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output Array. - translate_x: float = 0 + translate_x: float (= 0) Translation along x axis in pixels. - translate_y: float = 0 + translate_y: float (= 0) Translation along y axis in pixels. - translate_z: float = 0 + translate_z: float (= 0) Translation along z axis in pixels. - angle_x: float = 0 + angle_x: float (= 0) Rotation around x axis in radians. - angle_y: float = 0 + angle_y: float (= 0) Rotation around y axis in radians. - angle_z: float = 0 + angle_z: float (= 0) Rotation around z axis in radians. - centered: bool = True + centered: bool (= True) If true, rotate image around center, else around the origin. - interpolate: bool = False + interpolate: bool (= False) If true, bi/trilinear interpolation will be applied, if hardware allows. - resize: bool = False + resize: bool (= False) Automatically determines the size of the output depending on the rotation angles. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _rigid_transform as op - - return op( - device=device, - src=input_image, - dst=output_image, - translate_x=float(translate_x), - translate_y=float(translate_y), - translate_z=float(translate_z), - angle_x=float(angle_x), - angle_y=float(angle_y), - angle_z=float(angle_z), - centered=bool(centered), - interpolate=bool(interpolate), - resize=bool(resize), + return clic._rigid_transform( + device, + input_image, + output_image, + float(translate_x), + float(translate_y), + float(translate_z), + float(angle_x), + float(angle_y), + float(angle_z), + centered, + interpolate, + resize, ) @@ -202,41 +187,38 @@ def rotate( ---------- input_image: Image Input Array to be rotated. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output Array. - angle_x: float = 0 + angle_x: float (= 0) Rotation around x axis in degrees. - angle_y: float = 0 + angle_y: float (= 0) Rotation around y axis in degrees. - angle_z: float = 0 + angle_z: float (= 0) Rotation around z axis in degrees. - centered: bool = True + centered: bool (= True) If true, rotate image around center, else around the origin. - interpolate: bool = False + interpolate: bool (= False) If true, bi/trilinear interpolation will be applied, if hardware allows. - resize: bool = False + resize: bool (= False) Automatically determines the size of the output depending on the rotation angles. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _rotate as op - - return op( - device=device, - src=input_image, - dst=output_image, - angle_x=float(angle_x), - angle_y=float(angle_y), - angle_z=float(angle_z), - centered=bool(centered), - interpolate=bool(interpolate), - resize=bool(resize), + return clic._rotate( + device, + input_image, + output_image, + float(angle_x), + float(angle_y), + float(angle_z), + centered, + interpolate, + resize, ) @@ -258,41 +240,38 @@ def scale( ---------- input_image: Image Input Array to be scaleded. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output Array. - factor_x: float = 1 + factor_x: float (= 1) Scaling along x axis. - factor_y: float = 1 + factor_y: float (= 1) Scaling along y axis. - factor_z: float = 1 + factor_z: float (= 1) Scaling along z axis. - centered: bool = True + centered: bool (= True) If true, the image will be scaled to the center of the image. - interpolate: bool = False + interpolate: bool (= False) If true, bi/trilinear interplation will be applied. - resize: bool = False + resize: bool (= False) Automatically determines output size image. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _scale as op - - return op( - device=device, - src=input_image, - dst=output_image, - factor_x=float(factor_x), - factor_y=float(factor_y), - factor_z=float(factor_z), - centered=bool(centered), - interpolate=bool(interpolate), - resize=bool(resize), + return clic._scale( + device, + input_image, + output_image, + float(factor_x), + float(factor_y), + float(factor_z), + centered, + interpolate, + resize, ) @@ -312,35 +291,32 @@ def translate( ---------- input_image: Image Input Array to be translated. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output Array. - translate_x: float = 0 + translate_x: float (= 0) Translation along x axis in pixels. - translate_y: float = 0 + translate_y: float (= 0) Translation along y axis in pixels. - translate_z: float = 0 + translate_z: float (= 0) Translation along z axis in pixels. - interpolate: bool = False + interpolate: bool (= False) If true, bi/trilinear interplation will be applied. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _translate as op - - return op( - device=device, - src=input_image, - dst=output_image, - translate_x=float(translate_x), - translate_y=float(translate_y), - translate_z=float(translate_z), - interpolate=bool(interpolate), + return clic._translate( + device, + input_image, + output_image, + float(translate_x), + float(translate_y), + float(translate_z), + interpolate, ) @@ -361,22 +337,19 @@ def closing_labels( ---------- input_image: Image Input label Array. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label Array. - radius: int = 0 + radius: int (= 0) Radius size for the closing. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _closing_labels as op - - return op(device=device, src=input_image, dst=output_image, radius=int(radius)) + return clic._closing_labels(device, input_image, output_image, int(radius)) @plugin_function @@ -394,20 +367,19 @@ def erode_connected_labels( ---------- input_image: Image result - output_image: Optional[Image] = None - radius: int = 1 - device: Optional[Device] = None + output_image: Optional[Image] (= None) + + radius: int (= 1) + + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _erode_connected_labels as op - - return op(device=device, src=input_image, dst=output_image, radius=int(radius)) + return clic._erode_connected_labels(device, input_image, output_image, int(radius)) @plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) @@ -427,22 +399,19 @@ def opening_labels( ---------- input_image: Image Input label Array. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label Array. - radius: int = 0 + radius: int (= 0) Radius size for the opening. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _opening_labels as op - - return op(device=device, src=input_image, dst=output_image, radius=int(radius)) + return clic._opening_labels(device, input_image, output_image, int(radius)) @plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) @@ -464,13 +433,13 @@ def voronoi_otsu_labeling( ---------- input_image: Image Input intensity Array. - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label Array. - spot_sigma: float = 2 + spot_sigma: float (= 2) Controls how close detected cells can be. - outline_sigma: float = 2 + outline_sigma: float (= 2) Controls how precise segmented objects are outlined. - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns @@ -480,16 +449,10 @@ def voronoi_otsu_labeling( References ---------- [1] https://clij.github.io/clij2-docs/reference_voronoiOtsuLabeling - [2] https://ieeexplore.ieee.org/document/4310076 - [3] https://en.wikipedia.org/wiki/Voronoi_diagram + [2] https://ieeexplore.ieee.org/document/4310076 + [3] https://en.wikipedia.org/wiki/Voronoi_diagram """ - from ._pyclesperanto import _voronoi_otsu_labeling as op - - return op( - device=device, - src=input_image, - dst=output_image, - spot_sigma=float(spot_sigma), - outline_sigma=float(outline_sigma), + return clic._voronoi_otsu_labeling( + device, input_image, output_image, float(spot_sigma), float(outline_sigma) ) diff --git a/pyclesperanto/_tier8.py b/pyclesperanto/_tier8.py index a59f5763..bb01118b 100644 --- a/pyclesperanto/_tier8.py +++ b/pyclesperanto/_tier8.py @@ -1,8 +1,8 @@ # -# This code is auto-generated from 'tier8.hpp' file, using 'gencle' script. -# Do not edit manually. +# This code is auto-generated from CLIc 'cle::tier8.hpp' file, do not edit manually. # +import importlib import warnings from typing import Optional @@ -12,6 +12,8 @@ from ._core import Device from ._decorators import plugin_function +clic = importlib.import_module("._pyclesperanto", package="pyclesperanto") + @plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) def smooth_labels( @@ -29,22 +31,19 @@ def smooth_labels( ---------- input_image: Image Input label image - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label image - radius: int = 0 + radius: int (= 0) Smoothing - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _smooth_labels as op - - return op(device=device, src=input_image, dst=output_image, radius=int(radius)) + return clic._smooth_labels(device, input_image, output_image, int(radius)) @plugin_function @@ -62,19 +61,16 @@ def smooth_connected_labels( ---------- input_image: Image Input label image - output_image: Optional[Image] = None + output_image: Optional[Image] (= None) Output label image - radius: int = 0 + radius: int (= 0) Smoothing - device: Optional[Device] = None + device: Optional[Device] (= None) Device to perform the operation on. Returns ------- Image - """ - from ._pyclesperanto import _smooth_connected_labels as op - - return op(device=device, src=input_image, dst=output_image, radius=int(radius)) + return clic._smooth_connected_labels(device, input_image, output_image, int(radius)) diff --git a/pyclesperanto/_version.py b/pyclesperanto/_version.py index 8308ad42..3c5c91a3 100644 --- a/pyclesperanto/_version.py +++ b/pyclesperanto/_version.py @@ -1,10 +1,10 @@ # pyclesperanto version -VERSION_CODE = 0, 11, 1 +VERSION_CODE = 0, 12, 0 VERSION_STATUS = "" VERSION = ".".join(str(x) for x in VERSION_CODE) + VERSION_STATUS # clic version -CLIC_VERSION_CODE = 0, 11, 1 +CLIC_VERSION_CODE = 0, 12, 0 CLIC_VERSION_STATUS = "" CLIC_VERSION = ".".join(str(x) for x in CLIC_VERSION_CODE) + CLIC_VERSION_STATUS diff --git a/pyproject.toml b/pyproject.toml index 911a8d57..c3ee4da1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] build-backend = "scikit_build_core.build" -requires = ["setuptools", "wheel", "scikit-build-core>=0.8.2", "pybind11"] +requires = ["setuptools", "wheel", "scikit-build-core>=0.10.1", "pybind11"] [tool.scikit-build] build-dir = "build/{wheel_tag}" @@ -34,15 +34,16 @@ classifiers = [ "Topic :: Scientific/Engineering :: Information Analysis", ] dependencies = [ - "numpy; python_version >='3.7'", - "toolz; python_version >='3.7'", - "matplotlib; python_version >='3.7'", + "numpy", + "toolz", + "matplotlib", ] description = "GPU-accelerated image processing in python using OpenCL" name = "pyclesperanto" readme = "README.md" requires-python = ">=3.8" -version = "0.11.1" +version = "0.12.0" + [project.urls] Documentation = "https://clesperanto.github.io/pyclesperanto/" @@ -81,16 +82,13 @@ test-requires = ["pytest", "pytest-cov", "pytest-benchmark", "scikit-image"] [tool.cibuildwheel.linux] before-all = ["bash {package}/scripts/build-opencl-linux.sh"] repair-wheel-command = "auditwheel show {wheel} && auditwheel repair --lib-sdir .libs -w {dest_dir} {wheel}" -# skip = ["cp27-*", "pp*", "*-musllinux*", "*_i686"] [tool.cibuildwheel.windows] before-all = "bash {package}/scripts/build-opencl-windows.sh" environment = { SKBUILD_CMAKE_ARGS = "-DOpenCL_LIBRARIES:FILEPATH='C:/Program Files/OpenCL-ICD-Loader/lib/OpenCL.lib';-DOpenCL_INCLUDE_DIRS:PATH='C:/Program Files/OpenCL-ICD-Loader/include/'" } -# skip = ["cp27-*", "pp*", "*-win32"] [tool.cibuildwheel.macos] environment = { MACOSX_DEPLOYMENT_TARGET = '10.14' } -# skip = ["cp27-*", "pp*", "*_universal2"] [tool.isort] profile = "black" diff --git a/src/wrapper/array_.cpp b/src/wrapper/array_.cpp index 8bced778..d7cca9b5 100644 --- a/src/wrapper/array_.cpp +++ b/src/wrapper/array_.cpp @@ -62,7 +62,7 @@ py::array_t read_region(const cle::Array &array, const py py::buffer_info info = np_array.request(); void *data = info.ptr; size_t size = info.size * info.itemsize; - array.read(data, region_, origin_); + array.readTo(data, region_, origin_); return np_array; } @@ -84,7 +84,7 @@ void write_region(cle::Array &array, const py::array_t &v py::buffer_info info = value.request(); const void *data = info.ptr; size_t size = info.size * info.itemsize; - array.write(data, region_, origin_); + array.writeFrom(data, region_, origin_); } void copy_region(const cle::Array &array, const cle::Array::Pointer &dst, @@ -108,7 +108,7 @@ void copy_region(const cle::Array &array, const cle::Array::Pointer &dst, { invert_tuple(region_obj.cast(), ®ion_); } - array.copy(dst, region_, src_origin_, dst_origin_); + array.copyTo(dst, region_, src_origin_, dst_origin_); } py::object get_np_dtype(const cle::Array::Pointer &array) diff --git a/src/wrapper/tier1_.cpp b/src/wrapper/tier1_.cpp index a7f334ac..3df31a3f 100644 --- a/src/wrapper/tier1_.cpp +++ b/src/wrapper/tier1_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier1.hpp" @@ -8,711 +6,567 @@ namespace py = pybind11; auto tier1_(py::module &m) -> void { - - -m.def("_absolute", &cle::tier1::absolute_func, "Call absolute from C++.", +m.def("_absolute", &cle::tier1::absolute_func, "Call cle::tier1::absolute_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_add_images_weighted", &cle::tier1::add_images_weighted_func, "Call add_images_weighted from C++.", + m.def("_add_images_weighted", &cle::tier1::add_images_weighted_func, "Call cle::tier1::add_images_weighted_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst"), py::arg("factor0"), py::arg("factor1")); - -m.def("_add_image_and_scalar", &cle::tier1::add_image_and_scalar_func, "Call add_image_and_scalar from C++.", + m.def("_add_image_and_scalar", &cle::tier1::add_image_and_scalar_func, "Call cle::tier1::add_image_and_scalar_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_binary_and", &cle::tier1::binary_and_func, "Call binary_and from C++.", + m.def("_binary_and", &cle::tier1::binary_and_func, "Call cle::tier1::binary_and_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_binary_edge_detection", &cle::tier1::binary_edge_detection_func, "Call binary_edge_detection from C++.", + m.def("_binary_edge_detection", &cle::tier1::binary_edge_detection_func, "Call cle::tier1::binary_edge_detection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_binary_not", &cle::tier1::binary_not_func, "Call binary_not from C++.", + m.def("_binary_not", &cle::tier1::binary_not_func, "Call cle::tier1::binary_not_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_binary_or", &cle::tier1::binary_or_func, "Call binary_or from C++.", + m.def("_binary_or", &cle::tier1::binary_or_func, "Call cle::tier1::binary_or_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_binary_subtract", &cle::tier1::binary_subtract_func, "Call binary_subtract from C++.", + m.def("_binary_subtract", &cle::tier1::binary_subtract_func, "Call cle::tier1::binary_subtract_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_binary_xor", &cle::tier1::binary_xor_func, "Call binary_xor from C++.", + m.def("_binary_xor", &cle::tier1::binary_xor_func, "Call cle::tier1::binary_xor_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_binary_supinf", &cle::tier1::binary_supinf_func, "Call binary_supinf from C++.", + m.def("_binary_supinf", &cle::tier1::binary_supinf_func, "Call cle::tier1::binary_supinf_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_binary_infsup", &cle::tier1::binary_infsup_func, "Call binary_infsup from C++.", + m.def("_binary_infsup", &cle::tier1::binary_infsup_func, "Call cle::tier1::binary_infsup_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_block_enumerate", &cle::tier1::block_enumerate_func, "Call block_enumerate from C++.", + m.def("_block_enumerate", &cle::tier1::block_enumerate_func, "Call cle::tier1::block_enumerate_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst"), py::arg("blocksize")); - -m.def("_convolve", &cle::tier1::convolve_func, "Call convolve from C++.", + m.def("_convolve", &cle::tier1::convolve_func, "Call cle::tier1::convolve_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_copy", &cle::tier1::copy_func, "Call copy from C++.", + m.def("_copy", &cle::tier1::copy_func, "Call cle::tier1::copy_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_copy_slice", &cle::tier1::copy_slice_func, "Call copy_slice from C++.", + m.def("_copy_slice", &cle::tier1::copy_slice_func, "Call cle::tier1::copy_slice_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("slice")); - -m.def("_copy_horizontal_slice", &cle::tier1::copy_horizontal_slice_func, "Call copy_horizontal_slice from C++.", + m.def("_copy_horizontal_slice", &cle::tier1::copy_horizontal_slice_func, "Call cle::tier1::copy_horizontal_slice_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("slice")); - -m.def("_copy_vertical_slice", &cle::tier1::copy_vertical_slice_func, "Call copy_vertical_slice from C++.", + m.def("_copy_vertical_slice", &cle::tier1::copy_vertical_slice_func, "Call cle::tier1::copy_vertical_slice_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("slice")); - -m.def("_crop", &cle::tier1::crop_func, "Call crop from C++.", + m.def("_crop", &cle::tier1::crop_func, "Call cle::tier1::crop_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("start_x"), py::arg("start_y"), py::arg("start_z"), py::arg("width"), py::arg("height"), py::arg("depth")); - -m.def("_cubic_root", &cle::tier1::cubic_root_func, "Call cubic_root from C++.", + m.def("_cubic_root", &cle::tier1::cubic_root_func, "Call cle::tier1::cubic_root_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_detect_label_edges", &cle::tier1::detect_label_edges_func, "Call detect_label_edges from C++.", + m.def("_detect_label_edges", &cle::tier1::detect_label_edges_func, "Call cle::tier1::detect_label_edges_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_dilate_box", &cle::tier1::dilate_box_func, "Call dilate_box from C++.", + m.def("_dilate_box", &cle::tier1::dilate_box_func, "Call cle::tier1::dilate_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_dilate_sphere", &cle::tier1::dilate_sphere_func, "Call dilate_sphere from C++.", + m.def("_dilate_sphere", &cle::tier1::dilate_sphere_func, "Call cle::tier1::dilate_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_dilate", &cle::tier1::dilate_func, "Call dilate from C++.", + m.def("_dilate", &cle::tier1::dilate_func, "Call cle::tier1::dilate_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("connectivity")); - -m.def("_divide_images", &cle::tier1::divide_images_func, "Call divide_images from C++.", + m.def("_divide_images", &cle::tier1::divide_images_func, "Call cle::tier1::divide_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_divide_scalar_by_image", &cle::tier1::divide_scalar_by_image_func, "Call divide_scalar_by_image from C++.", + m.def("_divide_scalar_by_image", &cle::tier1::divide_scalar_by_image_func, "Call cle::tier1::divide_scalar_by_image_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_equal", &cle::tier1::equal_func, "Call equal from C++.", + m.def("_equal", &cle::tier1::equal_func, "Call cle::tier1::equal_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_equal_constant", &cle::tier1::equal_constant_func, "Call equal_constant from C++.", + m.def("_equal_constant", &cle::tier1::equal_constant_func, "Call cle::tier1::equal_constant_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_erode_box", &cle::tier1::erode_box_func, "Call erode_box from C++.", + m.def("_erode_box", &cle::tier1::erode_box_func, "Call cle::tier1::erode_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_erode_sphere", &cle::tier1::erode_sphere_func, "Call erode_sphere from C++.", + m.def("_erode_sphere", &cle::tier1::erode_sphere_func, "Call cle::tier1::erode_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_erode", &cle::tier1::erode_func, "Call erode from C++.", + m.def("_erode", &cle::tier1::erode_func, "Call cle::tier1::erode_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("connectivity")); - -m.def("_exponential", &cle::tier1::exponential_func, "Call exponential from C++.", + m.def("_exponential", &cle::tier1::exponential_func, "Call cle::tier1::exponential_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_flip", &cle::tier1::flip_func, "Call flip from C++.", + m.def("_flip", &cle::tier1::flip_func, "Call cle::tier1::flip_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("flip_x"), py::arg("flip_y"), py::arg("flip_z")); - -m.def("_gaussian_blur", &cle::tier1::gaussian_blur_func, "Call gaussian_blur from C++.", + m.def("_gaussian_blur", &cle::tier1::gaussian_blur_func, "Call cle::tier1::gaussian_blur_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("sigma_x"), py::arg("sigma_y"), py::arg("sigma_z")); - -m.def("_generate_distance_matrix", &cle::tier1::generate_distance_matrix_func, "Call generate_distance_matrix from C++.", + m.def("_generate_distance_matrix", &cle::tier1::generate_distance_matrix_func, "Call cle::tier1::generate_distance_matrix_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_gradient_x", &cle::tier1::gradient_x_func, "Call gradient_x from C++.", + m.def("_gradient_x", &cle::tier1::gradient_x_func, "Call cle::tier1::gradient_x_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_gradient_y", &cle::tier1::gradient_y_func, "Call gradient_y from C++.", + m.def("_gradient_y", &cle::tier1::gradient_y_func, "Call cle::tier1::gradient_y_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_gradient_z", &cle::tier1::gradient_z_func, "Call gradient_z from C++.", + m.def("_gradient_z", &cle::tier1::gradient_z_func, "Call cle::tier1::gradient_z_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_greater", &cle::tier1::greater_func, "Call greater from C++.", + m.def("_greater", &cle::tier1::greater_func, "Call cle::tier1::greater_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_greater_constant", &cle::tier1::greater_constant_func, "Call greater_constant from C++.", + m.def("_greater_constant", &cle::tier1::greater_constant_func, "Call cle::tier1::greater_constant_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_greater_or_equal", &cle::tier1::greater_or_equal_func, "Call greater_or_equal from C++.", + m.def("_greater_or_equal", &cle::tier1::greater_or_equal_func, "Call cle::tier1::greater_or_equal_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_greater_or_equal_constant", &cle::tier1::greater_or_equal_constant_func, "Call greater_or_equal_constant from C++.", + m.def("_greater_or_equal_constant", &cle::tier1::greater_or_equal_constant_func, "Call cle::tier1::greater_or_equal_constant_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_hessian_eigenvalues", &cle::tier1::hessian_eigenvalues_func, "Call hessian_eigenvalues from C++.", + m.def("_hessian_eigenvalues", &cle::tier1::hessian_eigenvalues_func, "Call cle::tier1::hessian_eigenvalues_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("small_eigenvalue"), py::arg("middle_eigenvalue"), py::arg("large_eigenvalue")); - -m.def("_laplace_box", &cle::tier1::laplace_box_func, "Call laplace_box from C++.", + m.def("_laplace_box", &cle::tier1::laplace_box_func, "Call cle::tier1::laplace_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_laplace_diamond", &cle::tier1::laplace_diamond_func, "Call laplace_diamond from C++.", + m.def("_laplace_diamond", &cle::tier1::laplace_diamond_func, "Call cle::tier1::laplace_diamond_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_laplace", &cle::tier1::laplace_func, "Call laplace from C++.", + m.def("_laplace", &cle::tier1::laplace_func, "Call cle::tier1::laplace_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("connectivity")); - -m.def("_local_cross_correlation", &cle::tier1::local_cross_correlation_func, "Call local_cross_correlation from C++.", + m.def("_local_cross_correlation", &cle::tier1::local_cross_correlation_func, "Call cle::tier1::local_cross_correlation_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_logarithm", &cle::tier1::logarithm_func, "Call logarithm from C++.", + m.def("_logarithm", &cle::tier1::logarithm_func, "Call cle::tier1::logarithm_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_mask", &cle::tier1::mask_func, "Call mask from C++.", + m.def("_mask", &cle::tier1::mask_func, "Call cle::tier1::mask_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("mask"), py::arg("dst")); - -m.def("_mask_label", &cle::tier1::mask_label_func, "Call mask_label from C++.", + m.def("_mask_label", &cle::tier1::mask_label_func, "Call cle::tier1::mask_label_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst"), py::arg("label")); - -m.def("_maximum_image_and_scalar", &cle::tier1::maximum_image_and_scalar_func, "Call maximum_image_and_scalar from C++.", + m.def("_maximum_image_and_scalar", &cle::tier1::maximum_image_and_scalar_func, "Call cle::tier1::maximum_image_and_scalar_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_maximum_images", &cle::tier1::maximum_images_func, "Call maximum_images from C++.", + m.def("_maximum_images", &cle::tier1::maximum_images_func, "Call cle::tier1::maximum_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_maximum_box", &cle::tier1::maximum_box_func, "Call maximum_box from C++.", + m.def("_maximum_box", &cle::tier1::maximum_box_func, "Call cle::tier1::maximum_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_maximum", &cle::tier1::maximum_func, "Call maximum from C++.", + m.def("_maximum", &cle::tier1::maximum_func, "Call cle::tier1::maximum_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_maximum_x_projection", &cle::tier1::maximum_x_projection_func, "Call maximum_x_projection from C++.", + m.def("_maximum_x_projection", &cle::tier1::maximum_x_projection_func, "Call cle::tier1::maximum_x_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_maximum_y_projection", &cle::tier1::maximum_y_projection_func, "Call maximum_y_projection from C++.", + m.def("_maximum_y_projection", &cle::tier1::maximum_y_projection_func, "Call cle::tier1::maximum_y_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_maximum_z_projection", &cle::tier1::maximum_z_projection_func, "Call maximum_z_projection from C++.", + m.def("_maximum_z_projection", &cle::tier1::maximum_z_projection_func, "Call cle::tier1::maximum_z_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_mean_box", &cle::tier1::mean_box_func, "Call mean_box from C++.", + m.def("_mean_box", &cle::tier1::mean_box_func, "Call cle::tier1::mean_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_mean_sphere", &cle::tier1::mean_sphere_func, "Call mean_sphere from C++.", + m.def("_mean_sphere", &cle::tier1::mean_sphere_func, "Call cle::tier1::mean_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_mean", &cle::tier1::mean_func, "Call mean from C++.", + m.def("_mean", &cle::tier1::mean_func, "Call cle::tier1::mean_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_mean_x_projection", &cle::tier1::mean_x_projection_func, "Call mean_x_projection from C++.", + m.def("_mean_x_projection", &cle::tier1::mean_x_projection_func, "Call cle::tier1::mean_x_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_mean_y_projection", &cle::tier1::mean_y_projection_func, "Call mean_y_projection from C++.", + m.def("_mean_y_projection", &cle::tier1::mean_y_projection_func, "Call cle::tier1::mean_y_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_mean_z_projection", &cle::tier1::mean_z_projection_func, "Call mean_z_projection from C++.", + m.def("_mean_z_projection", &cle::tier1::mean_z_projection_func, "Call cle::tier1::mean_z_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_median_box", &cle::tier1::median_box_func, "Call median_box from C++.", + m.def("_median_box", &cle::tier1::median_box_func, "Call cle::tier1::median_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_median_sphere", &cle::tier1::median_sphere_func, "Call median_sphere from C++.", + m.def("_median_sphere", &cle::tier1::median_sphere_func, "Call cle::tier1::median_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_median", &cle::tier1::median_func, "Call median from C++.", + m.def("_median", &cle::tier1::median_func, "Call cle::tier1::median_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_minimum_box", &cle::tier1::minimum_box_func, "Call minimum_box from C++.", + m.def("_minimum_box", &cle::tier1::minimum_box_func, "Call cle::tier1::minimum_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_minimum", &cle::tier1::minimum_func, "Call minimum from C++.", + m.def("_minimum", &cle::tier1::minimum_func, "Call cle::tier1::minimum_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_minimum_image_and_scalar", &cle::tier1::minimum_image_and_scalar_func, "Call minimum_image_and_scalar from C++.", + m.def("_minimum_image_and_scalar", &cle::tier1::minimum_image_and_scalar_func, "Call cle::tier1::minimum_image_and_scalar_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_minimum_images", &cle::tier1::minimum_images_func, "Call minimum_images from C++.", + m.def("_minimum_images", &cle::tier1::minimum_images_func, "Call cle::tier1::minimum_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_minimum_x_projection", &cle::tier1::minimum_x_projection_func, "Call minimum_x_projection from C++.", + m.def("_minimum_x_projection", &cle::tier1::minimum_x_projection_func, "Call cle::tier1::minimum_x_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_minimum_y_projection", &cle::tier1::minimum_y_projection_func, "Call minimum_y_projection from C++.", + m.def("_minimum_y_projection", &cle::tier1::minimum_y_projection_func, "Call cle::tier1::minimum_y_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_minimum_z_projection", &cle::tier1::minimum_z_projection_func, "Call minimum_z_projection from C++.", + m.def("_minimum_z_projection", &cle::tier1::minimum_z_projection_func, "Call cle::tier1::minimum_z_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_mode_box", &cle::tier1::mode_box_func, "Call mode_box from C++.", + m.def("_mode_box", &cle::tier1::mode_box_func, "Call cle::tier1::mode_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_mode_sphere", &cle::tier1::mode_sphere_func, "Call mode_sphere from C++.", + m.def("_mode_sphere", &cle::tier1::mode_sphere_func, "Call cle::tier1::mode_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_mode", &cle::tier1::mode_func, "Call mode from C++.", + m.def("_mode", &cle::tier1::mode_func, "Call cle::tier1::mode_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_modulo_images", &cle::tier1::modulo_images_func, "Call modulo_images from C++.", + m.def("_modulo_images", &cle::tier1::modulo_images_func, "Call cle::tier1::modulo_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_multiply_image_and_position", &cle::tier1::multiply_image_and_position_func, "Call multiply_image_and_position from C++.", + m.def("_multiply_image_and_position", &cle::tier1::multiply_image_and_position_func, "Call cle::tier1::multiply_image_and_position_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("dimension")); - -m.def("_multiply_image_and_scalar", &cle::tier1::multiply_image_and_scalar_func, "Call multiply_image_and_scalar from C++.", + m.def("_multiply_image_and_scalar", &cle::tier1::multiply_image_and_scalar_func, "Call cle::tier1::multiply_image_and_scalar_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_multiply_images", &cle::tier1::multiply_images_func, "Call multiply_images from C++.", + m.def("_multiply_images", &cle::tier1::multiply_images_func, "Call cle::tier1::multiply_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_nan_to_num", &cle::tier1::nan_to_num_func, "Call nan_to_num from C++.", + m.def("_nan_to_num", &cle::tier1::nan_to_num_func, "Call cle::tier1::nan_to_num_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("nan"), py::arg("posinf"), py::arg("neginf")); - -m.def("_nonzero_maximum_box", &cle::tier1::nonzero_maximum_box_func, "Call nonzero_maximum_box from C++.", + m.def("_nonzero_maximum_box", &cle::tier1::nonzero_maximum_box_func, "Call cle::tier1::nonzero_maximum_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1")); - -m.def("_nonzero_maximum_diamond", &cle::tier1::nonzero_maximum_diamond_func, "Call nonzero_maximum_diamond from C++.", + m.def("_nonzero_maximum_diamond", &cle::tier1::nonzero_maximum_diamond_func, "Call cle::tier1::nonzero_maximum_diamond_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1")); - -m.def("_nonzero_maximum", &cle::tier1::nonzero_maximum_func, "Call nonzero_maximum from C++.", + m.def("_nonzero_maximum", &cle::tier1::nonzero_maximum_func, "Call cle::tier1::nonzero_maximum_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1"), py::arg("connectivity")); - -m.def("_nonzero_minimum_box", &cle::tier1::nonzero_minimum_box_func, "Call nonzero_minimum_box from C++.", + m.def("_nonzero_minimum_box", &cle::tier1::nonzero_minimum_box_func, "Call cle::tier1::nonzero_minimum_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1")); - -m.def("_nonzero_minimum_diamond", &cle::tier1::nonzero_minimum_diamond_func, "Call nonzero_minimum_diamond from C++.", + m.def("_nonzero_minimum_diamond", &cle::tier1::nonzero_minimum_diamond_func, "Call cle::tier1::nonzero_minimum_diamond_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1")); - -m.def("_nonzero_minimum", &cle::tier1::nonzero_minimum_func, "Call nonzero_minimum from C++.", + m.def("_nonzero_minimum", &cle::tier1::nonzero_minimum_func, "Call cle::tier1::nonzero_minimum_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1"), py::arg("connectivity")); - -m.def("_not_equal", &cle::tier1::not_equal_func, "Call not_equal from C++.", + m.def("_not_equal", &cle::tier1::not_equal_func, "Call cle::tier1::not_equal_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_not_equal_constant", &cle::tier1::not_equal_constant_func, "Call not_equal_constant from C++.", + m.def("_not_equal_constant", &cle::tier1::not_equal_constant_func, "Call cle::tier1::not_equal_constant_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_paste", &cle::tier1::paste_func, "Call paste from C++.", + m.def("_paste", &cle::tier1::paste_func, "Call cle::tier1::paste_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("index_x"), py::arg("index_y"), py::arg("index_z")); - -m.def("_onlyzero_overwrite_maximum_box", &cle::tier1::onlyzero_overwrite_maximum_box_func, "Call onlyzero_overwrite_maximum_box from C++.", + m.def("_onlyzero_overwrite_maximum_box", &cle::tier1::onlyzero_overwrite_maximum_box_func, "Call cle::tier1::onlyzero_overwrite_maximum_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1")); - -m.def("_onlyzero_overwrite_maximum_diamond", &cle::tier1::onlyzero_overwrite_maximum_diamond_func, "Call onlyzero_overwrite_maximum_diamond from C++.", + m.def("_onlyzero_overwrite_maximum_diamond", &cle::tier1::onlyzero_overwrite_maximum_diamond_func, "Call cle::tier1::onlyzero_overwrite_maximum_diamond_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1")); - -m.def("_onlyzero_overwrite_maximum", &cle::tier1::onlyzero_overwrite_maximum_func, "Call onlyzero_overwrite_maximum from C++.", + m.def("_onlyzero_overwrite_maximum", &cle::tier1::onlyzero_overwrite_maximum_func, "Call cle::tier1::onlyzero_overwrite_maximum_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst0"), py::arg("dst1"), py::arg("connectivity")); - -m.def("_power", &cle::tier1::power_func, "Call power from C++.", + m.def("_power", &cle::tier1::power_func, "Call cle::tier1::power_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_power_images", &cle::tier1::power_images_func, "Call power_images from C++.", + m.def("_power_images", &cle::tier1::power_images_func, "Call cle::tier1::power_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_range", &cle::tier1::range_func, "Call range from C++.", + m.def("_range", &cle::tier1::range_func, "Call cle::tier1::range_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("start_x"), py::arg("stop_x"), py::arg("step_x"), py::arg("start_y"), py::arg("stop_y"), py::arg("step_y"), py::arg("start_z"), py::arg("stop_z"), py::arg("step_z")); - -m.def("_read_values_from_positions", &cle::tier1::read_values_from_positions_func, "Call read_values_from_positions from C++.", + m.def("_read_values_from_positions", &cle::tier1::read_values_from_positions_func, "Call cle::tier1::read_values_from_positions_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("list"), py::arg("dst")); - -m.def("_replace_values", &cle::tier1::replace_values_func, "Call replace_values from C++.", + m.def("_replace_values", &cle::tier1::replace_values_func, "Call cle::tier1::replace_values_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_replace_value", &cle::tier1::replace_value_func, "Call replace_value from C++.", + m.def("_replace_value", &cle::tier1::replace_value_func, "Call cle::tier1::replace_value_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar0"), py::arg("scalar1")); - -m.def("_maximum_sphere", &cle::tier1::maximum_sphere_func, "Call maximum_sphere from C++.", + m.def("_maximum_sphere", &cle::tier1::maximum_sphere_func, "Call cle::tier1::maximum_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_minimum_sphere", &cle::tier1::minimum_sphere_func, "Call minimum_sphere from C++.", + m.def("_minimum_sphere", &cle::tier1::minimum_sphere_func, "Call cle::tier1::minimum_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_multiply_matrix", &cle::tier1::multiply_matrix_func, "Call multiply_matrix from C++.", + m.def("_multiply_matrix", &cle::tier1::multiply_matrix_func, "Call cle::tier1::multiply_matrix_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_reciprocal", &cle::tier1::reciprocal_func, "Call reciprocal from C++.", + m.def("_reciprocal", &cle::tier1::reciprocal_func, "Call cle::tier1::reciprocal_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_set", &cle::tier1::set_func, "Call set from C++.", + m.def("_set", &cle::tier1::set_func, "Call cle::tier1::set_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("scalar")); - -m.def("_set_column", &cle::tier1::set_column_func, "Call set_column from C++.", + m.def("_set_column", &cle::tier1::set_column_func, "Call cle::tier1::set_column_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("column"), py::arg("value")); - -m.def("_set_image_borders", &cle::tier1::set_image_borders_func, "Call set_image_borders from C++.", + m.def("_set_image_borders", &cle::tier1::set_image_borders_func, "Call cle::tier1::set_image_borders_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("value")); - -m.def("_set_plane", &cle::tier1::set_plane_func, "Call set_plane from C++.", + m.def("_set_plane", &cle::tier1::set_plane_func, "Call cle::tier1::set_plane_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("plane"), py::arg("value")); - -m.def("_set_ramp_x", &cle::tier1::set_ramp_x_func, "Call set_ramp_x from C++.", + m.def("_set_ramp_x", &cle::tier1::set_ramp_x_func, "Call cle::tier1::set_ramp_x_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_set_ramp_y", &cle::tier1::set_ramp_y_func, "Call set_ramp_y from C++.", + m.def("_set_ramp_y", &cle::tier1::set_ramp_y_func, "Call cle::tier1::set_ramp_y_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_set_ramp_z", &cle::tier1::set_ramp_z_func, "Call set_ramp_z from C++.", + m.def("_set_ramp_z", &cle::tier1::set_ramp_z_func, "Call cle::tier1::set_ramp_z_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_set_row", &cle::tier1::set_row_func, "Call set_row from C++.", + m.def("_set_row", &cle::tier1::set_row_func, "Call cle::tier1::set_row_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("row"), py::arg("value")); - -m.def("_set_nonzero_pixels_to_pixelindex", &cle::tier1::set_nonzero_pixels_to_pixelindex_func, "Call set_nonzero_pixels_to_pixelindex from C++.", + m.def("_set_nonzero_pixels_to_pixelindex", &cle::tier1::set_nonzero_pixels_to_pixelindex_func, "Call cle::tier1::set_nonzero_pixels_to_pixelindex_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("offset")); - -m.def("_set_where_x_equals_y", &cle::tier1::set_where_x_equals_y_func, "Call set_where_x_equals_y from C++.", + m.def("_set_where_x_equals_y", &cle::tier1::set_where_x_equals_y_func, "Call cle::tier1::set_where_x_equals_y_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("value")); - -m.def("_set_where_x_greater_than_y", &cle::tier1::set_where_x_greater_than_y_func, "Call set_where_x_greater_than_y from C++.", + m.def("_set_where_x_greater_than_y", &cle::tier1::set_where_x_greater_than_y_func, "Call cle::tier1::set_where_x_greater_than_y_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("value")); - -m.def("_set_where_x_smaller_than_y", &cle::tier1::set_where_x_smaller_than_y_func, "Call set_where_x_smaller_than_y from C++.", + m.def("_set_where_x_smaller_than_y", &cle::tier1::set_where_x_smaller_than_y_func, "Call cle::tier1::set_where_x_smaller_than_y_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("value")); - -m.def("_sign", &cle::tier1::sign_func, "Call sign from C++.", + m.def("_sign", &cle::tier1::sign_func, "Call cle::tier1::sign_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_smaller", &cle::tier1::smaller_func, "Call smaller from C++.", + m.def("_smaller", &cle::tier1::smaller_func, "Call cle::tier1::smaller_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_smaller_constant", &cle::tier1::smaller_constant_func, "Call smaller_constant from C++.", + m.def("_smaller_constant", &cle::tier1::smaller_constant_func, "Call cle::tier1::smaller_constant_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_smaller_or_equal", &cle::tier1::smaller_or_equal_func, "Call smaller_or_equal from C++.", + m.def("_smaller_or_equal", &cle::tier1::smaller_or_equal_func, "Call cle::tier1::smaller_or_equal_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_smaller_or_equal_constant", &cle::tier1::smaller_or_equal_constant_func, "Call smaller_or_equal_constant from C++.", + m.def("_smaller_or_equal_constant", &cle::tier1::smaller_or_equal_constant_func, "Call cle::tier1::smaller_or_equal_constant_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_sobel", &cle::tier1::sobel_func, "Call sobel from C++.", + m.def("_sobel", &cle::tier1::sobel_func, "Call cle::tier1::sobel_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_square_root", &cle::tier1::square_root_func, "Call square_root from C++.", + m.def("_square_root", &cle::tier1::square_root_func, "Call cle::tier1::square_root_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_std_z_projection", &cle::tier1::std_z_projection_func, "Call std_z_projection from C++.", + m.def("_std_z_projection", &cle::tier1::std_z_projection_func, "Call cle::tier1::std_z_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_subtract_image_from_scalar", &cle::tier1::subtract_image_from_scalar_func, "Call subtract_image_from_scalar from C++.", + m.def("_subtract_image_from_scalar", &cle::tier1::subtract_image_from_scalar_func, "Call cle::tier1::subtract_image_from_scalar_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("scalar")); - -m.def("_sum_reduction_x", &cle::tier1::sum_reduction_x_func, "Call sum_reduction_x from C++.", + m.def("_sum_reduction_x", &cle::tier1::sum_reduction_x_func, "Call cle::tier1::sum_reduction_x_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("blocksize")); - -m.def("_sum_x_projection", &cle::tier1::sum_x_projection_func, "Call sum_x_projection from C++.", + m.def("_sum_x_projection", &cle::tier1::sum_x_projection_func, "Call cle::tier1::sum_x_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_sum_y_projection", &cle::tier1::sum_y_projection_func, "Call sum_y_projection from C++.", + m.def("_sum_y_projection", &cle::tier1::sum_y_projection_func, "Call cle::tier1::sum_y_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_sum_z_projection", &cle::tier1::sum_z_projection_func, "Call sum_z_projection from C++.", + m.def("_sum_z_projection", &cle::tier1::sum_z_projection_func, "Call cle::tier1::sum_z_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_transpose_xy", &cle::tier1::transpose_xy_func, "Call transpose_xy from C++.", + m.def("_transpose_xy", &cle::tier1::transpose_xy_func, "Call cle::tier1::transpose_xy_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_transpose_xz", &cle::tier1::transpose_xz_func, "Call transpose_xz from C++.", + m.def("_transpose_xz", &cle::tier1::transpose_xz_func, "Call cle::tier1::transpose_xz_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_transpose_yz", &cle::tier1::transpose_yz_func, "Call transpose_yz from C++.", + m.def("_transpose_yz", &cle::tier1::transpose_yz_func, "Call cle::tier1::transpose_yz_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_undefined_to_zero", &cle::tier1::undefined_to_zero_func, "Call undefined_to_zero from C++.", + m.def("_undefined_to_zero", &cle::tier1::undefined_to_zero_func, "Call cle::tier1::undefined_to_zero_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_variance_box", &cle::tier1::variance_box_func, "Call variance_box from C++.", + m.def("_variance_box", &cle::tier1::variance_box_func, "Call cle::tier1::variance_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_variance_sphere", &cle::tier1::variance_sphere_func, "Call variance_sphere from C++.", + m.def("_variance_sphere", &cle::tier1::variance_sphere_func, "Call cle::tier1::variance_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_variance", &cle::tier1::variance_func, "Call variance from C++.", + m.def("_variance", &cle::tier1::variance_func, "Call cle::tier1::variance_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_write_values_to_positions", &cle::tier1::write_values_to_positions_func, "Call write_values_to_positions from C++.", + m.def("_write_values_to_positions", &cle::tier1::write_values_to_positions_func, "Call cle::tier1::write_values_to_positions_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_x_position_of_maximum_x_projection", &cle::tier1::x_position_of_maximum_x_projection_func, "Call x_position_of_maximum_x_projection from C++.", + m.def("_x_position_of_maximum_x_projection", &cle::tier1::x_position_of_maximum_x_projection_func, "Call cle::tier1::x_position_of_maximum_x_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_x_position_of_minimum_x_projection", &cle::tier1::x_position_of_minimum_x_projection_func, "Call x_position_of_minimum_x_projection from C++.", + m.def("_x_position_of_minimum_x_projection", &cle::tier1::x_position_of_minimum_x_projection_func, "Call cle::tier1::x_position_of_minimum_x_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_y_position_of_maximum_y_projection", &cle::tier1::y_position_of_maximum_y_projection_func, "Call y_position_of_maximum_y_projection from C++.", + m.def("_y_position_of_maximum_y_projection", &cle::tier1::y_position_of_maximum_y_projection_func, "Call cle::tier1::y_position_of_maximum_y_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_y_position_of_minimum_y_projection", &cle::tier1::y_position_of_minimum_y_projection_func, "Call y_position_of_minimum_y_projection from C++.", + m.def("_y_position_of_minimum_y_projection", &cle::tier1::y_position_of_minimum_y_projection_func, "Call cle::tier1::y_position_of_minimum_y_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_z_position_of_maximum_z_projection", &cle::tier1::z_position_of_maximum_z_projection_func, "Call z_position_of_maximum_z_projection from C++.", + m.def("_z_position_of_maximum_z_projection", &cle::tier1::z_position_of_maximum_z_projection_func, "Call cle::tier1::z_position_of_maximum_z_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_z_position_of_minimum_z_projection", &cle::tier1::z_position_of_minimum_z_projection_func, "Call z_position_of_minimum_z_projection from C++.", + m.def("_z_position_of_minimum_z_projection", &cle::tier1::z_position_of_minimum_z_projection_func, "Call cle::tier1::z_position_of_minimum_z_projection_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - - } diff --git a/src/wrapper/tier2_.cpp b/src/wrapper/tier2_.cpp index c3702531..d394c2eb 100644 --- a/src/wrapper/tier2_.cpp +++ b/src/wrapper/tier2_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier2.hpp" @@ -8,231 +6,183 @@ namespace py = pybind11; auto tier2_(py::module &m) -> void { - - -m.def("_absolute_difference", &cle::tier2::absolute_difference_func, "Call absolute_difference from C++.", +m.def("_absolute_difference", &cle::tier2::absolute_difference_func, "Call cle::tier2::absolute_difference_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_add_images", &cle::tier2::add_images_func, "Call add_images from C++.", + m.def("_add_images", &cle::tier2::add_images_func, "Call cle::tier2::add_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_bottom_hat_box", &cle::tier2::bottom_hat_box_func, "Call bottom_hat_box from C++.", + m.def("_bottom_hat_box", &cle::tier2::bottom_hat_box_func, "Call cle::tier2::bottom_hat_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_bottom_hat_sphere", &cle::tier2::bottom_hat_sphere_func, "Call bottom_hat_sphere from C++.", + m.def("_bottom_hat_sphere", &cle::tier2::bottom_hat_sphere_func, "Call cle::tier2::bottom_hat_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_bottom_hat", &cle::tier2::bottom_hat_func, "Call bottom_hat from C++.", + m.def("_bottom_hat", &cle::tier2::bottom_hat_func, "Call cle::tier2::bottom_hat_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_clip", &cle::tier2::clip_func, "Call clip from C++.", + m.def("_clip", &cle::tier2::clip_func, "Call cle::tier2::clip_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("min_intensity"), py::arg("max_intensity")); - -m.def("_closing_box", &cle::tier2::closing_box_func, "Call closing_box from C++.", + m.def("_closing_box", &cle::tier2::closing_box_func, "Call cle::tier2::closing_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_closing_sphere", &cle::tier2::closing_sphere_func, "Call closing_sphere from C++.", + m.def("_closing_sphere", &cle::tier2::closing_sphere_func, "Call cle::tier2::closing_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_closing", &cle::tier2::closing_func, "Call closing from C++.", + m.def("_closing", &cle::tier2::closing_func, "Call cle::tier2::closing_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_concatenate_along_x", &cle::tier2::concatenate_along_x_func, "Call concatenate_along_x from C++.", + m.def("_concatenate_along_x", &cle::tier2::concatenate_along_x_func, "Call cle::tier2::concatenate_along_x_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_concatenate_along_y", &cle::tier2::concatenate_along_y_func, "Call concatenate_along_y from C++.", + m.def("_concatenate_along_y", &cle::tier2::concatenate_along_y_func, "Call cle::tier2::concatenate_along_y_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_concatenate_along_z", &cle::tier2::concatenate_along_z_func, "Call concatenate_along_z from C++.", + m.def("_concatenate_along_z", &cle::tier2::concatenate_along_z_func, "Call cle::tier2::concatenate_along_z_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_count_touching_neighbors", &cle::tier2::count_touching_neighbors_func, "Call count_touching_neighbors from C++.", + m.def("_count_touching_neighbors", &cle::tier2::count_touching_neighbors_func, "Call cle::tier2::count_touching_neighbors_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("ignore_background")); - -m.def("_crop_border", &cle::tier2::crop_border_func, "Call crop_border from C++.", + m.def("_crop_border", &cle::tier2::crop_border_func, "Call cle::tier2::crop_border_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("border_size")); - -m.def("_divide_by_gaussian_background", &cle::tier2::divide_by_gaussian_background_func, "Call divide_by_gaussian_background from C++.", + m.def("_divide_by_gaussian_background", &cle::tier2::divide_by_gaussian_background_func, "Call cle::tier2::divide_by_gaussian_background_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("sigma_x"), py::arg("sigma_y"), py::arg("sigma_z")); - -m.def("_degrees_to_radians", &cle::tier2::degrees_to_radians_func, "Call degrees_to_radians from C++.", + m.def("_degrees_to_radians", &cle::tier2::degrees_to_radians_func, "Call cle::tier2::degrees_to_radians_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_detect_maxima_box", &cle::tier2::detect_maxima_box_func, "Call detect_maxima_box from C++.", + m.def("_detect_maxima_box", &cle::tier2::detect_maxima_box_func, "Call cle::tier2::detect_maxima_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_detect_maxima", &cle::tier2::detect_maxima_func, "Call detect_maxima from C++.", + m.def("_detect_maxima", &cle::tier2::detect_maxima_func, "Call cle::tier2::detect_maxima_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_detect_minima_box", &cle::tier2::detect_minima_box_func, "Call detect_minima_box from C++.", + m.def("_detect_minima_box", &cle::tier2::detect_minima_box_func, "Call cle::tier2::detect_minima_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_detect_minima", &cle::tier2::detect_minima_func, "Call detect_minima from C++.", + m.def("_detect_minima", &cle::tier2::detect_minima_func, "Call cle::tier2::detect_minima_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_difference_of_gaussian", &cle::tier2::difference_of_gaussian_func, "Call difference_of_gaussian from C++.", + m.def("_difference_of_gaussian", &cle::tier2::difference_of_gaussian_func, "Call cle::tier2::difference_of_gaussian_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("sigma1_x"), py::arg("sigma1_y"), py::arg("sigma1_z"), py::arg("sigma2_x"), py::arg("sigma2_y"), py::arg("sigma2_z")); - -m.def("_extend_labeling_via_voronoi", &cle::tier2::extend_labeling_via_voronoi_func, "Call extend_labeling_via_voronoi from C++.", + m.def("_extend_labeling_via_voronoi", &cle::tier2::extend_labeling_via_voronoi_func, "Call cle::tier2::extend_labeling_via_voronoi_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_invert", &cle::tier2::invert_func, "Call invert from C++.", + m.def("_invert", &cle::tier2::invert_func, "Call cle::tier2::invert_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_label_spots", &cle::tier2::label_spots_func, "Call label_spots from C++.", + m.def("_label_spots", &cle::tier2::label_spots_func, "Call cle::tier2::label_spots_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_large_hessian_eigenvalue", &cle::tier2::large_hessian_eigenvalue_func, "Call large_hessian_eigenvalue from C++.", + m.def("_large_hessian_eigenvalue", &cle::tier2::large_hessian_eigenvalue_func, "Call cle::tier2::large_hessian_eigenvalue_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_maximum_of_all_pixels", &cle::tier2::maximum_of_all_pixels_func, "Call maximum_of_all_pixels from C++.", + m.def("_maximum_of_all_pixels", &cle::tier2::maximum_of_all_pixels_func, "Call cle::tier2::maximum_of_all_pixels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_minimum_of_all_pixels", &cle::tier2::minimum_of_all_pixels_func, "Call minimum_of_all_pixels from C++.", + m.def("_minimum_of_all_pixels", &cle::tier2::minimum_of_all_pixels_func, "Call cle::tier2::minimum_of_all_pixels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_minimum_of_masked_pixels", &cle::tier2::minimum_of_masked_pixels_func, "Call minimum_of_masked_pixels from C++.", + m.def("_minimum_of_masked_pixels", &cle::tier2::minimum_of_masked_pixels_func, "Call cle::tier2::minimum_of_masked_pixels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("mask")); - -m.def("_opening_box", &cle::tier2::opening_box_func, "Call opening_box from C++.", + m.def("_opening_box", &cle::tier2::opening_box_func, "Call cle::tier2::opening_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_opening_sphere", &cle::tier2::opening_sphere_func, "Call opening_sphere from C++.", + m.def("_opening_sphere", &cle::tier2::opening_sphere_func, "Call cle::tier2::opening_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_opening", &cle::tier2::opening_func, "Call opening from C++.", + m.def("_opening", &cle::tier2::opening_func, "Call cle::tier2::opening_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_radians_to_degrees", &cle::tier2::radians_to_degrees_func, "Call radians_to_degrees from C++.", + m.def("_radians_to_degrees", &cle::tier2::radians_to_degrees_func, "Call cle::tier2::radians_to_degrees_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_reduce_labels_to_label_edges", &cle::tier2::reduce_labels_to_label_edges_func, "Call reduce_labels_to_label_edges from C++.", + m.def("_reduce_labels_to_label_edges", &cle::tier2::reduce_labels_to_label_edges_func, "Call cle::tier2::reduce_labels_to_label_edges_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_small_hessian_eigenvalue", &cle::tier2::small_hessian_eigenvalue_func, "Call small_hessian_eigenvalue from C++.", + m.def("_small_hessian_eigenvalue", &cle::tier2::small_hessian_eigenvalue_func, "Call cle::tier2::small_hessian_eigenvalue_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_square", &cle::tier2::square_func, "Call square from C++.", + m.def("_square", &cle::tier2::square_func, "Call cle::tier2::square_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_squared_difference", &cle::tier2::squared_difference_func, "Call squared_difference from C++.", + m.def("_squared_difference", &cle::tier2::squared_difference_func, "Call cle::tier2::squared_difference_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_standard_deviation_box", &cle::tier2::standard_deviation_box_func, "Call standard_deviation_box from C++.", + m.def("_standard_deviation_box", &cle::tier2::standard_deviation_box_func, "Call cle::tier2::standard_deviation_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_standard_deviation_sphere", &cle::tier2::standard_deviation_sphere_func, "Call standard_deviation_sphere from C++.", + m.def("_standard_deviation_sphere", &cle::tier2::standard_deviation_sphere_func, "Call cle::tier2::standard_deviation_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_standard_deviation", &cle::tier2::standard_deviation_func, "Call standard_deviation from C++.", + m.def("_standard_deviation", &cle::tier2::standard_deviation_func, "Call cle::tier2::standard_deviation_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - -m.def("_subtract_gaussian_background", &cle::tier2::subtract_gaussian_background_func, "Call subtract_gaussian_background from C++.", + m.def("_subtract_gaussian_background", &cle::tier2::subtract_gaussian_background_func, "Call cle::tier2::subtract_gaussian_background_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("sigma_x"), py::arg("sigma_y"), py::arg("sigma_z")); - -m.def("_subtract_images", &cle::tier2::subtract_images_func, "Call subtract_images from C++.", + m.def("_subtract_images", &cle::tier2::subtract_images_func, "Call cle::tier2::subtract_images_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_sum_of_all_pixels", &cle::tier2::sum_of_all_pixels_func, "Call sum_of_all_pixels from C++.", + m.def("_sum_of_all_pixels", &cle::tier2::sum_of_all_pixels_func, "Call cle::tier2::sum_of_all_pixels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_top_hat_box", &cle::tier2::top_hat_box_func, "Call top_hat_box from C++.", + m.def("_top_hat_box", &cle::tier2::top_hat_box_func, "Call cle::tier2::top_hat_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_top_hat_sphere", &cle::tier2::top_hat_sphere_func, "Call top_hat_sphere from C++.", + m.def("_top_hat_sphere", &cle::tier2::top_hat_sphere_func, "Call cle::tier2::top_hat_sphere_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z")); - -m.def("_top_hat", &cle::tier2::top_hat_func, "Call top_hat from C++.", + m.def("_top_hat", &cle::tier2::top_hat_func, "Call cle::tier2::top_hat_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius_x"), py::arg("radius_y"), py::arg("radius_z"), py::arg("connectivity")); - - } diff --git a/src/wrapper/tier3_.cpp b/src/wrapper/tier3_.cpp index d735e8c3..20752277 100644 --- a/src/wrapper/tier3_.cpp +++ b/src/wrapper/tier3_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier3.hpp" @@ -8,81 +6,67 @@ namespace py = pybind11; auto tier3_(py::module &m) -> void { - - -m.def("_bounding_box", &cle::tier3::bounding_box_func, "Call bounding_box from C++.", +m.def("_bounding_box", &cle::tier3::bounding_box_func, "Call cle::tier3::bounding_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_center_of_mass", &cle::tier3::center_of_mass_func, "Call center_of_mass from C++.", + m.def("_center_of_mass", &cle::tier3::center_of_mass_func, "Call cle::tier3::center_of_mass_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_exclude_labels", &cle::tier3::exclude_labels_func, "Call exclude_labels from C++.", + m.def("_exclude_labels", &cle::tier3::exclude_labels_func, "Call cle::tier3::exclude_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("list"), py::arg("dst")); - -m.def("_exclude_labels_on_edges", &cle::tier3::exclude_labels_on_edges_func, "Call exclude_labels_on_edges from C++.", + m.def("_exclude_labels_on_edges", &cle::tier3::exclude_labels_on_edges_func, "Call cle::tier3::exclude_labels_on_edges_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("exclude_x"), py::arg("exclude_y"), py::arg("exclude_z")); - -m.def("_flag_existing_labels", &cle::tier3::flag_existing_labels_func, "Call flag_existing_labels from C++.", + m.def("_flag_existing_labels", &cle::tier3::flag_existing_labels_func, "Call cle::tier3::flag_existing_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_gamma_correction", &cle::tier3::gamma_correction_func, "Call gamma_correction from C++.", + m.def("_gamma_correction", &cle::tier3::gamma_correction_func, "Call cle::tier3::gamma_correction_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("gamma")); - -m.def("_generate_binary_overlap_matrix", &cle::tier3::generate_binary_overlap_matrix_func, "Call generate_binary_overlap_matrix from C++.", + m.def("_generate_binary_overlap_matrix", &cle::tier3::generate_binary_overlap_matrix_func, "Call cle::tier3::generate_binary_overlap_matrix_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_generate_touch_matrix", &cle::tier3::generate_touch_matrix_func, "Call generate_touch_matrix from C++.", + m.def("_generate_touch_matrix", &cle::tier3::generate_touch_matrix_func, "Call cle::tier3::generate_touch_matrix_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_histogram", &cle::tier3::histogram_func, "Call histogram from C++.", + m.def("_histogram", &cle::tier3::histogram_func, "Call cle::tier3::histogram_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("nbins"), py::arg("min"), py::arg("max")); - -m.def("_jaccard_index", &cle::tier3::jaccard_index_func, "Call jaccard_index from C++.", + m.def("_jaccard_index", &cle::tier3::jaccard_index_func, "Call cle::tier3::jaccard_index_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1")); - -m.def("_labelled_spots_to_pointlist", &cle::tier3::labelled_spots_to_pointlist_func, "Call labelled_spots_to_pointlist from C++.", + m.def("_labelled_spots_to_pointlist", &cle::tier3::labelled_spots_to_pointlist_func, "Call cle::tier3::labelled_spots_to_pointlist_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_maximum_position", &cle::tier3::maximum_position_func, "Call maximum_position from C++.", + m.def("_maximum_position", &cle::tier3::maximum_position_func, "Call cle::tier3::maximum_position_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_mean_of_all_pixels", &cle::tier3::mean_of_all_pixels_func, "Call mean_of_all_pixels from C++.", + m.def("_mean_of_all_pixels", &cle::tier3::mean_of_all_pixels_func, "Call cle::tier3::mean_of_all_pixels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_minimum_position", &cle::tier3::minimum_position_func, "Call minimum_position from C++.", + m.def("_minimum_position", &cle::tier3::minimum_position_func, "Call cle::tier3::minimum_position_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src")); - -m.def("_morphological_chan_vese", &cle::tier3::morphological_chan_vese_func, "Call morphological_chan_vese from C++.", + m.def("_morphological_chan_vese", &cle::tier3::morphological_chan_vese_func, "Call cle::tier3::morphological_chan_vese_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("num_iter"), py::arg("smoothing"), py::arg("lambda1"), py::arg("lambda2")); - + m.def("_statistics_of_labelled_pixels", &cle::tier3::statistics_of_labelled_pixels_func, "Call cle::tier3::statistics_of_labelled_pixels_func from C++ CLIc.", + py::return_value_policy::take_ownership, + py::arg("device"), py::arg("src"), py::arg("intensity")); } diff --git a/src/wrapper/tier4_.cpp b/src/wrapper/tier4_.cpp index dceafb61..5a16be45 100644 --- a/src/wrapper/tier4_.cpp +++ b/src/wrapper/tier4_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier4.hpp" @@ -8,31 +6,23 @@ namespace py = pybind11; auto tier4_(py::module &m) -> void { - - -m.def("_label_bounding_box", &cle::tier4::label_bounding_box_func, "Call label_bounding_box from C++.", +m.def("_label_bounding_box", &cle::tier4::label_bounding_box_func, "Call cle::tier4::label_bounding_box_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("label_id")); - -m.def("_mean_squared_error", &cle::tier4::mean_squared_error_func, "Call mean_squared_error from C++.", + m.def("_mean_squared_error", &cle::tier4::mean_squared_error_func, "Call cle::tier4::mean_squared_error_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1")); - -m.def("_spots_to_pointlist", &cle::tier4::spots_to_pointlist_func, "Call spots_to_pointlist from C++.", + m.def("_spots_to_pointlist", &cle::tier4::spots_to_pointlist_func, "Call cle::tier4::spots_to_pointlist_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - -m.def("_relabel_sequential", &cle::tier4::relabel_sequential_func, "Call relabel_sequential from C++.", + m.def("_relabel_sequential", &cle::tier4::relabel_sequential_func, "Call cle::tier4::relabel_sequential_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("blocksize")); - -m.def("_threshold_otsu", &cle::tier4::threshold_otsu_func, "Call threshold_otsu from C++.", + m.def("_threshold_otsu", &cle::tier4::threshold_otsu_func, "Call cle::tier4::threshold_otsu_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - - } diff --git a/src/wrapper/tier5_.cpp b/src/wrapper/tier5_.cpp index 0b681813..faa463a3 100644 --- a/src/wrapper/tier5_.cpp +++ b/src/wrapper/tier5_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier5.hpp" @@ -8,21 +6,15 @@ namespace py = pybind11; auto tier5_(py::module &m) -> void { - - -m.def("_array_equal", &cle::tier5::array_equal_func, "Call array_equal from C++.", +m.def("_array_equal", &cle::tier5::array_equal_func, "Call cle::tier5::array_equal_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1")); - -m.def("_combine_labels", &cle::tier5::combine_labels_func, "Call combine_labels from C++.", + m.def("_combine_labels", &cle::tier5::combine_labels_func, "Call cle::tier5::combine_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("src1"), py::arg("dst")); - -m.def("_connected_components_labeling", &cle::tier5::connected_components_labeling_func, "Call connected_components_labeling from C++.", + m.def("_connected_components_labeling", &cle::tier5::connected_components_labeling_func, "Call cle::tier5::connected_components_labeling_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("connectivity")); - - } diff --git a/src/wrapper/tier6_.cpp b/src/wrapper/tier6_.cpp index 6a4f1940..77402a7a 100644 --- a/src/wrapper/tier6_.cpp +++ b/src/wrapper/tier6_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier6.hpp" @@ -8,31 +6,23 @@ namespace py = pybind11; auto tier6_(py::module &m) -> void { - - -m.def("_dilate_labels", &cle::tier6::dilate_labels_func, "Call dilate_labels from C++.", +m.def("_dilate_labels", &cle::tier6::dilate_labels_func, "Call cle::tier6::dilate_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius")); - -m.def("_erode_labels", &cle::tier6::erode_labels_func, "Call erode_labels from C++.", + m.def("_erode_labels", &cle::tier6::erode_labels_func, "Call cle::tier6::erode_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius"), py::arg("relabel")); - -m.def("_gauss_otsu_labeling", &cle::tier6::gauss_otsu_labeling_func, "Call gauss_otsu_labeling from C++.", + m.def("_gauss_otsu_labeling", &cle::tier6::gauss_otsu_labeling_func, "Call cle::tier6::gauss_otsu_labeling_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src0"), py::arg("dst"), py::arg("outline_sigma")); - -m.def("_masked_voronoi_labeling", &cle::tier6::masked_voronoi_labeling_func, "Call masked_voronoi_labeling from C++.", + m.def("_masked_voronoi_labeling", &cle::tier6::masked_voronoi_labeling_func, "Call cle::tier6::masked_voronoi_labeling_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("mask"), py::arg("dst")); - -m.def("_voronoi_labeling", &cle::tier6::voronoi_labeling_func, "Call voronoi_labeling from C++.", + m.def("_voronoi_labeling", &cle::tier6::voronoi_labeling_func, "Call cle::tier6::voronoi_labeling_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst")); - - } diff --git a/src/wrapper/tier7_.cpp b/src/wrapper/tier7_.cpp index 02c3899e..bbd95fae 100644 --- a/src/wrapper/tier7_.cpp +++ b/src/wrapper/tier7_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier7.hpp" @@ -8,56 +6,43 @@ namespace py = pybind11; auto tier7_(py::module &m) -> void { - - -m.def("_affine_transform", &cle::tier7::affine_transform_func, "Call affine_transform from C++.", +m.def("_affine_transform", &cle::tier7::affine_transform_func, "Call cle::tier7::affine_transform_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("transform_matrix"), py::arg("interpolate"), py::arg("resize")); - -m.def("_eroded_otsu_labeling", &cle::tier7::eroded_otsu_labeling_func, "Call eroded_otsu_labeling from C++.", + m.def("_eroded_otsu_labeling", &cle::tier7::eroded_otsu_labeling_func, "Call cle::tier7::eroded_otsu_labeling_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("number_of_erosions"), py::arg("outline_sigma")); - -m.def("_rigid_transform", &cle::tier7::rigid_transform_func, "Call rigid_transform from C++.", + m.def("_rigid_transform", &cle::tier7::rigid_transform_func, "Call cle::tier7::rigid_transform_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("translate_x"), py::arg("translate_y"), py::arg("translate_z"), py::arg("angle_x"), py::arg("angle_y"), py::arg("angle_z"), py::arg("centered"), py::arg("interpolate"), py::arg("resize")); - -m.def("_rotate", &cle::tier7::rotate_func, "Call rotate from C++.", + m.def("_rotate", &cle::tier7::rotate_func, "Call cle::tier7::rotate_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("angle_x"), py::arg("angle_y"), py::arg("angle_z"), py::arg("centered"), py::arg("interpolate"), py::arg("resize")); - -m.def("_scale", &cle::tier7::scale_func, "Call scale from C++.", + m.def("_scale", &cle::tier7::scale_func, "Call cle::tier7::scale_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("factor_x"), py::arg("factor_y"), py::arg("factor_z"), py::arg("centered"), py::arg("interpolate"), py::arg("resize")); - -m.def("_translate", &cle::tier7::translate_func, "Call translate from C++.", + m.def("_translate", &cle::tier7::translate_func, "Call cle::tier7::translate_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("translate_x"), py::arg("translate_y"), py::arg("translate_z"), py::arg("interpolate")); - -m.def("_closing_labels", &cle::tier7::closing_labels_func, "Call closing_labels from C++.", + m.def("_closing_labels", &cle::tier7::closing_labels_func, "Call cle::tier7::closing_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius")); - -m.def("_erode_connected_labels", &cle::tier7::erode_connected_labels_func, "Call erode_connected_labels from C++.", + m.def("_erode_connected_labels", &cle::tier7::erode_connected_labels_func, "Call cle::tier7::erode_connected_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius")); - -m.def("_opening_labels", &cle::tier7::opening_labels_func, "Call opening_labels from C++.", + m.def("_opening_labels", &cle::tier7::opening_labels_func, "Call cle::tier7::opening_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius")); - -m.def("_voronoi_otsu_labeling", &cle::tier7::voronoi_otsu_labeling_func, "Call voronoi_otsu_labeling from C++.", + m.def("_voronoi_otsu_labeling", &cle::tier7::voronoi_otsu_labeling_func, "Call cle::tier7::voronoi_otsu_labeling_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("spot_sigma"), py::arg("outline_sigma")); - - } diff --git a/src/wrapper/tier8_.cpp b/src/wrapper/tier8_.cpp index 23d1d35b..ba276bdc 100644 --- a/src/wrapper/tier8_.cpp +++ b/src/wrapper/tier8_.cpp @@ -1,6 +1,4 @@ - -// this code is auto-generated by the script 'pyclesperanto_autogen_tier_script.ipynb'. -// Do not edit manually. Instead, edit the script and run it again. +// this code is auto-generated, do not edit manually #include "pycle_wrapper.hpp" #include "tier8.hpp" @@ -8,16 +6,11 @@ namespace py = pybind11; auto tier8_(py::module &m) -> void { - - -m.def("_smooth_labels", &cle::tier8::smooth_labels_func, "Call smooth_labels from C++.", +m.def("_smooth_labels", &cle::tier8::smooth_labels_func, "Call cle::tier8::smooth_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius")); - -m.def("_smooth_connected_labels", &cle::tier8::smooth_connected_labels_func, "Call smooth_connected_labels from C++.", + m.def("_smooth_connected_labels", &cle::tier8::smooth_connected_labels_func, "Call cle::tier8::smooth_connected_labels_func from C++ CLIc.", py::return_value_policy::take_ownership, py::arg("device"), py::arg("src"), py::arg("dst"), py::arg("radius")); - - } diff --git a/tests/test_statistics_of_labelled_pixels.py b/tests/test_statistics_of_labelled_pixels.py new file mode 100644 index 00000000..5485e9fc --- /dev/null +++ b/tests/test_statistics_of_labelled_pixels.py @@ -0,0 +1,54 @@ +import numpy as np + +import pyclesperanto as cle + + +def test_statistics_of_labelled_pixels(): + + labels = cle.push( + np.asarray( + [ + [1, 1, 1, 2, 2, 2], + [1, 1, 1, 2, 2, 2], + [1, 1, 1, 2, 2, 2], + [3, 3, 3, 4, 4, 4], + [3, 3, 3, 4, 4, 4], + [3, 3, 3, 4, 4, 4], + ] + ) + ) + + intensities = cle.push( + np.asarray( + [ + [14, 4, 4, 3, 3, 13], + [4, 0, 4, 3, 0, 3], + [4, 4, 4, 3, 3, 3], + [2, 2, 2, 1, 1, 1], + [2, 0, 2, 1, 0, 1], + [12, 2, 2, 1, 1, 11], + ] + ) + ) + + result = cle.statistics_of_labelled_pixels(labels, intensities) + + print(result) + + assert result["label"] == [1.0, 2.0, 3.0, 4.0] + assert result["max_intensity"] == [14.0, 13.0, 12.0, 11.0] + assert result["min_intensity"] == [0.0, 0.0, 0.0, 0.0] + assert np.allclose( + np.asarray(result["mean_intensity"]), + np.asarray( + [ + 4.666666507720947, + 3.777777910232544, + 2.8888888359069824, + 2.0, + ] + ), + atol=0.00001, + ) + assert result["sum_intensity"] == [42.0, 34.0, 26.0, 18.0] + assert result["area"] == [9.0, 9.0, 9.0, 9.0]