From 109c2f5180d8c72095e14141419df30cb2ae62e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Sep 2024 12:31:25 +0000 Subject: [PATCH] Update to 0.12.1 --- pyclesperanto/_tier1.py | 4578 +++++++++++++++++++++++++++++++++++++++ pyclesperanto/_tier2.py | 1542 +++++++++++++ pyclesperanto/_tier3.py | 515 +++++ pyclesperanto/_tier4.py | 169 ++ pyclesperanto/_tier5.py | 106 + pyclesperanto/_tier6.py | 176 ++ pyclesperanto/_tier7.py | 401 ++++ pyclesperanto/_tier8.py | 74 + src/wrapper/tier1_.cpp | 572 +++++ src/wrapper/tier2_.cpp | 188 ++ src/wrapper/tier3_.cpp | 72 + src/wrapper/tier4_.cpp | 28 + src/wrapper/tier5_.cpp | 20 + src/wrapper/tier6_.cpp | 28 + src/wrapper/tier7_.cpp | 48 + src/wrapper/tier8_.cpp | 16 + 16 files changed, 8533 insertions(+) create mode 100644 pyclesperanto/_tier1.py create mode 100644 pyclesperanto/_tier2.py create mode 100644 pyclesperanto/_tier3.py create mode 100644 pyclesperanto/_tier4.py create mode 100644 pyclesperanto/_tier5.py create mode 100644 pyclesperanto/_tier6.py create mode 100644 pyclesperanto/_tier7.py create mode 100644 pyclesperanto/_tier8.py create mode 100644 src/wrapper/tier1_.cpp create mode 100644 src/wrapper/tier2_.cpp create mode 100644 src/wrapper/tier3_.cpp create mode 100644 src/wrapper/tier4_.cpp create mode 100644 src/wrapper/tier5_.cpp create mode 100644 src/wrapper/tier6_.cpp create mode 100644 src/wrapper/tier7_.cpp create mode 100644 src/wrapper/tier8_.cpp diff --git a/pyclesperanto/_tier1.py b/pyclesperanto/_tier1.py new file mode 100644 index 0000000..e2fe18b --- /dev/null +++ b/pyclesperanto/_tier1.py @@ -0,0 +1,4578 @@ +# +# This code is auto-generated from CLIc 'cle::tier1.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +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( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the absolute value of every individual pixel x in a given image. +
f(x) = |x| 
+ + Parameters + ---------- + input_image: Image + The input image to be processed. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_absolute + """ + + return clic._absolute(device, input_image, output_image) + +@plugin_function(category=["combine", "in assistant"]) +def add_images_weighted( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + factor0: float =1, + factor1: float =1, + device: Optional[Device] =None +) -> Image: + """Calculates the sum of pairs of pixels x and y from images X and Y weighted with + factors a and b.
f(x, y, a, b) = x * a + y * b
+ + Parameters + ---------- + input_image0: Image + The first input image to added. + input_image1: Image + The second image to be added. + output_image: Optional[Image] (= None) + The output image where results are written into. + factor0: float (= 1) + Multiplication factor of each pixel of src0 before adding it. + factor1: float (= 1) + Multiplication factor of each pixel of src1 before adding it. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_addImagesWeighted + """ + + return clic._add_images_weighted(device, input_image0, input_image1, output_image, float(factor0), float(factor1)) + +@plugin_function(category=["filter", "in assistant"]) +def add_image_and_scalar( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =1, + device: Optional[Device] =None +) -> Image: + """Adds a scalar value s to all pixels x of a given image X.
f(x, s) = x +
+    s
+ + Parameters + ---------- + input_image: Image + The input image where scalare should be added. + output_image: Optional[Image] (= None) + The output image where results are written into. + scalar: float (= 1) + The constant number which will be added to all pixels. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_addImageAndScalar + """ + + return clic._add_image_and_scalar(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "binary processing", "in assistant", "combine labels", "label processing", "bia-bob-suggestion"]) +def binary_and( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image (containing pixel values 0 and 1) from two images X and + Y by connecting pairs of pixels x and y with the binary AND operator &. All + pixel values except 0 in the input images are interpreted as 1.
f(x, y) = x
+    & y
+ + Parameters + ---------- + input_image0: Image + The first binary input image to be processed. + input_image1: Image + The second binary input image to be processed. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_binaryAnd + """ + + return clic._binary_and(device, input_image0, input_image1, output_image) + +@plugin_function(category=["binary processing", "label processing", "in assistant", "bia-bob-suggestion"]) +def binary_edge_detection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines pixels/voxels which are on the surface of binary objects and sets + only them to 1 in the destination image. All other pixels are set to 0. + + Parameters + ---------- + input_image: Image + The binary input image where edges will be searched. + output_image: Optional[Image] (= None) + The output image where edge pixels will be 1. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_binaryEdgeDetection + """ + + return clic._binary_edge_detection(device, input_image, output_image) + +@plugin_function(category=["binary processing", "filter", "label processing", "in assistant", "bia-bob-suggestion"]) +def binary_not( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image (containing pixel values 0 and 1) from an image X by + negating its pixel values x using the binary NOT operator ! All pixel values + except 0 in the input image are interpreted as 1.
f(x) = !x
+ + Parameters + ---------- + input_image: Image + The binary input image to be inverted. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_binaryNot + """ + + return clic._binary_not(device, input_image, output_image) + +@plugin_function(category=["combine", "binary processing", "in assistant", "combine labels", "label processing", "bia-bob-suggestion"]) +def binary_or( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image (containing pixel values 0 and 1) from two images X and + Y by connecting pairs of pixels x and y with the binary OR operator |. All pixel + values except 0 in the input images are interpreted as 1.
f(x, y) = x |
+    y
+ + Parameters + ---------- + input_image0: Image + The first binary input image to be processed. + input_image1: Image + The second binary input image to be processed. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_binaryOr + """ + + return clic._binary_or(device, input_image0, input_image1, output_image) + +@plugin_function(category=["combine", "binary processing", "in assistant", "combine labels", "label processing", "bia-bob-suggestion"]) +def binary_subtract( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Subtracts one binary image from another. + + Parameters + ---------- + input_image0: Image + 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) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_binarySubtract + """ + + return clic._binary_subtract(device, input_image0, input_image1, output_image) + +@plugin_function(category=["combine", "binary processing", "in assistant", "combine labels", "label processing", "bia-bob-suggestion"]) +def binary_xor( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image (containing pixel values 0 and 1) from two images X and + Y by connecting pairs of pixels x and y with the binary operators AND &, OR | + and NOT ! implementing the XOR operator. All pixel values except 0 in the input + images are interpreted as 1.
f(x, y) = (x & !y) | (!x & y)
+ + Parameters + ---------- + input_image0: Image + The first binary input image to be processed. + input_image1: Image + The second binary input image to be processed. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_binaryXOr + """ + + return clic._binary_xor(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "binary processing"]) +def binary_supinf( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Compute the maximum of the erosion with plannar structuring elements. Warning: + This operation is only supported BINARY data type images. + + Parameters + ---------- + input_image: Image + The binary input image to be processed. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._binary_supinf(device, input_image, output_image) + +@plugin_function(category=["filter", "binary processing"]) +def binary_infsup( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Compute the minimum of the dilation with plannar structuring elements. Warning: + This operation is only supported BINARY data type images. + + Parameters + ---------- + input_image: Image + The binary input image to be processed. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._binary_infsup(device, input_image, output_image) + +@plugin_function +def block_enumerate( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + blocksize: int =256, + device: Optional[Device] =None +) -> Image: + """Enumerates pixels with value 1 in a onedimensional image For example handing + over the image [0, 1, 1, 0, 1, 0, 1, 1] would be processed to an image [0, 1, 2, + 0, 3, 0, 4, 5] This functionality is important in connected component neccessary + (see also sum_reduction_x). In the above example, with blocksize 4, that would + be the sum array: [2, 3] labeling. Processing is accelerated by paralellization + in blocks. Therefore, handing over precomputed block sums is Note that the block + size when calling this function and sum_reduction must be identical + + Parameters + ---------- + input_image0: Image + input binary vector image + input_image1: Image + precomputed sums of blocks + output_image: Optional[Image] (= None) + output enumerated vector image + blocksize: int (= 256) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._block_enumerate(device, input_image0, input_image1, output_image, int(blocksize)) + +@plugin_function(category=["filter", "combine", "in assistant"]) +def convolve( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Convolve the image with a given kernel image. It is recommended that the kernel + image has an odd size in X, Y and Z. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_convolve + """ + + return clic._convolve(device, input_image0, input_image1, output_image) + +@plugin_function +def copy( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Copies an image.
f(x) = x
+ + Parameters + ---------- + input_image: Image + Input image to copy. + output_image: Optional[Image] (= None) + Output copy image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_copy + """ + + return clic._copy(device, input_image, output_image) + +@plugin_function +def copy_slice( + input_image: Image, + output_image: Optional[Image] =None, + slice: int =0, + device: Optional[Device] =None +) -> Image: + """This method has two purposes: It copies a 2D image to a given slice z position + in a 3D image stack or It copies a given slice at position z in an image stack + to a 2D image. The first case is only available via ImageJ macro. If you are + using it, it is recommended that the target 3D image already preexists in GPU + memory before calling this method. Otherwise, CLIJ create the image stack with z + planes. + + Parameters + ---------- + input_image: Image + Input image to copy from. + output_image: Optional[Image] (= None) + Output copy image slice. + slice: int (= 0) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_copySlice + """ + + return clic._copy_slice(device, input_image, output_image, int(slice)) + +@plugin_function +def copy_horizontal_slice( + input_image: Image, + output_image: Optional[Image] =None, + slice: int =0, + device: Optional[Device] =None +) -> Image: + """This method has two purposes: It copies a 2D image to a given slice y position + in a 3D image stack or It copies a given slice at position y in an image stack + to a 2D image. + + Parameters + ---------- + input_image: Image + Input image to copy from. + output_image: Optional[Image] (= None) + Output copy image slice. + slice: int (= 0) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_copySlice + """ + + return clic._copy_horizontal_slice(device, input_image, output_image, int(slice)) + +@plugin_function +def copy_vertical_slice( + input_image: Image, + output_image: Optional[Image] =None, + slice: int =0, + device: Optional[Device] =None +) -> Image: + """This method has two purposes: It copies a 2D image to a given slice x position + in a 3D image stack or It copies a given slice at position x in an image stack + to a 2D image. + + Parameters + ---------- + input_image: Image + Input image to copy from. + output_image: Optional[Image] (= None) + Output copy image slice. + slice: int (= 0) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_copySlice + """ + + return clic._copy_vertical_slice(device, input_image, output_image, int(slice)) + +@plugin_function +def crop( + input_image: Image, + output_image: Optional[Image] =None, + start_x: int =0, + start_y: int =0, + start_z: int =0, + width: int =1, + height: int =1, + depth: int =1, + device: Optional[Device] =None +) -> Image: + """Crops a given substack out of a given image stack. Note: If the destination + image preexists already, it will be overwritten and keep it's dimensions. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + start_x: int (= 0) + Starting index coordicante x. + start_y: int (= 0) + Starting index coordicante y. + start_z: int (= 0) + Starting index coordicante z. + width: int (= 1) + Width size of the region to crop. + height: int (= 1) + Height size of the region to crop. + depth: int (= 1) + Depth size of the region to crop. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_crop3D + """ + + return clic._crop(device, input_image, output_image, int(start_x), int(start_y), int(start_z), int(width), int(height), int(depth)) + +@plugin_function(category=["filter", "in assistant"]) +def cubic_root( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the cubic root of each pixel. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._cubic_root(device, input_image, output_image) + +@plugin_function(category=["binarize", "label processing", "in assistant", "bia-bob-suggestion"]) +def detect_label_edges( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes a labelmap and returns an image where all pixels on label edges are set to + 1 and all other pixels to 0. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_detectLabelEdges + """ + + return clic._detect_label_edges(device, input_image, output_image) + +@plugin_function(category=["binary processing"]) +def dilate_box( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image with pixel values 0 and 1 containing the binary dilation + of a given input image. The dilation takes the Mooreneighborhood (8 pixels in 2D + and 26 pixels in 3d) into account. The pixels in the input image with pixel + value not equal to 0 will be interpreted as 1. This method is comparable to the + 'Dilate' menu in ImageJ in case it is applied to a 2D image. The only difference + is that the output image contains values 0 and 1 instead of 0 and 255. + + Parameters + ---------- + input_image: Image + Input image to process. Input image to process. + output_image: Optional[Image] (= None) + Output result image. Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_dilateBox + """ + + warnings.warn("pyclesperanto.dilate_box: This function is deprecated. Consider using dilate() instead.", DeprecationWarning,) + return clic._dilate_box(device, input_image, output_image) + +@plugin_function(category=["binary processing", "bia-bob-suggestion"]) +def dilate_sphere( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image with pixel values 0 and 1 containing the binary dilation + of a given input image. The dilation takes the vonNeumannneighborhood (4 pixels + in 2D and 6 pixels in 3d) into account. The pixels in the input image with pixel + value not equal to 0 will be interpreted as 1. + + Parameters + ---------- + input_image: Image + Input image to process. Input image to process. + output_image: Optional[Image] (= None) + Output result image. Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_dilateSphere + """ + + warnings.warn("pyclesperanto.dilate_sphere: This function is deprecated. Consider using dilate() instead.", DeprecationWarning,) + return clic._dilate_sphere(device, input_image, output_image) + +@plugin_function(category=["binary processing", "bia-bob-suggestion"]) +def dilate( + input_image: Image, + output_image: Optional[Image] =None, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes a binary image with pixel values 0 and 1 containing the binary dilation + of a given input image. The dilation apply the Mooreneighborhood (8 pixels in 2D + and 26 pixels in 3d) for the "box" connectivity and the vonNeumannneighborhood + (4 pixels in 2D and 6 pixels in 3d) for a "sphere" connectivity. The pixels in + the input image with pixel value not equal to 0 will be interpreted as 1. + + Parameters + ---------- + input_image: Image + Input image to process. Input image to process. + output_image: Optional[Image] (= None) + Output result image. Output result image. + connectivity: str (= "box") + Element shape, "box" or "sphere". + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_dilateBox + [2] https://clij.github.io/clij2-docs/reference_dilateSphere + """ + + return clic._dilate(device, input_image, output_image, str(connectivity)) + +@plugin_function(category=["combine", "in assistant"]) +def divide_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Divides two images X and Y by each other pixel wise.
f(x, y) = x / y
+ + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_divideImages + """ + + return clic._divide_images(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def divide_scalar_by_image( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Divides a scalar by an image pixel by pixel.
f(x, s) = s / x
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._divide_scalar_by_image(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "binarize", "in assistant"]) +def equal( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B equal pixel wise.
f(a, b) = 1 if a == b; 0
+    otherwise.
+ + Parameters + ---------- + input_image0: Image + The first image to be compared with. + input_image1: Image + The second image to be compared with the first. + output_image: Optional[Image] (= None) + The resulting binary image where pixels will be 1 only if source1 + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_equal + """ + + return clic._equal(device, input_image0, input_image1, output_image) + +@plugin_function(category=["binarize", "in assistant"]) +def equal_constant( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Determines if an image A and a constant b are equal.
f(a, b) = 1 if a == b;
+    0 otherwise.
+ + Parameters + ---------- + input_image: Image + The image where every pixel is compared to the constant. + output_image: Optional[Image] (= None) + The resulting binary image where pixels will be 1 only if source1 + scalar: float (= 0) + The constant where every pixel is compared to. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_equalConstant + """ + + return clic._equal_constant(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["binary processing"]) +def erode_box( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image with pixel values 0 and 1 containing the binary erosion + of a given input image. The erosion takes the Mooreneighborhood (8 pixels in 2D + and 26 pixels in 3d) into account. The pixels in the input image with pixel + value not equal to 0 will be interpreted as 1. This method is comparable to the + 'Erode' menu in ImageJ in case it is applied to a 2D image. The only difference + is that the output image contains values 0 and 1 instead of 0 and 255. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_erodeBox + """ + + warnings.warn("pyclesperanto.erode_box: This function is deprecated. Consider using erode() instead.", DeprecationWarning,) + return clic._erode_box(device, input_image, output_image) + +@plugin_function(category=["binary processing", "bia-bob-suggestion"]) +def erode_sphere( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a binary image with pixel values 0 and 1 containing the binary erosion + of a given input image. The erosion takes the vonNeumannneighborhood (4 pixels + in 2D and 6 pixels in 3d) into account. The pixels in the input image with pixel + value not equal to 0 will be interpreted as 1. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_erodeSphere + """ + + warnings.warn("pyclesperanto.erode_sphere: This function is deprecated. Consider using erode() instead.", DeprecationWarning,) + return clic._erode_sphere(device, input_image, output_image) + +@plugin_function(category=["binary processing", "bia-bob-suggestion"]) +def erode( + input_image: Image, + output_image: Optional[Image] =None, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes a binary image with pixel values 0 and 1 containing the binary erosion + of a given input image. The erosion apply the Mooreneighborhood (8 pixels in 2D + and 26 pixels in 3d) for the "box" connectivity and the vonNeumannneighborhood + (4 pixels in 2D and 6 pixels in 3d) for a "sphere" connectivity. The pixels in + the input image with pixel value not equal to 0 will be interpreted as 1. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + connectivity: str (= "box") + Element shape, "box" or "sphere". + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_erodeBox + [2] https://clij.github.io/clij2-docs/reference_erodeSphere + """ + + return clic._erode(device, input_image, output_image, str(connectivity)) + +@plugin_function(category=["filter", "in assistant"]) +def exponential( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes base exponential of all pixels values. f(x) = exp(x) Author(s): Peter + Haub, Robert Haase + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_exponential + """ + + return clic._exponential(device, input_image, output_image) + +@plugin_function +def flip( + input_image: Image, + output_image: Optional[Image] =None, + flip_x: bool =True, + flip_y: bool =True, + flip_z: bool =True, + device: Optional[Device] =None +) -> Image: + """Flips an image in X, Y and/or Z direction depending on boolean flags. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + flip_x: bool (= True) + Flip along the x axis if true. + flip_y: bool (= True) + Flip along the y axis if true. + flip_z: bool (= True) + Flip along the z axis if true. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_flip3D + """ + + return clic._flip(device, input_image, output_image, flip_x, flip_y, flip_z) + +@plugin_function(category=["filter", "denoise", "in assistant", "bia-bob-suggestion"]) +def gaussian_blur( + input_image: Image, + output_image: Optional[Image] =None, + sigma_x: float =0, + sigma_y: float =0, + sigma_z: float =0, + device: Optional[Device] =None +) -> Image: + """Computes the Gaussian blurred image of an image given sigma values in X, Y and + Z. Thus, the filter kernel can have nonisotropic shape. The implementation is + done separable. In case a sigma equals zero, the direction is not blurred. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + sigma_x: float (= 0) + Sigma value along the x axis. + sigma_y: float (= 0) + Sigma value along the y axis. + sigma_z: float (= 0) + Sigma value along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_gaussianBlur3D + """ + + return clic._gaussian_blur(device, input_image, output_image, float(sigma_x), float(sigma_y), float(sigma_z)) + +@plugin_function(category=["bia-bob-suggestion"]) +def generate_distance_matrix( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the distance between all point coordinates given in two point lists. + Takes two images containing pointlists (dimensionality n * d, n: number of + points and d: dimensionality) and builds up a matrix containing the distances + between these points. Convention: Given two point lists with dimensionality n * + d and m * d, the distance matrix will be of size(n + 1) * (m + 1). The first row + and column contain zeros. They represent the distance of the (see + generateTouchMatrix). Thus, one can threshold a distance matrix to generate a + touch matrix out of it for drawing objects to a theoretical background object. + In that way, distance matrices are of the same size as touch matrices meshes. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_generateDistanceMatrix + """ + + return clic._generate_distance_matrix(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "edge detection", "in assistant"]) +def gradient_x( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the gradient of gray values along X. Assuming a, b and c are three + adjacent pixels in X direction. In the target image will be saved as:
b' =
+    c a;
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_gradientX + """ + + return clic._gradient_x(device, input_image, output_image) + +@plugin_function(category=["filter", "edge detection", "in assistant"]) +def gradient_y( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the gradient of gray values along Y. Assuming a, b and c are three + adjacent pixels in Y direction. In the target image will be saved as:
b' =
+    c a;
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_gradientY + """ + + return clic._gradient_y(device, input_image, output_image) + +@plugin_function(category=["filter", "edge detection", "in assistant"]) +def gradient_z( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the gradient of gray values along Z. Assuming a, b and c are three + adjacent pixels in Z direction. In the target image will be saved as:
b' =
+    c a;
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_gradientZ + """ + + return clic._gradient_z(device, input_image, output_image) + +@plugin_function(category=["combine", "binarize", "in assistant"]) +def greater( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B greater pixel wise. f(a, b) = 1 if a > b; 0 + otherwise. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_greater + """ + + return clic._greater(device, input_image0, input_image1, output_image) + +@plugin_function(category=["binarize", "in assistant"]) +def greater_constant( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B greater pixel wise. f(a, b) = 1 if a > b; 0 + otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_greaterConstant + """ + + return clic._greater_constant(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "binarize", "in assistant"]) +def greater_or_equal( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B greater or equal pixel wise. f(a, b) = 1 if a + >= b; 0 otherwise. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_greaterOrEqual + """ + + return clic._greater_or_equal(device, input_image0, input_image1, output_image) + +@plugin_function(category=["binarize", "in assistant"]) +def greater_or_equal_constant( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B greater or equal pixel wise. f(a, b) = 1 if a + >= b; 0 otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + Scalar value used in the comparison. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_greaterOrEqualConstant + """ + + return clic._greater_or_equal_constant(device, input_image, output_image, float(scalar)) + +@plugin_function +def hessian_eigenvalues( + input_image: Image, + small_eigenvalue: Optional[Image] =None, + middle_eigenvalue: Optional[Image] =None, + large_eigenvalue: Optional[Image] =None, + device: Optional[Device] =None +) -> 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 + x. Ixx and Iyy are calculated by convolving the image with the 1d kernel [1 2 + 1]. Ixy is calculated by a convolution with the 2d kernel: [ 0.25 0 0.25] [ 0 0 + 0] [0.25 0 0.25] Note: This is the only clesperanto function that returns + multiple images. This API might be subject to change in the future. Consider + using small_hessian_eigenvalue() and/or large_hessian_eigenvalue() instead which + return only one image. + + Parameters + ---------- + input_image: Image + Input image to process. + small_eigenvalue: Optional[Image] (= None) + Output result image. + middle_eigenvalue: Optional[Image] (= None) + Output result image, null if input is 2D. + large_eigenvalue: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._hessian_eigenvalues(device, input_image, small_eigenvalue, middle_eigenvalue, large_eigenvalue) + +@plugin_function(category=["filter", "edge detection", "in assistant", "bia-bob-suggestion"]) +def laplace_box( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Applies the Laplace operator (Box neighborhood) to an image. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_laplaceBox + """ + + warnings.warn("pyclesperanto.laplace_box: This function is deprecated. Consider using laplace() instead.", DeprecationWarning,) + return clic._laplace_box(device, input_image, output_image) + +@plugin_function(category=["filter", "edge detection", "bia-bob-suggestion"]) +def laplace_diamond( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Applies the Laplace operator (Diamond neighborhood) to an image. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_laplaceDiamond + """ + + warnings.warn("pyclesperanto.laplace_diamond: This function is deprecated. Consider using laplace() instead.", DeprecationWarning,) + return clic._laplace_diamond(device, input_image, output_image) + +@plugin_function(category=["filter", "edge detection", "bia-bob-suggestion"]) +def laplace( + input_image: Image, + output_image: Optional[Image] =None, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Applies the Laplace operator with a "box" or a "sphere" neighborhood to an + image. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_laplaceDiamond + """ + + return clic._laplace(device, input_image, output_image, str(connectivity)) + +@plugin_function(category=["filter", "combine", "in assistant"]) +def local_cross_correlation( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Compute the cross correlation of an image to a given kernel. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._local_cross_correlation(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def logarithm( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes base e logarithm of all pixels values. f(x) = log(x) Author(s): Peter + Haub, Robert Haase + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_logarithm + """ + + return clic._logarithm(device, input_image, output_image) + +@plugin_function(category=["bia-bob-suggestion"]) +def mask( + input_image: Image, + mask: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes a masked image by applying a binary mask to an image. All pixel values + x of image X will be copied to the destination image in case pixel value m at + the same position in the mask image is not equal to zero.
f(x,m) = (x if (m
+    != 0); (0 otherwise))
+ + Parameters + ---------- + input_image: Image + Input image to process. + mask: Image + Mask image to apply. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_mask + """ + + return clic._mask(device, input_image, mask, output_image) + +@plugin_function(category=["bia-bob-suggestion"]) +def mask_label( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + label: float =1, + device: Optional[Device] =None +) -> Image: + """Computes a masked image by applying a label mask to an image. All pixel values x + of image X will be copied to the destination image in case pixel value m at the + same position in the label_map image has the right index value i. f(x,m,i) = (x + if (m == i); (0 otherwise)) + + Parameters + ---------- + input_image0: Image + Input Intensity image. + input_image1: Image + Input Label image. + output_image: Optional[Image] (= None) + Output result image. + label: float (= 1) + Label value to use. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maskLabel + """ + + return clic._mask_label(device, input_image0, input_image1, output_image, float(label)) + +@plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) +def maximum_image_and_scalar( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Computes the maximum of a constant scalar s and each pixel value x in a given + image X.
f(x, s) = max(x, s)
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + Scalar value used in the comparison. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximumImageAndScalar + """ + + return clic._maximum_image_and_scalar(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "in assistant", "bia-bob-suggestion"]) +def maximum_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the maximum of a pair of pixel values x, y from two given images X and + Y.
f(x, y) = max(x, y)
+ + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximumImages + """ + + return clic._maximum_images(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def maximum_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local maximum of a pixels cube neighborhood. The cubes size is + specified by its halfwidth, halfheight and halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximum3DBox + """ + + warnings.warn("pyclesperanto.maximum_box: This function is deprecated. Consider using maximum() instead.", DeprecationWarning,) + return clic._maximum_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "in assistant"]) +def maximum( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes the local maximum of a pixels neighborhood (box or sphere). The + neighborhood size is specified by its halfwidth, halfheight and halfdepth + (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius size along x axis. + radius_y: int (= 0) + Radius size along y axis. + radius_z: int (= 0) + Radius size along z axis. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximum3DBox + [2] https://clij.github.io/clij2-docs/reference_maximum3DSphere + """ + + return clic._maximum(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["projection"]) +def maximum_x_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the maximum intensity projection of an image along X. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximumXProjection + """ + + return clic._maximum_x_projection(device, input_image, output_image) + +@plugin_function(category=["projection"]) +def maximum_y_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the maximum intensity projection of an image along X. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximumYProjection + """ + + return clic._maximum_y_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) +def maximum_z_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the maximum intensity projection of an image along Z. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximumZProjection + """ + + return clic._maximum_z_projection(device, input_image, output_image) + +@plugin_function(category=["filter", "denoise", "in assistant"]) +def mean_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local mean average of a pixels boxshaped neighborhood. The cubes + size is specified by its halfwidth, halfheight and halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_mean3DBox + """ + + warnings.warn("pyclesperanto.mean_box: This function is deprecated. Consider using mean() instead.", DeprecationWarning,) + return clic._mean_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "denoise", "in assistant", "bia-bob-suggestion"]) +def mean_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local mean average of a pixels spherical neighborhood. The spheres + size is specified by its halfwidth, halfheight and halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_mean3DSphere + """ + + warnings.warn("pyclesperanto.mean_sphere: This function is deprecated. Consider using mean() instead.", DeprecationWarning,) + return clic._mean_sphere(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "denoise", "in assistant", "bia-bob-suggestion"]) +def mean( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes the local mean average of a pixels neighborhood defined as a boxshaped + or a sphereshaped. The shape size is specified by its halfwidth, halfheight and + halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_mean3DSphere + """ + + return clic._mean(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["projection"]) +def mean_x_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the mean average intensity projection of an image along X. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_meanXProjection + """ + + return clic._mean_x_projection(device, input_image, output_image) + +@plugin_function(category=["projection"]) +def mean_y_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the mean average intensity projection of an image along Y. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_meanYProjection + """ + + return clic._mean_y_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) +def mean_z_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the mean average intensity projection of an image along Z. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_meanZProjection + """ + + return clic._mean_z_projection(device, input_image, output_image) + +@plugin_function(category=["filter", "denoise", "in assistant"]) +def median_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local median of a pixels box shaped neighborhood. The box is + specified by its halfwidth and halfheight (radius). For technical reasons, the + area of the box must have less than 1000 pixels. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_median3DBox + """ + + warnings.warn("pyclesperanto.median_box: This function is deprecated. Consider using median() instead.", DeprecationWarning,) + return clic._median_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "denoise", "in assistant"]) +def median_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local median of a pixels sphere shaped neighborhood. The sphere is + specified by its halfwidth and halfheight (radius). For technical reasons, the + area of the box must have less than 1000 pixels. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_median3DSphere + """ + + warnings.warn("pyclesperanto.median_sphere: This function is deprecated. Consider using median() instead.", DeprecationWarning,) + return clic._median_sphere(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "denoise", "in assistant"]) +def median( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes the local median of a pixels neighborhood. The neighborhood is defined + as a box or a sphere shape. Its size is specified by its halfwidth, halfheight, + and halfdepth (radius). For technical reasons, the area of the shpae must have + less than 1000 pixels. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_median3DSphere + """ + + return clic._median(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["filter", "in assistant"]) +def minimum_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + device: Optional[Device] =None +) -> Image: + """Computes the local minimum of a pixels cube neighborhood. The cubes size is + specified by its halfwidth, halfheight and halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius size along x axis. + radius_y: int (= 0) + Radius size along y axis. + radius_z: int (= 0) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimum3DBox + """ + + warnings.warn("pyclesperanto.minimum_box: This function is deprecated. Consider using minimum() instead.", DeprecationWarning,) + return clic._minimum_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "in assistant"]) +def minimum( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes the local minimum of a pixels cube neighborhood. The cubes size is + specified by its halfwidth, halfheight and halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius size along x axis. + radius_y: int (= 0) + Radius size along y axis. + radius_z: int (= 0) + Radius size along z axis. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimum3DBox + [2] https://clij.github.io/clij2-docs/reference_minimum3DSphere + """ + + return clic._minimum(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["filter", "in assistant"]) +def minimum_image_and_scalar( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Computes the minimum of a constant scalar s and each pixel value x in a given + image X.
f(x, s) = min(x, s)
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + Scalar value used in the comparison. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimumImageAndScalar + """ + + return clic._minimum_image_and_scalar(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "in assistant"]) +def minimum_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the minimum of a pair of pixel values x, y from two given images X and + Y.
f(x, y) = min(x, y)
+ + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimumImages + """ + + return clic._minimum_images(device, input_image0, input_image1, output_image) + +@plugin_function(category=["projection"]) +def minimum_x_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the minimum intensity projection of an image along Y. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimumXProjection + """ + + return clic._minimum_x_projection(device, input_image, output_image) + +@plugin_function(category=["projection"]) +def minimum_y_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the minimum intensity projection of an image along Y. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimumYProjection + """ + + return clic._minimum_y_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) +def minimum_z_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the minimum intensity projection of an image along Z. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimumZProjection + """ + + return clic._minimum_z_projection(device, input_image, output_image) + +@plugin_function(category=["label processing", "in assistant"]) +def mode_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local mode of a pixels box shaped neighborhood. This can be used to + postprocess and locally correct semantic segmentation results. The box is + specified by its halfwidth and halfheight (radius). For technical reasons, the + intensities must lie within a range from 0 to 255. In case multiple values have + maximum frequency, the smallest one is returned. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + warnings.warn("pyclesperanto.mode_box: This function is deprecated. Consider using mode() instead.", DeprecationWarning,) + return clic._mode_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def mode_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local mode of a pixels sphere shaped neighborhood. This can be used + to postprocess and locally correct semantic segmentation results. The sphere is + specified by its halfwidth and halfheight (radius). For technical reasons, the + intensities must lie within a range from 0 to 255. In case multiple values have + maximum frequency, the smallest one is returned. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + warnings.warn("pyclesperanto.mode_sphere: This function is deprecated. Consider using mode() instead.", DeprecationWarning,) + return clic._mode_sphere(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def mode( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes the local mode of a pixels neighborhood. This neighborhood can be + shaped as a box or a sphere. This can be used to postprocess and locally correct + semantic segmentation results. The shape size is specified by its halfwidth, + halfheight, and halfdepth (radius). For technical reasons, the intensities must + lie within a range from 0 to 255 (uint8). In case multiple values have maximum + frequency, the smallest one is returned. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._mode(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["combine", "bia-bob-suggestion"]) +def modulo_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the remainder of a division of pairwise pixel values in two images + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._modulo_images(device, input_image0, input_image1, output_image) + +@plugin_function +def multiply_image_and_position( + input_image: Image, + output_image: Optional[Image] =None, + dimension: int =0, + device: Optional[Device] =None +) -> Image: + """Multiplies all pixel intensities with the x, y or z coordinate, depending on + specified dimension. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + dimension: int (= 0) + Dimension (0,1,2) to use in the operation. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_multiplyImageAndCoordinate + """ + + return clic._multiply_image_and_position(device, input_image, output_image, int(dimension)) + +@plugin_function(category=["filter", "in assistant"]) +def multiply_image_and_scalar( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Multiplies all pixels value x in a given image X with a constant scalar s. +
f(x, s) = x * s
+ + Parameters + ---------- + input_image: Image + The input image to be multiplied with a constant. + output_image: Optional[Image] (= None) + The output image where results are written into. + scalar: float (= 0) + The number with which every pixel will be multiplied with. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_multiplyImageAndScalar + """ + + return clic._multiply_image_and_scalar(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "in assistant"]) +def multiply_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Multiplies all pairs of pixel values x and y from two image X and Y.
f(x,
+    y) = x * y
+ + Parameters + ---------- + input_image0: Image + The first input image to be multiplied. + input_image1: Image + The second image to be multiplied. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_multiplyImages + """ + + return clic._multiply_images(device, input_image0, input_image1, output_image) + +@plugin_function +def nan_to_num( + input_image: Image, + output_image: Optional[Image] =None, + nan: float =0, + posinf: float =np.nan_to_num(float('inf')), + neginf: float =np.nan_to_num(float('-inf')), + device: Optional[Device] =None +) -> Image: + """Copies all pixels instead those which are not a number (NaN), or + positive/negative infinity which are replaced by a defined new value, default 0. + This function aims to work similarly as its counterpart in numpy [1]. Default + values for posinf and neginf may differ from numpy and even differ depending on + compute hardware. It is recommended to specify those values. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + The output image where results are written into. + nan: float (= 0) + Value to replace + posinf: float (= np.nan_to_num(float('inf'))) + Value to replace +inf with. + neginf: float (= np.nan_to_num(float('-inf'))) + Value to replace -inf with. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://numpy.org/doc/stable/reference/generated/numpy.nan_to_num.html + """ + + return clic._nan_to_num(device, input_image, output_image, float(nan), float(posinf), float(neginf)) + +@plugin_function +def nonzero_maximum_box( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Apply a maximum filter (box shape) to the input image. The radius is fixed to 1 + and pixels with value 0 are ignored. Note: Pixels with 0 value in the input + image will not be overwritten in the output image. Thus, the result image should + be initialized by copying the original image in advance. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag (0 or 1). + output_image1: Optional[Image] (= None) + Output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumBox + """ + + warnings.warn("pyclesperanto.nonzero_maximum_box: This function is deprecated. Consider using nonzero_maximum() instead.", DeprecationWarning,) + return clic._nonzero_maximum_box(device, input_image, output_image0, output_image1) + +@plugin_function +def nonzero_maximum_diamond( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Apply a maximum filter (diamond shape) to the input image. The radius is fixed + to 1 and pixels with value 0 are ignored. Note: Pixels with 0 value in the input + image will not be overwritten in the output image. Thus, the result image should + be initialized by copying the original image in advance. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag (0 or 1). + output_image1: Optional[Image] (= None) + Output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumDiamond + """ + + warnings.warn("pyclesperanto.nonzero_maximum_diamond: This function is deprecated. Consider using nonzero_maximum() instead.", DeprecationWarning,) + return clic._nonzero_maximum_diamond(device, input_image, output_image0, output_image1) + +@plugin_function +def nonzero_maximum( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Apply a maximum filter of a neighborhood to the input image. The neighborhood + shape can be a box or a sphere. The size is fixed to 1 and pixels with value 0 + are ignored. Note: Pixels with 0 value in the input image will not be + overwritten in the output image. Thus, the result image should be initialized by + copying the original image in advance. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag (0 or 1). + output_image1: Optional[Image] (= None) + Output image where results are written into. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumBox + [2] https://clij.github.io/clij2-docs/reference_nonzeroMaximumDiamond + """ + + return clic._nonzero_maximum(device, input_image, output_image0, output_image1, str(connectivity)) + +@plugin_function +def nonzero_minimum_box( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Apply a minimum filter (box shape) to the input image. The radius is fixed to 1 + and pixels with value 0 are ignored. Note: Pixels with 0 value in the input + image will not be overwritten in the output image. Thus, the result image should + be initialized by copying the original image in advance. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag (0 or 1). + output_image1: Optional[Image] (= None) + Output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumBox + """ + + warnings.warn("pyclesperanto.nonzero_minimum_box: This function is deprecated. Consider using nonzero_minimum() instead.", DeprecationWarning,) + return clic._nonzero_minimum_box(device, input_image, output_image0, output_image1) + +@plugin_function +def nonzero_minimum_diamond( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Apply a minimum filter (diamond shape) to the input image. The radius is fixed + to 1 and pixels with value 0 are ignored.Note: Pixels with 0 value in the input + image will not be overwritten in the output image. Thus, the result image should + be initialized by copying the original image in advance. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag (0 or 1). + output_image1: Optional[Image] (= None) + Output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumDiamond + """ + + warnings.warn("pyclesperanto.nonzero_minimum_diamond: This function is deprecated. Consider using nonzero_minimum() instead.", DeprecationWarning,) + return clic._nonzero_minimum_diamond(device, input_image, output_image0, output_image1) + +@plugin_function +def nonzero_minimum( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Apply a minimum filter of a neighborhood to the input image. The neighborhood + shape can be a box or a sphere. The radius is fixed to 1 and pixels with value 0 + are ignored.Note: Pixels with 0 value in the input image will not be overwritten + in the output image. Thus, the result image should be initialized by copying the + original image in advance. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag (0 or 1). + output_image1: Optional[Image] (= None) + Output image where results are written into. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumBox + [2] https://clij.github.io/clij2-docs/reference_nonzeroMinimumDiamond + """ + + return clic._nonzero_minimum(device, input_image, output_image0, output_image1, str(connectivity)) + +@plugin_function(category=["combine", "binarize", "in assistant"]) +def not_equal( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B equal pixel wise. f(a, b) = 1 if a != b; 0 + otherwise. + + Parameters + ---------- + input_image0: Image + The first image to be compared with. + input_image1: Image + The second image to be compared with the first. + output_image: Optional[Image] (= None) + The resulting binary image where pixels will be 1 only if source1 + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_notEqual + """ + + return clic._not_equal(device, input_image0, input_image1, output_image) + +@plugin_function(category=["binarize", "in assistant"]) +def not_equal_constant( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B equal pixel wise. f(a, b) = 1 if a != b; 0 + otherwise. + + Parameters + ---------- + input_image: Image + The image where every pixel is compared to the constant. + output_image: Optional[Image] (= None) + The resulting binary image where pixels will be 1 only if source1 + scalar: float (= 0) + The constant where every pixel is compared to. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_notEqualConstant + """ + + return clic._not_equal_constant(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "in assistant"]) +def paste( + input_image: Image, + output_image: Optional[Image] =None, + index_x: int =0, + index_y: int =0, + index_z: int =0, + device: Optional[Device] =None +) -> Image: + """Pastes an image into another image at a given position. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + index_x: int (= 0) + Origin pixel coodinate in x to paste. + index_y: int (= 0) + Origin pixel coodinate in y to paste. + index_z: int (= 0) + Origin pixel coodinate in z to paste. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_paste3D + """ + + return clic._paste(device, input_image, output_image, int(index_x), int(index_y), int(index_z)) + +@plugin_function +def onlyzero_overwrite_maximum_box( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Apply a local maximum filter to an image which only overwrites pixels with value + 0. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag value, 0 or 1. + output_image1: Optional[Image] (= None) + Output image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumBox + """ + + warnings.warn("pyclesperanto.onlyzero_overwrite_maximum_box: This function is deprecated. Consider using onlyzero_overwrite_maximum() instead.", DeprecationWarning,) + return clic._onlyzero_overwrite_maximum_box(device, input_image, output_image0, output_image1) + +@plugin_function +def onlyzero_overwrite_maximum_diamond( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Apply a local maximum filter to an image which only overwrites pixels with value + 0. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag value, 0 or 1. + output_image1: Optional[Image] (= None) + Output image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumDiamond + """ + + warnings.warn("pyclesperanto.onlyzero_overwrite_maximum_diamond: This function is deprecated. Consider using onlyzero_overwrite_maximum() instead.", DeprecationWarning,) + return clic._onlyzero_overwrite_maximum_diamond(device, input_image, output_image0, output_image1) + +@plugin_function +def onlyzero_overwrite_maximum( + input_image: Image, + output_image0: Image, + output_image1: Optional[Image] =None, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Apply a local maximum filter to an image which only overwrites pixels with value + 0. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image0: Image + Output flag value, 0 or 1. + output_image1: Optional[Image] (= None) + Output image. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumBox + [2] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumDiamond + """ + + return clic._onlyzero_overwrite_maximum(device, input_image, output_image0, output_image1, str(connectivity)) + +@plugin_function(category=["filter", "in assistant"]) +def power( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =1, + device: Optional[Device] =None +) -> Image: + """Computes all pixels value x to the power of a given exponent a.
f(x, a) = x
+    ^ a
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 1) + Power value. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_power + """ + + return clic._power(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "in assistant"]) +def power_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Calculates x to the power of y pixel wise of two images X and Y. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_powerImages + """ + + return clic._power_images(device, input_image0, input_image1, output_image) + +@plugin_function(category=["transform", "in assistant"]) +def range( + input_image: Image, + output_image: Optional[Image] =None, + start_x: Optional[int] =None, + stop_x: Optional[int] =None, + step_x: Optional[int] =None, + start_y: Optional[int] =None, + stop_y: Optional[int] =None, + step_y: Optional[int] =None, + start_z: Optional[int] =None, + stop_z: Optional[int] =None, + step_z: Optional[int] =None, + device: Optional[Device] =None +) -> Image: + """Crops an image according to a defined range and step size. + + Parameters + ---------- + input_image: Image + First input image to process. + output_image: Optional[Image] (= None) + Output result image. + start_x: Optional[int] (= None) + Range starting value in x + stop_x: Optional[int] (= None) + Range stop value in x + step_x: Optional[int] (= None) + Range step value in x + start_y: Optional[int] (= None) + Range starting value in y + stop_y: Optional[int] (= None) + Range stop value in y + step_y: Optional[int] (= None) + Range step value in y + start_z: Optional[int] (= None) + Range starting value in z + stop_z: Optional[int] (= None) + Range stop value in z + step_z: Optional[int] (= None) + Range step value in z + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + 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) + +@plugin_function(category=["bia-bob-suggestion"]) +def read_values_from_positions( + input_image: Image, + list: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Go to positions in a given image specified by a pointlist and read intensities + of those pixels. The intensities are stored in a new vector. The positions are + passed as a (x,y,z) coordinate per column. + + Parameters + ---------- + input_image: Image + Input image to process. + list: Image + List of coordinate, as a 2D matrix. + output_image: Optional[Image] (= None) + Output vector image of intensities. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._read_values_from_positions(device, input_image, list, output_image) + +@plugin_function(category=["bia-bob-suggestion"]) +def replace_values( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Replaces integer intensities specified in a vector image. The values are passed + as a vector of values. The vector index represents the old intensity and the + value at that position represents the new intensity.s + + Parameters + ---------- + input_image0: Image + Input image to process. + input_image1: Image + List of intensities to replace, as a vector of values. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_replaceIntensities + """ + + return clic._replace_values(device, input_image0, input_image1, output_image) + +@plugin_function +def replace_value( + input_image: Image, + output_image: Optional[Image] =None, + scalar0: float =0, + scalar1: float =1, + device: Optional[Device] =None +) -> Image: + """Replaces a specific intensity in an image with a given new value. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar0: float (= 0) + Old value. + scalar1: float (= 1) + New value. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_replaceIntensity + """ + + return clic._replace_value(device, input_image, output_image, float(scalar0), float(scalar1)) + +@plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) +def maximum_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =0, + device: Optional[Device] =None +) -> Image: + """Computes the local maximum of a pixels spherical neighborhood. The spheres size + is specified by its halfwidth, halfheight and halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: float (= 1) + Radius size along x axis. + radius_y: float (= 1) + Radius size along y axis. + radius_z: float (= 0) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximum3DSphere + """ + + warnings.warn("pyclesperanto.maximum_sphere: This function is deprecated. Consider using maximum() instead.", DeprecationWarning,) + return clic._maximum_sphere(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z)) + +@plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) +def minimum_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =1, + device: Optional[Device] =None +) -> Image: + """Computes the local minimum of a pixels spherical neighborhood. The spheres size + is specified by its halfwidth, halfheight and halfdepth (radius). + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: float (= 1) + Radius size along x axis. + radius_y: float (= 1) + Radius size along y axis. + radius_z: float (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimum3DSphere + """ + + warnings.warn("pyclesperanto.minimum_sphere: This function is deprecated. Consider using minimum() instead.", DeprecationWarning,) + return clic._minimum_sphere(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z)) + +@plugin_function +def multiply_matrix( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Multiplies two matrices with each other. Shape of matrix1 should be equal to + shape of matrix2 transposed. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_multiplyMatrix + """ + + return clic._multiply_matrix(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def reciprocal( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes 1/x for every pixel value This function is supposed to work similarly + to its counter part in numpy [1] + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://numpy.org/doc/stable/reference/generated/numpy.reciprocal.html + """ + + return clic._reciprocal(device, input_image, output_image) + +@plugin_function +def set( + input_image: Image, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values x of a given image X to a constant value v.
f(x) =
+    v
+ + Parameters + ---------- + input_image: Image + Input image to process. + scalar: float (= 0) + Value to set. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_set + """ + + return clic._set(device, input_image, float(scalar)) + +@plugin_function +def set_column( + input_image: Image, + column: int =0, + value: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values x of a given column in X to a constant value v. + + Parameters + ---------- + input_image: Image + Input image to process. + column: int (= 0) + Column index. + value: float (= 0) + Value to set. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setColumn + """ + + return clic._set_column(device, input_image, int(column), float(value)) + +@plugin_function +def set_image_borders( + input_image: Image, + value: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values at the image border to a given value. + + Parameters + ---------- + input_image: Image + Input image to process. + value: float (= 0) + Value to set. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setImageBorders + """ + + return clic._set_image_borders(device, input_image, float(value)) + +@plugin_function +def set_plane( + input_image: Image, + plane: int =0, + value: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values x of a given plane in X to a constant value v. + + Parameters + ---------- + input_image: Image + Input image to process. + plane: int (= 0) + Plane index. + value: float (= 0) + Value to set. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setPlane + """ + + return clic._set_plane(device, input_image, int(plane), float(value)) + +@plugin_function +def set_ramp_x( + input_image: Image, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values to their X coordinate. + + Parameters + ---------- + input_image: Image + Input image to process. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setRampX + """ + + return clic._set_ramp_x(device, input_image) + +@plugin_function +def set_ramp_y( + input_image: Image, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values to their Y coordinate. + + Parameters + ---------- + input_image: Image + Input image to process. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setRampY + """ + + return clic._set_ramp_y(device, input_image) + +@plugin_function +def set_ramp_z( + input_image: Image, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values to their Z coordinate. + + Parameters + ---------- + input_image: Image + Input image to process. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setRampZ + """ + + return clic._set_ramp_z(device, input_image) + +@plugin_function +def set_row( + input_image: Image, + row: int =0, + value: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values x of a given row in X to a constant value v. + + Parameters + ---------- + input_image: Image + Input image to process. + row: int (= 0) + + value: float (= 0) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setRow + """ + + return clic._set_row(device, input_image, int(row), float(value)) + +@plugin_function +def set_nonzero_pixels_to_pixelindex( + input_image: Image, + output_image: Optional[Image] =None, + offset: int =1, + device: Optional[Device] =None +) -> Image: + """Replaces all 0 value pixels in an image with the index of a pixel. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output image. + offset: int (= 1) + Offset value to start the indexing. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._set_nonzero_pixels_to_pixelindex(device, input_image, output_image, int(offset)) + +@plugin_function +def set_where_x_equals_y( + input_image: Image, + value: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values a of a given image A to a constant value v in case its + coordinates x == y. Otherwise the pixel is not overwritten. If you want to + initialize an identity transfrom matrix, set all pixels to 0 first. + + Parameters + ---------- + input_image: Image + Input image to process. + value: float (= 0) + Value to set. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setWhereXequalsY + """ + + return clic._set_where_x_equals_y(device, input_image, float(value)) + +@plugin_function +def set_where_x_greater_than_y( + input_image: Image, + value: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values a of a given image A to a constant value v in case its + coordinates x > y. Otherwise the pixel is not overwritten. If you want to + initialize an identity transfrom matrix, set all pixels to 0 first. + + Parameters + ---------- + input_image: Image + Input image to process. + value: float (= 0) + Value to set. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setWhereXgreaterThanY + """ + + return clic._set_where_x_greater_than_y(device, input_image, float(value)) + +@plugin_function +def set_where_x_smaller_than_y( + input_image: Image, + value: float =0, + device: Optional[Device] =None +) -> Image: + """Sets all pixel values a of a given image A to a constant value v in case its + coordinates x < y. Otherwise the pixel is not overwritten. If you want to + initialize an identity transfrom matrix, set all pixels to 0 first. + + Parameters + ---------- + input_image: Image + Input image to process. + value: float (= 0) + Value to set. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_setWhereXsmallerThanY + """ + + return clic._set_where_x_smaller_than_y(device, input_image, float(value)) + +@plugin_function +def sign( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Extracts the sign of pixels. If a pixel value < 0, resulting pixel value will be + 1. If it was > 0, it will be 1. Otherwise it will be 0. This function aims to + work similarly as its counterpart in numpy [1]. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._sign(device, input_image, output_image) + +@plugin_function(category=["combine", "binarize", "in assistant"]) +def smaller( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B smaller pixel wise. f(a, b) = 1 if a < b; 0 + otherwise. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_smaller + """ + + return clic._smaller(device, input_image0, input_image1, output_image) + +@plugin_function(category=["binarize", "in assistant"]) +def smaller_constant( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B smaller pixel wise. f(a, b) = 1 if a < b; 0 + otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + Scalar used in the comparison. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_smallerConstant + """ + + return clic._smaller_constant(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["combine", "binarize", "in assistant"]) +def smaller_or_equal( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B smaller or equal pixel wise. f(a, b) = 1 if a + <= b; 0 otherwise. + + Parameters + ---------- + input_image0: Image + First input image to process. + input_image1: Image + Second input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_smallerOrEqual + """ + + return clic._smaller_or_equal(device, input_image0, input_image1, output_image) + +@plugin_function(category=["binarize", "in assistant"]) +def smaller_or_equal_constant( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Determines if two images A and B smaller or equal pixel wise. f(a, b) = 1 if a + <= b; 0 otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + Scalar used in the comparison. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_smallerOrEqualConstant + """ + + return clic._smaller_or_equal_constant(device, input_image, output_image, float(scalar)) + +@plugin_function(category=["filter", "edge detection", "in assistant", "bia-bob-suggestion"]) +def sobel( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Convolve the image with the Sobel kernel. Author(s): Ruth WhelanJeans, Robert + Haase + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_sobel + """ + + return clic._sobel(device, input_image, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def square_root( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the square root of each pixel. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._square_root(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) +def std_z_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the standard deviation intensity projection of an image stack along + Z. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_standardDeviationZProjection + """ + + return clic._std_z_projection(device, input_image, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def subtract_image_from_scalar( + input_image: Image, + output_image: Optional[Image] =None, + scalar: float =0, + device: Optional[Device] =None +) -> Image: + """Subtracts one image X from a scalar s pixel wise.
f(x, s) = s x
+ + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + scalar: float (= 0) + Scalar used in the subtraction. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_subtractImageFromScalar + """ + + return clic._subtract_image_from_scalar(device, input_image, output_image, float(scalar)) + +@plugin_function +def sum_reduction_x( + input_image: Image, + output_image: Optional[Image] =None, + blocksize: int =256, + device: Optional[Device] =None +) -> Image: + """Takes an image and reduces it in width by factor blocksize. The new pixels + contain the sum of the reduced pixels. For example, given the following image + and block size 4: [0, 1, 1, 0, 1, 0, 1, 1] would lead to an image [2, 3] + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + blocksize: int (= 256) + Blocksize value. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._sum_reduction_x(device, input_image, output_image, int(blocksize)) + +@plugin_function(category=["projection"]) +def sum_x_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the sum intensity projection of an image along Z. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_sumXProjection + """ + + return clic._sum_x_projection(device, input_image, output_image) + +@plugin_function(category=["projection"]) +def sum_y_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the sum intensity projection of an image along Z. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_sumYProjection + """ + + return clic._sum_y_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant", "bia-bob-suggestion"]) +def sum_z_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the sum intensity projection of an image along Z. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_sumZProjection + """ + + return clic._sum_z_projection(device, input_image, output_image) + +@plugin_function(category=["transform"]) +def transpose_xy( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Transpose X and Y axes of an image. + + Parameters + ---------- + input_image: Image + The input image. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_transposeXY + """ + + return clic._transpose_xy(device, input_image, output_image) + +@plugin_function(category=["transform"]) +def transpose_xz( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Transpose X and Z axes of an image. + + Parameters + ---------- + input_image: Image + The input image. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_transposeXZ + """ + + return clic._transpose_xz(device, input_image, output_image) + +@plugin_function(category=["transform"]) +def transpose_yz( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Transpose Y and Z axes of an image. + + Parameters + ---------- + input_image: Image + The input image. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_transposeYZ + """ + + return clic._transpose_yz(device, input_image, output_image) + +@plugin_function +def undefined_to_zero( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Copies all pixels instead those which are not a number (NaN) or infinity (inf), + which are replaced by 0. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_undefinedToZero + """ + + return clic._undefined_to_zero(device, input_image, output_image) + +@plugin_function(category=["filter", "edge detection", "in assistant"]) +def variance_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local variance of a pixels box neighborhood. The box size is + specified by its halfwidth, halfheight and halfdepth (radius). If 2D images are + given, radius_z will be ignored. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_varianceBox + """ + + warnings.warn("pyclesperanto.variance_box: This function is deprecated. Consider using variance() instead.", DeprecationWarning,) + return clic._variance_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "edge detection", "in assistant", "bia-bob-suggestion"]) +def variance_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local variance of a pixels sphere neighborhood. The sphere size is + specified by its halfwidth, halfheight and halfdepth (radius). If 2D images are + given, radius_z will be ignored. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_varianceSphere + """ + + warnings.warn("pyclesperanto.variance_sphere: This function is deprecated. Consider using variance() instead.", DeprecationWarning,) + return clic._variance_sphere(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "edge detection", "in assistant"]) +def variance( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes the local variance of a pixels neighborhood (box or sphere). The + neighborhood size is specified by its halfwidth, halfheight and halfdepth + (radius). If 2D images are given, radius_z will be ignored. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius size along x axis. + radius_y: int (= 1) + Radius size along y axis. + radius_z: int (= 1) + Radius size along z axis. + connectivity: str (= "box") + Filter neigborhood + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_varianceBox + [2] https://clij.github.io/clij2-docs/reference_varianceSphere + """ + + return clic._variance(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function +def write_values_to_positions( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes an image with three/four rows (2D: height = 3; 3D: height = 4): x, y [, z] + and v and target image. The value v will be written at position x/y[/z] in the + target image. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_writeValuesToPositions + """ + + return clic._write_values_to_positions(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant"]) +def x_position_of_maximum_x_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines an Xposition of the maximum intensity along X and writes it into the + resulting image. If there are multiple xslices with the same value, the smallest + X will be chosen. + + Parameters + ---------- + input_image: Image + Input image stack + output_image: Optional[Image] (= None) + altitude map + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._x_position_of_maximum_x_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant"]) +def x_position_of_minimum_x_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines an Xposition of the minimum intensity along X and writes it into the + resulting image. If there are multiple xslices with the same value, the smallest + X will be chosen. + + Parameters + ---------- + input_image: Image + Input image stack + output_image: Optional[Image] (= None) + altitude map + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._x_position_of_minimum_x_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant"]) +def y_position_of_maximum_y_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines an Yposition of the maximum intensity along Y and writes it into the + resulting image. If there are multiple yslices with the same value, the smallest + Y will be chosen. + + Parameters + ---------- + input_image: Image + Input image stack + output_image: Optional[Image] (= None) + altitude map + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._y_position_of_maximum_y_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant"]) +def y_position_of_minimum_y_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines an Yposition of the minimum intensity along Y and writes it into the + resulting image. If there are multiple yslices with the same value, the smallest + Y will be chosen. + + Parameters + ---------- + input_image: Image + Input image stack + output_image: Optional[Image] (= None) + altitude map + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._y_position_of_minimum_y_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant"]) +def z_position_of_maximum_z_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines a Zposition of the maximum intensity along Z and writes it into the + resulting image. If there are multiple zslices with the same value, the smallest + Z will be chosen. + + Parameters + ---------- + input_image: Image + Input image stack + output_image: Optional[Image] (= None) + altitude map + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._z_position_of_maximum_z_projection(device, input_image, output_image) + +@plugin_function(category=["projection", "in assistant"]) +def z_position_of_minimum_z_projection( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines a Zposition of the minimum intensity along Z and writes it into the + resulting image. If there are multiple zslices with the same value, the smallest + Z will be chosen. + + Parameters + ---------- + input_image: Image + Input image stack + output_image: Optional[Image] (= None) + altitude map + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._z_position_of_minimum_z_projection(device, input_image, output_image) \ No newline at end of file diff --git a/pyclesperanto/_tier2.py b/pyclesperanto/_tier2.py new file mode 100644 index 0000000..2becd8b --- /dev/null +++ b/pyclesperanto/_tier2.py @@ -0,0 +1,1542 @@ +# +# This code is auto-generated from CLIc 'cle::tier2.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +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( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the absolute difference pixel by pixel between two images.
f(x,
+    y) = |x y| 
+ + Parameters + ---------- + input_image0: Image + The input image to be subtracted from. + input_image1: Image + The input image which is subtracted. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_absoluteDifference + """ + + return clic._absolute_difference(device, input_image0, input_image1, output_image) + +@plugin_function(category=["combine", "in assistant"]) +def add_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Calculates the sum of pairs of pixels x and y of two images X and Y.
f(x,
+    y) = x + y
+ + Parameters + ---------- + input_image0: Image + The first input image to added. + input_image1: Image + The second image to be added. + output_image: Optional[Image] (= None) + The output image where results are written into. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_addImages + """ + + return clic._add_images(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "background removal", "in assistant"]) +def bottom_hat_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Apply a bottomhat filter for background subtraction to the input image. + + Parameters + ---------- + input_image: Image + The input image where the background is subtracted from. + output_image: Optional[Image] (= None) + The output image where results are written into. + radius_x: int (= 1) + Radius of the background determination region in X. + radius_y: int (= 1) + Radius of the background determination region in Y. + radius_z: int (= 1) + Radius of the background determination region in Z. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_bottomHatBox + """ + + warnings.warn("pyclesperanto.bottom_hat_box: This method is deprecated. Consider using bottom_hat() instead.", DeprecationWarning,) + return clic._bottom_hat_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "background removal", "in assistant", "bia-bob-suggestion"]) +def bottom_hat_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =1, + device: Optional[Device] =None +) -> Image: + """Applies a bottomhat filter for background subtraction to the input image. + + Parameters + ---------- + input_image: Image + The input image where the background is subtracted from. + output_image: Optional[Image] (= None) + The output image where results are written into. + radius_x: float (= 1) + Radius of the background determination region in X. + radius_y: float (= 1) + Radius of the background determination region in Y. + radius_z: float (= 1) + Radius of the background determination region in Z. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_bottomHatSphere + """ + + warnings.warn("pyclesperanto.bottom_hat_sphere: This method is deprecated. Consider using bottom_hat() instead.", DeprecationWarning,) + return clic._bottom_hat_sphere(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z)) + +@plugin_function(category=["filter", "background removal", "in assistant", "bia-bob-suggestion"]) +def bottom_hat( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =1, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Applies a bottomhat filter for background subtraction to the input image. + + Parameters + ---------- + input_image: Image + The input image where the background is subtracted from. + output_image: Optional[Image] (= None) + The output image where results are written into. + radius_x: float (= 1) + Radius of the background determination region in X. + radius_y: float (= 1) + Radius of the background determination region in Y. + radius_z: float (= 1) + Radius of the background determination region in Z. + connectivity: str (= "box") + Element shape, "box" or "sphere" + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_bottomHatBox + [2] https://clij.github.io/clij2-docs/reference_bottomHatSphere + """ + + return clic._bottom_hat(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z), str(connectivity)) + +@plugin_function(category=["combine", "in assistant"]) +def clip( + input_image: Image, + output_image: Optional[Image] =None, + min_intensity: Optional[float] =None, + max_intensity: Optional[float] =None, + device: Optional[Device] =None +) -> Image: + """Limits the range of values in an image. This function is supposed to work + similarly as its counter part in numpy [1]. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + min_intensity: Optional[float] (= None) + new, lower limit of the intensity range + max_intensity: Optional[float] (= None) + new, upper limit of the intensity range + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://numpy.org/doc/stable/reference/generated/numpy.clip.html + """ + + return clic._clip(device, input_image, output_image, min_intensity, max_intensity) + +@plugin_function(category=["filter", "in assistant"]) +def closing_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + device: Optional[Device] =None +) -> Image: + """Closing operator, boxshaped Applies morphological closing to intensity images + using a boxshaped footprint. This operator also works with binary images. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius along the x axis. + radius_y: int (= 0) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + warnings.warn("pyclesperanto.closing_box: This method is deprecated. Consider using closing() instead.", DeprecationWarning,) + return clic._closing_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) +def closing_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =0, + device: Optional[Device] =None +) -> Image: + """Closing operator, sphereshaped Applies morphological closing to intensity images + using a sphereshaped footprint. This operator also works with binary images. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius along the x axis. + radius_y: int (= 1) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + warnings.warn("pyclesperanto.closing_sphere: This method is deprecated. Consider using closing() instead.", DeprecationWarning,) + return clic._closing_sphere(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) +def closing( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =0, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Closing operator, sphereshaped Applies morphological closing to intensity images + using a sphereshaped footprint. This operator also works with binary images. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius along the x axis. + radius_y: int (= 1) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + connectivity: str (= "box") + Element shape, "box" or "sphere" + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._closing(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["combine", "transform", "in assistant", "bia-bob-suggestion"]) +def concatenate_along_x( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Concatenate two images or stacks along the X axis. + + Parameters + ---------- + input_image0: Image + First input image. + input_image1: Image + Second input image. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_combineHorizontally + """ + + return clic._concatenate_along_x(device, input_image0, input_image1, output_image) + +@plugin_function(category=["combine", "transform", "in assistant", "bia-bob-suggestion"]) +def concatenate_along_y( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Concatenate two images or stacks along the Y axis. + + Parameters + ---------- + input_image0: Image + First input image. + input_image1: Image + Second input image. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_combineVertically + """ + + return clic._concatenate_along_y(device, input_image0, input_image1, output_image) + +@plugin_function(category=["combine", "transform", "in assistant", "bia-bob-suggestion"]) +def concatenate_along_z( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Concatenate two images or stacks along the Z axis. + + Parameters + ---------- + input_image0: Image + First input image. + input_image1: Image + Second input image. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_concatenateStacks + """ + + return clic._concatenate_along_z(device, input_image0, input_image1, output_image) + +@plugin_function(category=["bia-bob-suggestion"]) +def count_touching_neighbors( + input_image: Image, + output_image: Optional[Image] =None, + ignore_background: bool =True, + device: Optional[Device] =None +) -> Image: + """Takes a touch matrix as input and delivers a vector with number of touching + neighbors per label as a vector. Note: Background is considered as something + that can touch. To ignore touches with background, hand over a touch matrix + where the first column (index = 0) has been set to 0. Use set_column for that. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + ignore_background: bool (= True) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_countTouchingNeighbors + """ + + return clic._count_touching_neighbors(device, input_image, output_image, ignore_background) + +@plugin_function +def crop_border( + input_image: Image, + output_image: Optional[Image] =None, + border_size: int =1, + device: Optional[Device] =None +) -> Image: + """Crops an image by removing the outer pixels, per default 1. Notes * To make sure + the output image has the right size, provide destination_image=None. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + border_size: int (= 1) + Border size to crop. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._crop_border(device, input_image, output_image, int(border_size)) + +@plugin_function(category=["filter", "background removal", "in assistant", "bia-bob-suggestion"]) +def divide_by_gaussian_background( + input_image: Image, + output_image: Optional[Image] =None, + sigma_x: float =2, + sigma_y: float =2, + sigma_z: float =2, + device: Optional[Device] =None +) -> Image: + """Applies Gaussian blur to the input image and divides the original by the result. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + sigma_x: float (= 2) + Gaussian sigma value along x. + sigma_y: float (= 2) + Gaussian sigma value along y. + sigma_z: float (= 2) + Gaussian sigma value along z. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_divideByGaussianBackground + """ + + return clic._divide_by_gaussian_background(device, input_image, output_image, float(sigma_x), float(sigma_y), float(sigma_z)) + +@plugin_function +def degrees_to_radians( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Converts radians to degrees. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._degrees_to_radians(device, input_image, output_image) + +@plugin_function(category=["binarize", "in assistant"]) +def detect_maxima_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + device: Optional[Device] =None +) -> Image: + """Detects local maxima in a given square/cubic neighborhood. Pixels in the + resulting image are set to 1 if there is no other pixel in a given radius which + has a higher intensity, and to 0 otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius along the x axis. + radius_y: int (= 0) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_detectMaximaBox + """ + + warnings.warn("pyclesperanto.detect_maxima_box: This method is deprecated. Consider using detect_maxima() instead.", DeprecationWarning,) + return clic._detect_maxima_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["binarize", "in assistant"]) +def detect_maxima( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Detects local maxima in a given square/cubic neighborhood. Pixels in the + resulting image are set to 1 if there is no other pixel in a given radius which + has a higher intensity, and to 0 otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius along the x axis. + radius_y: int (= 0) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + connectivity: str (= "box") + Element shape, "box" or "sphere" + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_detectMaximaBox + [2] https://clij.github.io/clij2-docs/reference_detectMaximaSphere + """ + + return clic._detect_maxima(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["binarize", "in assistant"]) +def detect_minima_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + device: Optional[Device] =None +) -> Image: + """Detects local maxima in a given square/cubic neighborhood. Pixels in the + resulting image are set to 1 if there is no other pixel in a given radius which + has a lower intensity, and to 0 otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius along the x axis. + radius_y: int (= 0) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_detectMinimaBox + """ + + warnings.warn("pyclesperanto.detect_minima_box: This method is deprecated. Consider using detect_minima() instead.", DeprecationWarning,) + return clic._detect_minima_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["binarize", "in assistant"]) +def detect_minima( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Detects local maxima in a given square/cubic neighborhood. Pixels in the + resulting image are set to 1 if there is no other pixel in a given radius which + has a lower intensity, and to 0 otherwise. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius along the x axis. + radius_y: int (= 0) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + connectivity: str (= "box") + Element shape, "box" or "sphere" + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_detectMinimaBox + [2] https://clij.github.io/clij2-docs/reference_detectMinimaSphere + """ + + return clic._detect_minima(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["filter", "background removal", "bia-bob-suggestion"]) +def difference_of_gaussian( + input_image: Image, + output_image: Optional[Image] =None, + sigma1_x: float =2, + sigma1_y: float =2, + sigma1_z: float =2, + sigma2_x: float =2, + sigma2_y: float =2, + sigma2_z: float =2, + device: Optional[Device] =None +) -> Image: + """Applies Gaussian blur to the input image twice with different sigma values + resulting in two images which are then subtracted from each other. It is + recommended to apply this operation to images of type Float (32 bit) as results + might be negative. + + Parameters + ---------- + input_image: Image + The input image to be processed. + output_image: Optional[Image] (= None) + The output image where results are written into. + sigma1_x: float (= 2) + Sigma of the first Gaussian filter in x + sigma1_y: float (= 2) + Sigma of the first Gaussian filter in y + sigma1_z: float (= 2) + Sigma of the first Gaussian filter in z + sigma2_x: float (= 2) + Sigma of the second Gaussian filter in x + sigma2_y: float (= 2) + Sigma of the second Gaussian filter in y + sigma2_z: float (= 2) + Sigma of the second Gaussian filter in z + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_differenceOfGaussian3D + """ + + 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)) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def extend_labeling_via_voronoi( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes a label map image and dilates the regions using a octagon shape until they + touch. The resulting label map is written to the output. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_extendLabelingViaVoronoi + """ + + return clic._extend_labeling_via_voronoi(device, input_image, output_image) + +@plugin_function(category=["filter"]) +def invert( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Computes the negative value of all pixels in a given image. It is recommended to + convert images to 32bit float before applying this operation.
f(x) =
+    x
For binary images, use binaryNot. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_invert + """ + + return clic._invert(device, input_image, output_image) + +@plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) +def label_spots( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Transforms a binary image with single pixles set to 1 to a labelled spots image. + Transforms a spots image as resulting from maximum/minimum detection in an image + of the same size where every spot has a number 1, 2,... n. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_labelSpots + """ + + return clic._label_spots(device, input_image, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def large_hessian_eigenvalue( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the Hessian eigenvalues and returns the large eigenvalue image. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._large_hessian_eigenvalue(device, input_image, output_image) + +@plugin_function +def maximum_of_all_pixels( + input_image: Image, + device: Optional[Device] =None +) -> float: + """Determines the maximum of all pixels in a given image. It will be stored in a + new row of ImageJs Results table in the column 'Max'. + + Parameters + ---------- + input_image: Image + Input image to process. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + float + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maximumOfAllPixels + """ + + return clic._maximum_of_all_pixels(device, input_image) + +@plugin_function +def minimum_of_all_pixels( + input_image: Image, + device: Optional[Device] =None +) -> float: + """Determines the minimum of all pixels in a given image. It will be stored in a + new row of ImageJs Results table in the column 'Min'. + + Parameters + ---------- + input_image: Image + Input image to process. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + float + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimumOfAllPixels + """ + + return clic._minimum_of_all_pixels(device, input_image) + +@plugin_function +def minimum_of_masked_pixels( + input_image: Image, + mask: Image, + device: Optional[Device] =None +) -> float: + """Determines the minimum intensity in a masked image. But only in pixels which + have nonzero values in another mask image. + + Parameters + ---------- + input_image: Image + Input image to process. + mask: Image + Input + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + float + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_minimumOfMaskedPixels + """ + + return clic._minimum_of_masked_pixels(device, input_image, mask) + +@plugin_function(category=["filter", "in assistant"]) +def opening_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =0, + radius_y: int =0, + radius_z: int =0, + device: Optional[Device] =None +) -> Image: + """Opening operator, boxshaped Applies morphological opening to intensity images + using a boxshaped footprint. This operator also works with binary images. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 0) + Radius along the x axis. + radius_y: int (= 0) + Radius along the y axis. + radius_z: int (= 0) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + warnings.warn("pyclesperanto.opening_box: This method is deprecated. Consider using opening() instead.", DeprecationWarning,) + return clic._opening_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) +def opening_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =0, + device: Optional[Device] =None +) -> Image: + """Opening operator, sphereshaped Applies morphological opening to intensity images + using a sphereshaped footprint. This operator also works with binary images. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: float (= 1) + Radius along the x axis. + radius_y: float (= 1) + Radius along the y axis. + radius_z: float (= 0) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + warnings.warn("pyclesperanto.opening_sphere: This method is deprecated. Consider using opening() instead.", DeprecationWarning,) + return clic._opening_sphere(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z)) + +@plugin_function(category=["filter", "in assistant", "bia-bob-suggestion"]) +def opening( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =0, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Opening operator, sphereshaped Applies morphological opening to intensity images + using a sphereshaped footprint. This operator also works with binary images. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: float (= 1) + Radius along the x axis. + radius_y: float (= 1) + Radius along the y axis. + radius_z: float (= 0) + Radius along the z axis. + connectivity: str (= "box") + Element shape, "box" or "sphere" + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._opening(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z), str(connectivity)) + +@plugin_function +def radians_to_degrees( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Converts radians to degrees + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._radians_to_degrees(device, input_image, output_image) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def reduce_labels_to_label_edges( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes a label map and reduces all labels to their edges. Label IDs stay and + background will be zero. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_reduceLabelsToLabelEdges + """ + + return clic._reduce_labels_to_label_edges(device, input_image, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def small_hessian_eigenvalue( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the Hessian eigenvalues and returns the small eigenvalue image. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._small_hessian_eigenvalue(device, input_image, output_image) + +@plugin_function(category=["filter"]) +def square( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Return the elementwise square of the input. This function is supposed to be + similar to its counterpart in numpy [1] + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://numpy.org/doc/stable/reference/generated/numpy.square.html + """ + + return clic._square(device, input_image, output_image) + +@plugin_function(category=["combine", "in assistant", "bia-bob-suggestion"]) +def squared_difference( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Determines the squared difference pixel by pixel between two images. + + Parameters + ---------- + input_image0: Image + First input image. + input_image1: Image + Second input image. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_squaredDifference + """ + + return clic._squared_difference(device, input_image0, input_image1, output_image) + +@plugin_function(category=["filter", "edge detection", "in assistant"]) +def standard_deviation_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local standard deviation of a pixels box neighborhood. The box size + is specified by its halfwidth, halfheight and halfdepth (radius). If 2D images + are given, radius_z will be ignored. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius along the x axis. + radius_y: int (= 1) + Radius along the y axis. + radius_z: int (= 1) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_standardDeviationBox + """ + + warnings.warn("pyclesperanto.standard_deviation_box: This method is deprecated. Consider using standard_deviation() instead.", DeprecationWarning,) + return clic._standard_deviation_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "edge detection", "in assistant", "bia-bob-suggestion"]) +def standard_deviation_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Computes the local standard deviation of a pixels sphere neighborhood. The box + size is specified by its halfwidth, halfheight and halfdepth (radius). If 2D + images are given, radius_z will be ignored. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius along the x axis. + radius_y: int (= 1) + Radius along the y axis. + radius_z: int (= 1) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_standardDeviationSphere + """ + + warnings.warn("pyclesperanto.standard_deviation_sphere: This method is deprecated. Consider using standard_deviation() instead.", DeprecationWarning,) + return clic._standard_deviation_sphere(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "edge detection", "in assistant", "bia-bob-suggestion"]) +def standard_deviation( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Computes the local standard deviation of a pixels sphere neighborhood. The box + size is specified by its halfwidth, halfheight and halfdepth (radius). If 2D + images are given, radius_z will be ignored. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + radius_x: int (= 1) + Radius along the x axis. + radius_y: int (= 1) + Radius along the y axis. + radius_z: int (= 1) + Radius along the z axis. + connectivity: str (= "box") + Neigborhood shape, "box" or "sphere" + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_standardDeviationBox + [2] https://clij.github.io/clij2-docs/reference_standardDeviationSphere + """ + + return clic._standard_deviation(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z), str(connectivity)) + +@plugin_function(category=["filter", "background removal", "in assistant", "bia-bob-suggestion"]) +def subtract_gaussian_background( + input_image: Image, + output_image: Optional[Image] =None, + sigma_x: float =2, + sigma_y: float =2, + sigma_z: float =2, + device: Optional[Device] =None +) -> Image: + """Applies Gaussian blur to the input image and subtracts the result from the + original. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output result image. + sigma_x: float (= 2) + Radius along the x axis. + sigma_y: float (= 2) + Radius along the y axis. + sigma_z: float (= 2) + Radius along the z axis. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_subtractGaussianBackground + """ + + return clic._subtract_gaussian_background(device, input_image, output_image, float(sigma_x), float(sigma_y), float(sigma_z)) + +@plugin_function(category=["combine", "in assistant"]) +def subtract_images( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Subtracts one image X from another image Y pixel wise.
f(x, y) = x y
+ + Parameters + ---------- + input_image0: Image + First input image. + input_image1: Image + Second input image. + output_image: Optional[Image] (= None) + Output result image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_subtractImages + """ + + return clic._subtract_images(device, input_image0, input_image1, output_image) + +@plugin_function +def sum_of_all_pixels( + input_image: Optional[Image] =None, + device: Optional[Device] =None +) -> float: + """Determines the sum of all pixels in a given image. It will be stored in a new + row of ImageJs Results table in the column 'Sum'. + + Parameters + ---------- + input_image: Optional[Image] (= None) + Input image to process. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + float + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_sumOfAllPixels + """ + + return clic._sum_of_all_pixels(device, input_image) + +@plugin_function(category=["filter", "background removal", "in assistant"]) +def top_hat_box( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: int =1, + radius_y: int =1, + radius_z: int =1, + device: Optional[Device] =None +) -> Image: + """Applies a tophat filter for background subtraction to the input image. + + Parameters + ---------- + input_image: Image + The input image where the background is subtracted from. + output_image: Optional[Image] (= None) + The output image where results are written into. + radius_x: int (= 1) + Radius of the background determination region in X. + radius_y: int (= 1) + Radius of the background determination region in Y. + radius_z: int (= 1) + Radius of the background determination region in Z. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_topHatBox + """ + + warnings.warn("pyclesperanto.top_hat_box: This method is deprecated. Consider using top_hat() instead.", DeprecationWarning,) + return clic._top_hat_box(device, input_image, output_image, int(radius_x), int(radius_y), int(radius_z)) + +@plugin_function(category=["filter", "background removal", "in assistant", "bia-bob-suggestion"]) +def top_hat_sphere( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =1, + device: Optional[Device] =None +) -> Image: + """Applies a tophat filter for background subtraction to the input image. + + Parameters + ---------- + input_image: Image + The input image where the background is subtracted from. + output_image: Optional[Image] (= None) + The output image where results are written into. + radius_x: float (= 1) + Radius of the background determination region in X. + radius_y: float (= 1) + Radius of the background determination region in Y. + radius_z: float (= 1) + Radius of the background determination region in Z. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_topHatSphere + """ + + warnings.warn("pyclesperanto.top_hat_sphere: This method is deprecated. Consider using top_hat() instead.", DeprecationWarning,) + return clic._top_hat_sphere(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z)) + +@plugin_function(category=["filter", "background removal", "in assistant", "bia-bob-suggestion"]) +def top_hat( + input_image: Image, + output_image: Optional[Image] =None, + radius_x: float =1, + radius_y: float =1, + radius_z: float =1, + connectivity: str ="box", + device: Optional[Device] =None +) -> Image: + """Applies a tophat filter for background subtraction to the input image. + + Parameters + ---------- + input_image: Image + The input image where the background is subtracted from. + output_image: Optional[Image] (= None) + The output image where results are written into. + radius_x: float (= 1) + Radius of the background determination region in X. + radius_y: float (= 1) + Radius of the background determination region in Y. + radius_z: float (= 1) + Radius of the background determination region in Z. + connectivity: str (= "box") + Element shape, "box" or "sphere" + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_topHatBox + [2] https://clij.github.io/clij2-docs/reference_topHatSphere + """ + + return clic._top_hat(device, input_image, output_image, float(radius_x), float(radius_y), float(radius_z), str(connectivity)) \ No newline at end of file diff --git a/pyclesperanto/_tier3.py b/pyclesperanto/_tier3.py new file mode 100644 index 0000000..4991662 --- /dev/null +++ b/pyclesperanto/_tier3.py @@ -0,0 +1,515 @@ +# +# This code is auto-generated from CLIc 'cle::tier3.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +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: + """Determines the bounding box of all nonzero pixels in a binary image. The + positions are returned in an array of 6 values as follows: minX, minY, minZ, + maxX, maxY, maxZ. + + Parameters + ---------- + input_image: Image + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + list + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_boundingBox + """ + + return clic._bounding_box(device, input_image) + +@plugin_function +def center_of_mass( + input_image: Image, + device: Optional[Device] =None +) -> list: + """Determines the center of mass of an image or image stack. It writes the result + in the results table in the columns MassX, MassY and MassZ. + + Parameters + ---------- + input_image: Image + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + list + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_centerOfMass + """ + + return clic._center_of_mass(device, input_image) + +@plugin_function +def exclude_labels( + input_image: Image, + list: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """This operation removes labels from a labelmap and renumbers the remaining + labels. Hand over a binary flag list vector starting with a flag for the + background, continuing with label1, label2,... For example if you pass + 0,1,0,0,1: Labels 1 and 4 will be removed (those with a 1 in the vector will be + excluded). Labels 2 and 3 will be kept and renumbered to 1 and 2. + + Parameters + ---------- + input_image: Image + + list: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_excludeLabels + """ + + return clic._exclude_labels(device, input_image, list, output_image) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def exclude_labels_on_edges( + input_image: Image, + output_image: Optional[Image] =None, + exclude_x: bool =True, + exclude_y: bool =True, + exclude_z: bool =True, + device: Optional[Device] =None +) -> Image: + """Removes all labels from a label map which touch the edges of the image. + Remaining label elements are renumbered afterwards. + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + exclude_x: bool (= True) + Exclude labels along min and max x + exclude_y: bool (= True) + Exclude labels along min and max y + exclude_z: bool (= True) + Exclude labels along min and max z + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_excludeLabelsOnEdges + """ + + return clic._exclude_labels_on_edges(device, input_image, output_image, exclude_x, exclude_y, exclude_z) + +@plugin_function +def flag_existing_labels( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Given a label map this function will generate a binary vector where all pixels + are set to 1 if label with given xcoordinate in the vector exists. For example a + label image such as ``` 0 1 3 5 ``` will produce a flag_vector like this: ``` 1 + 1 0 1 0 1 ``` + + Parameters + ---------- + input_image: Image + a label image + output_image: Optional[Image] (= None) + binary vector, if given should have size 1*n with n = maximum label + 1 + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._flag_existing_labels(device, input_image, output_image) + +@plugin_function(category=["filter", "in assistant"]) +def gamma_correction( + input_image: Image, + output_image: Optional[Image] =None, + gamma: float =1, + device: Optional[Device] =None +) -> Image: + """Applies a gamma correction to an image. Therefore, all pixels x of the Image X + are normalized and the power to gamma g is computed, before normlization is + reversed (^ is the power operator):f(x) = (x / max(X)) ^ gamma * max(X) + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + gamma: float (= 1) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_gammaCorrection + """ + + return clic._gamma_correction(device, input_image, output_image, float(gamma)) + +@plugin_function +def generate_binary_overlap_matrix( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes two labelmaps with n and m labels and generates a (n+1)*(m+1) matrix where + all pixels are set to 0 exept those where labels overlap between the label maps. + For example, if labels 3 in labelmap1 and 4 in labelmap2 are touching then the + pixel (3,4) in the matrix will be set to 1. + + Parameters + ---------- + input_image0: Image + + input_image1: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_generateBinaryOverlapMatrix + """ + + return clic._generate_binary_overlap_matrix(device, input_image0, input_image1, output_image) + +@plugin_function(category=["bia-bob-suggestion"]) +def generate_touch_matrix( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes a labelmap with n labels and generates a (n+1)*(n+1) matrix where all + pixels are set to 0 exept those where labels are touching. Only half of the + matrix is filled (with x < y). For example, if labels 3 and 4 are touching then + the pixel (3,4) in the matrix will be set to 1. The touch matrix is a + representation of a region adjacency graph + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_generateTouchMatrix + """ + + return clic._generate_touch_matrix(device, input_image, output_image) + +@plugin_function +def histogram( + input_image: Image, + output_image: Optional[Image] =None, + nbins: int =256, + min: Optional[float] =None, + max: Optional[float] =None, + device: Optional[Device] =None +) -> Image: + """Determines the histogram of a given image. The histogram image is of dimensions + number_of_bins/1/1; a 3D image with height=1 and depth=1. Histogram bins contain + the number of pixels with intensity in this corresponding bin. The histogram + bins are uniformly distributed between given minimum and maximum grey value + intensity. If the flag determine_min_max is set, minimum and maximum intensity + will be determined. When calling this operation many times, it is recommended to + determine minimum and maximum intensity once at the beginning and handing over + these values. Author(s): Robert Haase adapted work from Aaftab Munshi, Benedict + Gaster, Timothy Mattson, James Fung, Dan Ginsburg License: adapted code from + https://github.com/bgaster/openclbooksamples/blob/master/src/Chapter_14/histogram/histogram_image.cl + It was published unter BSD license according to + https://code.google.com/archive/p/openclbooksamples/ Book: OpenCL(R) Programming + Guide Authors: Aaftab Munshi, Benedict Gaster, Timothy Mattson, James Fung, Dan + Ginsburg ISBN10: 0321749642 ISBN13: 9780321749642 Publisher: AddisonWesley + Professional URLs: http://safari.informit.com/9780132488006/ + http://www.openclprogrammingguide.com + + Parameters + ---------- + input_image: Image + + 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 + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_histogram + """ + + return clic._histogram(device, input_image, output_image, int(nbins), min, max) + +@plugin_function +def jaccard_index( + input_image0: Image, + input_image1: Image, + device: Optional[Device] =None +) -> float: + """Determines the overlap of two binary images using the Jaccard index. A value of + 0 suggests no overlap, 1 means perfect overlap. The resulting Jaccard index is + saved to the results table in the 'Jaccard_Index' column. Note that the + SorensenDice coefficient can be calculated from the Jaccard index j using this + formula:
s = f(j) = 2 j / (j + 1)
+ + Parameters + ---------- + input_image0: Image + + input_image1: Image + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + float + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_jaccardIndex + """ + + return clic._jaccard_index(device, input_image0, input_image1) + +@plugin_function(category=["bia-bob-suggestion"]) +def labelled_spots_to_pointlist( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Generates a coordinate list of points in a labelled spot image. Transforms a + labelmap of spots (single pixels with values 1, 2,..., n for n spots) as + resulting from connected components analysis in an image where every column + contains d pixels (with d = dimensionality of the original image) with the + coordinates of the maxima/minima. + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_labelledSpotsToPointList + """ + + return clic._labelled_spots_to_pointlist(device, input_image, output_image) + +@plugin_function +def maximum_position( + input_image: Image, + device: Optional[Device] =None +) -> list: + """Determines the position of the maximum of all pixels in a given image. + + Parameters + ---------- + input_image: Image + The image of which the position of the maximum of all pixels will be determined. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + list + """ + + return clic._maximum_position(device, input_image) + +@plugin_function +def mean_of_all_pixels( + input_image: Image, + device: Optional[Device] =None +) -> float: + """Determines the mean average of all pixels in a given image. + + Parameters + ---------- + input_image: Image + The image of which the mean average of all pixels will be determined. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + float + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_meanOfAllPixels + """ + + return clic._mean_of_all_pixels(device, input_image) + +@plugin_function +def minimum_position( + input_image: Image, + device: Optional[Device] =None +) -> list: + """Determines the position of the minimum of all pixels in a given image. + + Parameters + ---------- + input_image: Image + The image of which the position of the minimum of all pixels will be determined. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + list + """ + + return clic._minimum_position(device, input_image) + +@plugin_function +def morphological_chan_vese( + input_image: Image, + output_image: Optional[Image] =None, + num_iter: int =100, + smoothing: int =1, + lambda1: float =1, + lambda2: float =1, + device: Optional[Device] =None +) -> Image: + """Compute an active contour model using the Chan-Vese morphological algorithm. The + output image (dst) should also be initialisation of the contour. If not provided + (nullptr), the function will use a checkboard pattern initialisation. + + Parameters + ---------- + input_image: Image + Input image to process. + output_image: Optional[Image] (= None) + Output contour, can also be use to provide initialisation. + num_iter: int (= 100) + Number of iterations. + smoothing: int (= 1) + Number of + lambda1: float (= 1) + Lambda1. + lambda2: float (= 1) + Lambda2. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + 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) \ No newline at end of file diff --git a/pyclesperanto/_tier4.py b/pyclesperanto/_tier4.py new file mode 100644 index 0000000..ad3507c --- /dev/null +++ b/pyclesperanto/_tier4.py @@ -0,0 +1,169 @@ +# +# This code is auto-generated from CLIc 'cle::tier4.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +from ._core import Device +from ._decorators import plugin_function + +clic = importlib.import_module('._pyclesperanto', package='pyclesperanto') + +@plugin_function +def label_bounding_box( + input_image: Image, + label_id: int, + device: Optional[Device] =None +) -> list: + """Determines the bounding box of the specified label from a label image. The + positions are returned in an array of 6 values as follows: minX, minY, minZ, + maxX, maxY, maxZ. + + Parameters + ---------- + input_image: Image + + label_id: int + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + list + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_boundingBox + """ + + return clic._label_bounding_box(device, input_image, int(label_id)) + +@plugin_function(category=["in assistant", "combine", "bia-bob-suggestion"]) +def mean_squared_error( + input_image0: Image, + input_image1: Image, + device: Optional[Device] =None +) -> float: + """Determines the mean squared error (MSE) between two images. The MSE will be + stored in a new row of ImageJs Results table in the column 'MSE'. + + Parameters + ---------- + input_image0: Image + + input_image1: Image + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + float + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_meanSquaredError + """ + + return clic._mean_squared_error(device, input_image0, input_image1) + +@plugin_function +def spots_to_pointlist( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Transforms a spots image as resulting from maximum/minimum detection in an image + where every column contains d pixels (with d = dimensionality of the original + image) with the coordinates of the maxima/minima. + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_spotsToPointList + """ + + return clic._spots_to_pointlist(device, input_image, output_image) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def relabel_sequential( + input_image: Image, + output_image: Optional[Image] =None, + blocksize: int =4096, + device: Optional[Device] =None +) -> Image: + """Analyses a label map and if there are gaps in the indexing (e.g. label 5 is not + present) all subsequent labels will be relabelled. Thus, afterwards number of + labels and maximum label index are equal. This operation is mostly performed on + the CPU. + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + blocksize: int (= 4096) + Renumbering is done in blocks for performance reasons. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_closeIndexGapsInLabelMap + """ + + return clic._relabel_sequential(device, input_image, output_image, int(blocksize)) + +@plugin_function(category=["binarize", "in assistant", "bia-bob-suggestion"]) +def threshold_otsu( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Binarizes an image using Otsu's threshold method [3] implemented in + scikit-image[2] using a histogram determined on the GPU to create binary images. + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + 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 + """ + + return clic._threshold_otsu(device, input_image, output_image) \ No newline at end of file diff --git a/pyclesperanto/_tier5.py b/pyclesperanto/_tier5.py new file mode 100644 index 0000000..95a98ad --- /dev/null +++ b/pyclesperanto/_tier5.py @@ -0,0 +1,106 @@ +# +# This code is auto-generated from CLIc 'cle::tier5.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +from ._core import Device +from ._decorators import plugin_function + +clic = importlib.import_module('._pyclesperanto', package='pyclesperanto') + +@plugin_function(category=["combine"]) +def array_equal( + input_image0: Image, + input_image1: Image, + device: Optional[Device] =None +) -> bool: + """Compares if all pixels of two images are identical. If shape of the images or + any pixel are different, returns False. True otherwise This function is supposed + to work similarly like its counterpart in numpy [1]. + + Parameters + ---------- + input_image0: Image + + input_image1: Image + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + bool + + References + ---------- + [1] https://numpy.org/doc/stable/reference/generated/numpy.array_equal.html + """ + + return clic._array_equal(device, input_image0, input_image1) + +@plugin_function(category=["label processing", "combine labels", "in assistant", "bia-bob-suggestion"]) +def combine_labels( + input_image0: Image, + input_image1: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Combines two label images by adding labels of a given label image to another. + Labels in the second image overwrite labels in the first passed image. + Afterwards, labels are relabeled sequentially. + + Parameters + ---------- + input_image0: Image + label image to add labels to. + input_image1: Image + label image to add labels from. + output_image: Optional[Image] (= None) + Output label image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._combine_labels(device, input_image0, input_image1, output_image) + +@plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) +def connected_components_labeling( + input_image: Image, + output_image: Optional[Image] =None, + connectivity: str ='box', + device: Optional[Device] =None +) -> Image: + """Performs connected components analysis inspecting the box neighborhood of every + pixel to a binary image and generates a label map. + + Parameters + ---------- + input_image: Image + Binary image to label. + output_image: Optional[Image] (= None) + Output label image. + connectivity: str (= 'box') + Defines pixel neighborhood relationship, "box" or "sphere". + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_connectedComponentsLabelingBox + """ + + return clic._connected_components_labeling(device, input_image, output_image, str(connectivity)) \ No newline at end of file diff --git a/pyclesperanto/_tier6.py b/pyclesperanto/_tier6.py new file mode 100644 index 0000000..1d38782 --- /dev/null +++ b/pyclesperanto/_tier6.py @@ -0,0 +1,176 @@ +# +# This code is auto-generated from CLIc 'cle::tier6.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +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( + input_image: Image, + output_image: Optional[Image] =None, + radius: int =2, + device: Optional[Device] =None +) -> Image: + """Dilates labels to a larger size. No label overwrites another label. Similar to + the implementation in scikitimage [2] and MorpholibJ[3] Notes * This operation + assumes input images are isotropic. + + Parameters + ---------- + input_image: Image + label image to erode + output_image: Optional[Image] (= None) + result + radius: int (= 2) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._dilate_labels(device, input_image, output_image, int(radius)) + +@plugin_function(category=["label processing", "in assistant"]) +def erode_labels( + input_image: Image, + output_image: Optional[Image] =None, + radius: int =1, + relabel: bool =False, + device: Optional[Device] =None +) -> Image: + """Erodes labels to a smaller size. Note: Depending on the label image and the + radius, labels may disappear and labels may split into multiple islands. Thus, + overlapping labels of input and output may not have the same identifier. Notes * + This operation assumes input images are isotropic. + + Parameters + ---------- + input_image: Image + result + output_image: Optional[Image] (= None) + + radius: int (= 1) + + relabel: bool (= False) + and all label indices exist. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._erode_labels(device, input_image, output_image, int(radius), relabel) + +@plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) +def gauss_otsu_labeling( + input_image0: Image, + output_image: Optional[Image] =None, + outline_sigma: float =0, + device: Optional[Device] =None +) -> Image: + """Labels objects directly from grey-value images. The outline_sigma parameter + allows tuning the segmentation result. Under the hood, this filter applies a + Gaussian blur, Otsu-thresholding [1] and connected component labeling [2]. The + thresholded binary image is flooded using the Voronoi tesselation approach + starting from the found local maxima. + + Parameters + ---------- + input_image0: Image + intensity image to add labels + output_image: Optional[Image] (= None) + Output label image. + outline_sigma: float (= 0) + Gaussian blur sigma along all axes + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://ieeexplore.ieee.org/document/4310076 + [2] https://en.wikipedia.org/wiki/Connected-component_labeling + """ + + return clic._gauss_otsu_labeling(device, input_image0, output_image, float(outline_sigma)) + +@plugin_function(category=["label", "bia-bob-suggestion"]) +def masked_voronoi_labeling( + input_image: Image, + mask: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes a binary image, labels connected components and dilates the regions using + a octagon shape until they touch. The region growing is limited to a masked + area. The resulting label map is written to the output. + + Parameters + ---------- + input_image: Image + + mask: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_maskedVoronoiLabeling + """ + + return clic._masked_voronoi_labeling(device, input_image, mask, output_image) + +@plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) +def voronoi_labeling( + input_image: Image, + output_image: Optional[Image] =None, + device: Optional[Device] =None +) -> Image: + """Takes a binary image, labels connected components and dilates the regions using + a octagon shape until they touch. The resulting label map is written to the + output. + + Parameters + ---------- + input_image: Image + + output_image: Optional[Image] (= None) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://clij.github.io/clij2-docs/reference_voronoiLabeling + """ + + return clic._voronoi_labeling(device, input_image, output_image) \ No newline at end of file diff --git a/pyclesperanto/_tier7.py b/pyclesperanto/_tier7.py new file mode 100644 index 0000000..6f04b9d --- /dev/null +++ b/pyclesperanto/_tier7.py @@ -0,0 +1,401 @@ +# +# This code is auto-generated from CLIc 'cle::tier7.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +from ._core import Device +from ._decorators import plugin_function + +clic = importlib.import_module('._pyclesperanto', package='pyclesperanto') + +@plugin_function +def affine_transform( + input_image: Image, + output_image: Optional[Image] =None, + transform_matrix: Optional[list] =None, + interpolate: bool =False, + resize: bool =False, + device: Optional[Device] =None +) -> Image: + """Apply an affine transformation matrix to an array and return the result. The + transformation matrix must be 3x3 or 4x4 stored as a 1D array. The matrix + should be row-major, i.e. the first 3 elements are the first row of the matrix. + If no matrix is given, the identity matrix will be used. + + Parameters + ---------- + input_image: Image + Input Array to be transformed. + output_image: Optional[Image] (= None) + Output Array. + transform_matrix: Optional[list] (= None) + Affine transformation matrix (3x3 or 4x4). + interpolate: bool (= False) + If true, bi/trilinear interpolation will be applied, if hardware allows. + resize: bool (= False) + Automatically determines the size of the output depending on the rotation angles. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._affine_transform(device, input_image, output_image, transform_matrix, interpolate, resize) + +@plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) +def eroded_otsu_labeling( + input_image: Image, + output_image: Optional[Image] =None, + number_of_erosions: int =5, + outline_sigma: float =2, + device: Optional[Device] =None +) -> Image: + """Segments and labels an image using blurring, Otsu-thresholding, binary erosion + and masked Voronoi-labeling. After bluring and Otsu-thresholding the image, + iterative binary erosion is applied. Objects in the eroded image are labeled + and the labels are extended to fit again into the initial binary image using + masked-Voronoi labeling. This function is similar to voronoi_otsu_labeling. It + is intended to deal better in case labels of objects swapping into each other + if objects are dense. Like when using Voronoi-Otsu-labeling, small objects may + disappear when applying this operation. This function is inspired by a similar + implementation in Java by Jan Brocher (Biovoxxel) [0] [1] + + Parameters + ---------- + input_image: Image + Input Array to be transformed. + output_image: Optional[Image] (= None) + Output Array. + number_of_erosions: int (= 5) + Number of iteration of erosion. + outline_sigma: float (= 2) + Gaussian blur sigma applied before Otsu thresholding. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + References + ---------- + [1] https://github.com/biovoxxel/bv3dbox (BV_LabelSplitter.java#L83) + [2] https://zenodo.org/badge/latestdoi/434949702 + """ + + return clic._eroded_otsu_labeling(device, input_image, output_image, int(number_of_erosions), float(outline_sigma)) + +@plugin_function(category=["transform", "in assistant", "bia-bob-suggestion"]) +def rigid_transform( + input_image: Image, + output_image: Optional[Image] =None, + translate_x: float =0, + translate_y: float =0, + translate_z: float =0, + angle_x: float =0, + angle_y: float =0, + angle_z: float =0, + centered: bool =True, + interpolate: bool =False, + resize: bool =False, + device: Optional[Device] =None +) -> Image: + """Translate the image by a given vector and rotate it by given angles. Angles are + given in degrees. To convert radians to degrees, use this formula: + angle_in_degrees = angle_in_radians / numpy.pi * 180.0 + + Parameters + ---------- + input_image: Image + Input Array to be transformed. + output_image: Optional[Image] (= None) + Output Array. + translate_x: float (= 0) + Translation along x axis in pixels. + translate_y: float (= 0) + Translation along y axis in pixels. + translate_z: float (= 0) + Translation along z axis in pixels. + angle_x: float (= 0) + Rotation around x axis in radians. + angle_y: float (= 0) + Rotation around y axis in radians. + angle_z: float (= 0) + Rotation around z axis in radians. + centered: bool (= True) + If true, rotate image around center, else around the origin. + interpolate: bool (= False) + If true, bi/trilinear interpolation will be applied, if hardware allows. + resize: bool (= False) + Automatically determines the size of the output depending on the rotation angles. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + 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) + +@plugin_function(category=["transform", "in assistant"]) +def rotate( + input_image: Image, + output_image: Optional[Image] =None, + angle_x: float =0, + angle_y: float =0, + angle_z: float =0, + centered: bool =True, + interpolate: bool =False, + resize: bool =False, + device: Optional[Device] =None +) -> Image: + """Rotate the image by given angles. Angles are given in degrees. To convert + radians to degrees, use this formula: angle_in_degrees = angle_in_radians / + numpy.pi * 180.0 + + Parameters + ---------- + input_image: Image + Input Array to be rotated. + output_image: Optional[Image] (= None) + Output Array. + angle_x: float (= 0) + Rotation around x axis in degrees. + angle_y: float (= 0) + Rotation around y axis in degrees. + angle_z: float (= 0) + Rotation around z axis in degrees. + centered: bool (= True) + If true, rotate image around center, else around the origin. + interpolate: bool (= False) + If true, bi/trilinear interpolation will be applied, if hardware allows. + resize: bool (= False) + Automatically determines the size of the output depending on the rotation angles. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._rotate(device, input_image, output_image, float(angle_x), float(angle_y), float(angle_z), centered, interpolate, resize) + +@plugin_function(category=["transform", "in assistant"]) +def scale( + input_image: Image, + output_image: Optional[Image] =None, + factor_x: float =1, + factor_y: float =1, + factor_z: float =1, + centered: bool =True, + interpolate: bool =False, + resize: bool =False, + device: Optional[Device] =None +) -> Image: + """Scale the image by given factors. + + Parameters + ---------- + input_image: Image + Input Array to be scaleded. + output_image: Optional[Image] (= None) + Output Array. + factor_x: float (= 1) + Scaling along x axis. + factor_y: float (= 1) + Scaling along y axis. + factor_z: float (= 1) + Scaling along z axis. + centered: bool (= True) + If true, the image will be scaled to the center of the image. + interpolate: bool (= False) + If true, bi/trilinear interplation will be applied. + resize: bool (= False) + Automatically determines output size image. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._scale(device, input_image, output_image, float(factor_x), float(factor_y), float(factor_z), centered, interpolate, resize) + +@plugin_function(category=["transform", "in assistant"]) +def translate( + input_image: Image, + output_image: Optional[Image] =None, + translate_x: float =0, + translate_y: float =0, + translate_z: float =0, + interpolate: bool =False, + device: Optional[Device] =None +) -> Image: + """Translate the image by a given vector. + + Parameters + ---------- + input_image: Image + Input Array to be translated. + output_image: Optional[Image] (= None) + Output Array. + translate_x: float (= 0) + Translation along x axis in pixels. + translate_y: float (= 0) + Translation along y axis in pixels. + translate_z: float (= 0) + Translation along z axis in pixels. + interpolate: bool (= False) + If true, bi/trilinear interplation will be applied. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._translate(device, input_image, output_image, float(translate_x), float(translate_y), float(translate_z), interpolate) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def closing_labels( + input_image: Image, + output_image: Optional[Image] =None, + radius: int =0, + device: Optional[Device] =None +) -> Image: + """Apply a morphological closing operation to a label image. The operation consists + of iterative dilation and erosion of the labels. With every iteration, box and + diamond/sphere structuring elements are used and thus, the operation has an + octagon as structuring element. Notes * This operation assumes input images are + isotropic. + + Parameters + ---------- + input_image: Image + Input label Array. + output_image: Optional[Image] (= None) + Output label Array. + radius: int (= 0) + Radius size for the closing. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._closing_labels(device, input_image, output_image, int(radius)) + +@plugin_function +def erode_connected_labels( + input_image: Image, + output_image: Optional[Image] =None, + radius: int =1, + device: Optional[Device] =None +) -> Image: + """Erodes labels to a smaller size. Note: Depending on the label image and the + radius, labels may disappear and labels may split into multiple islands. Thus, + overlapping labels of input and output may not have the same identifier. + + Parameters + ---------- + input_image: Image + result + output_image: Optional[Image] (= None) + + radius: int (= 1) + + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._erode_connected_labels(device, input_image, output_image, int(radius)) + +@plugin_function(category=["label processing", "in assistant", "bia-bob-suggestion"]) +def opening_labels( + input_image: Image, + output_image: Optional[Image] =None, + radius: int =0, + device: Optional[Device] =None +) -> Image: + """Apply a morphological opening operation to a label image. The operation consists + of iterative erosion and dilation of the labels. With every iteration, box and + diamond/sphere structuring elements are used and thus, the operation has an + octagon as structuring element. Notes * This operation assumes input images are + isotropic. + + Parameters + ---------- + input_image: Image + Input label Array. + output_image: Optional[Image] (= None) + Output label Array. + radius: int (= 0) + Radius size for the opening. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._opening_labels(device, input_image, output_image, int(radius)) + +@plugin_function(category=["label", "in assistant", "bia-bob-suggestion"]) +def voronoi_otsu_labeling( + input_image: Image, + output_image: Optional[Image] =None, + spot_sigma: float =2, + outline_sigma: float =2, + device: Optional[Device] =None +) -> Image: + """Labels objects directly from greyvalue images. The two sigma parameters allow + tuning the segmentation result. Under the hood, this filter applies two Gaussian + blurs, spot detection, Otsuthresholding [2] and Voronoilabeling [3]. The + thresholded binary image is flooded using the Voronoi tesselation approach + starting from the found local maxima. Notes * This operation assumes input + images are isotropic. + + Parameters + ---------- + input_image: Image + Input intensity Array. + output_image: Optional[Image] (= None) + Output label Array. + spot_sigma: float (= 2) + Controls how close detected cells can be. + outline_sigma: float (= 2) + Controls how precise segmented objects are outlined. + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + + 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 + """ + + return clic._voronoi_otsu_labeling(device, input_image, output_image, float(spot_sigma), float(outline_sigma)) \ No newline at end of file diff --git a/pyclesperanto/_tier8.py b/pyclesperanto/_tier8.py new file mode 100644 index 0000000..ddaa758 --- /dev/null +++ b/pyclesperanto/_tier8.py @@ -0,0 +1,74 @@ +# +# This code is auto-generated from CLIc 'cle::tier8.hpp' file, do not edit manually. +# + +import importlib +import warnings +from typing import Optional + +import numpy as np + +from ._array import Image +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( + input_image: Image, + output_image: Optional[Image] =None, + radius: int =0, + device: Optional[Device] =None +) -> Image: + """Apply a morphological opening operation to a label image and afterwards fills + gaps between the labels using voronoi-labeling. Finally, the result label + image is masked so that all background pixels remain background pixels. Note: + It is recommended to process isotropic label images. + + Parameters + ---------- + input_image: Image + Input label image + output_image: Optional[Image] (= None) + Output label image + radius: int (= 0) + Smoothing + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._smooth_labels(device, input_image, output_image, int(radius)) + +@plugin_function +def smooth_connected_labels( + input_image: Image, + output_image: Optional[Image] =None, + radius: int =0, + device: Optional[Device] =None +) -> Image: + """Apply a morphological erosion and dilation of the label image with respect to + the connectivity of the labels. Note: It is recommended to process isotropic + label images. + + Parameters + ---------- + input_image: Image + Input label image + output_image: Optional[Image] (= None) + Output label image + radius: int (= 0) + Smoothing + device: Optional[Device] (= None) + Device to perform the operation on. + + Returns + ------- + Image + """ + + return clic._smooth_connected_labels(device, input_image, output_image, int(radius)) \ No newline at end of file diff --git a/src/wrapper/tier1_.cpp b/src/wrapper/tier1_.cpp new file mode 100644 index 0000000..a09dd32 --- /dev/null +++ b/src/wrapper/tier1_.cpp @@ -0,0 +1,572 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier1.hpp" + +namespace py = pybind11; + +auto tier1_(py::module &m) -> void { +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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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")); +} \ No newline at end of file diff --git a/src/wrapper/tier2_.cpp b/src/wrapper/tier2_.cpp new file mode 100644 index 0000000..2f79744 --- /dev/null +++ b/src/wrapper/tier2_.cpp @@ -0,0 +1,188 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier2.hpp" + +namespace py = pybind11; + +auto tier2_(py::module &m) -> void { +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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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")); +} \ No newline at end of file diff --git a/src/wrapper/tier3_.cpp b/src/wrapper/tier3_.cpp new file mode 100644 index 0000000..695ef3e --- /dev/null +++ b/src/wrapper/tier3_.cpp @@ -0,0 +1,72 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier3.hpp" + +namespace py = pybind11; + +auto tier3_(py::module &m) -> void { +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 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 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 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 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 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 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 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 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 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 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 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 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 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 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")); +} \ No newline at end of file diff --git a/src/wrapper/tier4_.cpp b/src/wrapper/tier4_.cpp new file mode 100644 index 0000000..128611f --- /dev/null +++ b/src/wrapper/tier4_.cpp @@ -0,0 +1,28 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier4.hpp" + +namespace py = pybind11; + +auto tier4_(py::module &m) -> void { +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 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 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 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 cle::tier4::threshold_otsu_func from C++ CLIc.", + py::return_value_policy::take_ownership, + py::arg("device"), py::arg("src"), py::arg("dst")); +} \ No newline at end of file diff --git a/src/wrapper/tier5_.cpp b/src/wrapper/tier5_.cpp new file mode 100644 index 0000000..d092d00 --- /dev/null +++ b/src/wrapper/tier5_.cpp @@ -0,0 +1,20 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier5.hpp" + +namespace py = pybind11; + +auto tier5_(py::module &m) -> void { +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 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 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")); +} \ No newline at end of file diff --git a/src/wrapper/tier6_.cpp b/src/wrapper/tier6_.cpp new file mode 100644 index 0000000..8a8c380 --- /dev/null +++ b/src/wrapper/tier6_.cpp @@ -0,0 +1,28 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier6.hpp" + +namespace py = pybind11; + +auto tier6_(py::module &m) -> void { +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 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 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 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 cle::tier6::voronoi_labeling_func from C++ CLIc.", + py::return_value_policy::take_ownership, + py::arg("device"), py::arg("src"), py::arg("dst")); +} \ No newline at end of file diff --git a/src/wrapper/tier7_.cpp b/src/wrapper/tier7_.cpp new file mode 100644 index 0000000..be567a9 --- /dev/null +++ b/src/wrapper/tier7_.cpp @@ -0,0 +1,48 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier7.hpp" + +namespace py = pybind11; + +auto tier7_(py::module &m) -> void { +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 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 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 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 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 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 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 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 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 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")); +} \ No newline at end of file diff --git a/src/wrapper/tier8_.cpp b/src/wrapper/tier8_.cpp new file mode 100644 index 0000000..b055056 --- /dev/null +++ b/src/wrapper/tier8_.cpp @@ -0,0 +1,16 @@ +// this code is auto-generated, do not edit manually + +#include "pycle_wrapper.hpp" +#include "tier8.hpp" + +namespace py = pybind11; + +auto tier8_(py::module &m) -> void { +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 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")); +} \ No newline at end of file