API Documentation
Core functions
Collection of functions to explore and select system devices (e.g. GPUs) and initialize a device to work with.
- get_device() pyclesperanto._pyclesperanto._Device [source]
Return the current device instance
- Returns:
device
- Return type:
Device
- list_available_backends() list [source]
Retrieve a list of names of available backends
Will test system for available backends installed and return a list of their names.
- Returns:
name list
- Return type:
list[str]
- list_available_devices(device_type: str = 'all') list [source]
Retrieve a list of names of available devices
Will search the system for backend compatible device available and return a list of their names. This will NOT set the device! Use ‘select_device’ to select devices. Use ‘get_device’ to retrieve the current device.
- Parameters:
device_type (str, default = "all") – Type of device to be selected (e.g. “all”, “cpu”, “gpu”)
- Returns:
name list
- Return type:
list[str]
- select_backend(backend: str = 'opencl') str [source]
select backend
Select the backend used by pyclesperanto, OpenCL or CUDA. Default is OpenCL.
- Parameters:
type (str, default = "opencl") – determine the backend to use between opencl and cuda
- select_device(device_id: str | int = '', device_type: str = 'all') pyclesperanto._pyclesperanto._Device [source]
Select a device by ‘name’ or ‘index’ and by ‘type’, and store it as the current device
If selecting the device by string, the function compares the device name and substring. (e.g. “NVIDIA”, “RTX”, “Iris”, etc. will match the device name “NVIDIA RTX 2080” or “Intel Iris Pro”) If selecting the device by index, the function will select the device at the given index in the list of available devices. (e.g. 0, 1, 2, etc. will select the first, second, third, etc. device in the list) If device_id is an empty string, the function will select the first available device. The device_type enables selecting the type of device to be selected (e.g. “all”, “cpu”, “gpu”) To retrieve a list of available devices, use list_available_devices()
- Parameters:
device_id (Union[str, int], default = "") – Substring of device name or device index.
device_type (str, default = "all") – Type of device to be selected (e.g. “all”, “cpu”, “gpu”)
- Returns:
device
- Return type:
Device
- wait_for_kernel_to_finish(wait: bool = True, device: pyclesperanto._pyclesperanto._Device = None)[source]
Wait for kernel to finish
Enforce the system to wait for the kernel to finish before continuing. Introducing a slowdown in the workflow. This is useful for debugging purposes, benchmarking and profiling, as well as for complex workflows where the order of operations is important.
- Parameters:
wait (bool, default = True) – if True, wait for kernel to finish
device (Device, default = None) – the device to set the flag. If None, set it to the current device
Memory operations
Collection of functions to manage memory on the device, e.g. to allocate and free memory. And to send or retrieve data from the device.
- create(dim, dtype: type | None = None, mtype: str | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) pyclesperanto._pyclesperanto._Array [source]
Create a new image on the device.
- Parameters:
shape (Tuple[int, ...]) – Shape of the image in (z,y,x)
dtype (type, optional) – Data type of the image (np.int8, np.float32, etc.), np.float32 by default if None
mtype (str, optional) – Memory type of the image (buffer, image), buffer by default if None
device (Device, optional) – Device on which the image is created, current device by default if None
- Returns:
Created an empty Array on the device
- Return type:
Array
- create_like(array: numpy.ndarray | pyclesperanto._pyclesperanto._Array, dtype: type | None = None, mtype: str | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) pyclesperanto._pyclesperanto._Array [source]
Create a new image on the device with the same shape and dtype as the input image.
- Parameters:
array (Image) – Input image
dtype (type, optional) – Data type of the image (np.int8, np.float32, etc.), np.float32 by default if None
mtype (str, optional) – Memory type of the image (buffer, image), buffer by default if None
device (Device, optional) – Device on which the image is created, current device by default if None
- Returns:
Created an empty Array on the device
- Return type:
Array
- pull(array: numpy.ndarray | pyclesperanto._pyclesperanto._Array) numpy.ndarray [source]
Pull the input image from the device to the host.
- Parameters:
array (Image) – Input image
- Returns:
Image data
- Return type:
np.ndarray
- push(array, dtype: type | None = None, mtype: str | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) pyclesperanto._pyclesperanto._Array [source]
Create a new image on the device and push the input image into it.
- Parameters:
array (Image) – Input image
dtype (type, optional) – If provided, the input image is cast to the given dtype before being pushed to the device. Examples are np.int8, np.float32, etc. By default, no casting is performed and the dtype of the pushed image will match the dtype of the input image.
mtype (str, optional) – Memory type of the image (buffer, image), buffer by default if None
device (Device, optional) – Device on which the image is created, current device by default if None
- Returns:
Created Array on the device with the input image data
- Return type:
Array
Array class
The main data structure in pyclesperanto is the Array class which behave similar to numpy arrays, but point to a memory location on the device. Here is a collection of class functions, operators, and methods to work with Array objects. Mainly to create, manipulate, and transfer them, as well as to apply arythmetic and logical operations on them.
- empty(cls, shape, dtype=<class 'float'>, *args, **kwargs)[source]
Create an empty Array object from a shape.
- Parameters:
shape (tuple, list or np.ndarray) – The shape of the array, maximum 3 elements.
dtype (np.dtype, default float) – The dtype of the array.
mtype (str, optional) – The memory type, by default “buffer”
device (Device, optional) – The device, by default None
- Returns:
A new Array object.
- Return type:
Array
- empty_like(cls, arr)[source]
Create an empty Array object from an other array.
- Parameters:
arr (np.ndarray or Array or other array-like structure) – The array to create like.
- Returns:
The created array.
- Return type:
Array
- from_array(cls, arr, *args, **kwargs)[source]
Create an Array object from a numpy array (same shape, dtype, and memory).
- Parameters:
arr (np.ndarray) – The array to convert.
mtype (str, optional) – The memory type, by default “buffer”
device (Device, optional) – The device, by default None
- Returns:
The converted array.
- Return type:
Array
- get(self, origin: tuple | None = None, region: tuple | None = None) numpy.ndarray [source]
Get the content of the Array into a numpy array.
- Parameters:
origin (tuple, optional) – The origin of the region of interest, by default None
region (tuple, optional) – The region of interest, by default None
- Returns:
The array itself.
- Return type:
np.ndarray
- set(self, array: numpy.ndarray, origin: tuple | None = None, region: tuple | None = None) None [source]
Set the content of the Array to the given numpy array.
- Parameters:
array (np.ndarray) – The array to set from.
origin (tuple, optional) – The origin of the region of interest, by default None
region (tuple, optional) – The region of interest, by default None
- Returns:
The array itself.
- Return type:
Array
- to_device(cls, arr, *args, **kwargs)[source]
Create an Array object from a numpy array (same shape, dtype, and memory).
- Parameters:
arr (np.ndarray) – The array to convert.
mtype (str, optional) – The memory type, by default “buffer”
device (Device, optional) – The device, by default None
- Returns:
The converted array.
- Return type:
Array
- zeros(cls, shape, dtype=<class 'float'>, *args, **kwargs)[source]
Create an Array object full of zeros from a shape.
- Parameters:
shape (tuple, list or np.ndarray) – The shape of the array, maximum 3 elements.
dtype (np.dtype, default float) – The dtype of the array.
mtype (str, optional) – The memory type, by default “buffer”
device (Device, optional) – The device, by default None
- Returns:
The created array.
- Return type:
Array
Functionalities
Collection of operations aiming to help in displaying and analyzing results, e.g. to visualize images.
- execute(anchor=None, kernel_source: str = '', kernel_name: str = '', global_size: tuple = (1, 1, 1), parameters: dict = {}, constants: dict = {}, device: pyclesperanto._pyclesperanto._Device = None)[source]
Execute a kernel from a file or a string
Call, build, and execute a kernel compatible with CLIj framework. The kernel can be called from a file or a string.
- Parameters:
anchor (str, default = 'None') – Use __file__ when calling this method and the corresponding open.cl file lies in the same folder as the python file calling it. Ignored if kernel_source is a string.
kernel_source (str) – Filename of the open.cl file to be called, or string containing the open.cl source code
kernel_name (str) – Kernel method inside the open.cl file to be called most clij/clesperanto kernel functions have the same name as the file they are in
global_size (tuple (z,y,x), default = (1, 1, 1)) – Global_size according to OpenCL definition (usually shape of the destination image).
parameters (dict(str, [Array, float, int])) – Dictionary containing parameters. Take care: They must be of the right type and in the right order as specified in the open.cl file.
constants (dict(str, int), optional) – Dictionary with names/values which will be added to the define statements. They are necessary, e.g. to create arrays of a given maximum size in OpenCL as variable array lengths are not supported.
device (Device, default = None) – The device to execute the kernel on. If None, use the current device
- imshow(image, title: str | None = None, labels: bool | None = False, min_display_intensity: float | None = None, max_display_intensity: float | None = None, color_map: str | None = None, plot=None, colorbar: bool | None = False, colormap: str | matplotlib.colors.ListedColormap | None = None, alpha: float | None = None, continue_drawing: bool | None = False)[source]
Visualize an image, e.g. in Jupyter notebooks using matplotlib.
- Parameters:
image (np.ndarray) – numpy or OpenCL-backed image to visualize
title (str, optional) – Obsolete (kept for ImageJ-compatibility)
labels (bool, optional) – True: integer labels will be visualized with colors False: Specified or default colormap will be used to display intensities.
min_display_intensity (float, optional) – lower limit for display range
max_display_intensity (float, optional) – upper limit for display range
color_map (str, optional) – deprecated, use colormap instead
plot (matplotlib axis, optional) – Plot object where the image should be shown. Useful for putting multiple images in subfigures.
colorbar (bool, optional) – True puts a colorbar next to the image. Will not work with label images and when visualizing multiple images (continue_drawing=True).
colormap (str or matplotlib colormap, optional)
alpha (float, optional) – alpha blending value
continue_drawing (float) – True: the next shown image can be visualized on top of the current one, e.g. with alpha = 0.5
- native_execute(anchor=None, kernel_source: str = '', kernel_name: str = '', global_size: tuple = (1, 1, 1), local_size: tuple = (1, 1, 1), parameters: dict = {}, device: pyclesperanto._pyclesperanto._Device = None)[source]
Execute an OpenCL kernel from a file or a string
Call, build, and execute a kernel compatible with OpenCL language. The kernel can be called from a file or a string.
The parameters must still be passed as a dictionary with the correct types and order. Buffer parameters must be passed as Array objects. Scalars must be passed as Python native float or int.
Warning: Only 1D buffers are supported for now.
- Parameters:
anchor (str, default = '__file__') – Enter __file__ when calling this method and the corresponding open.cl file lies in the same folder as the python file calling it. Ignored if kernel_source is a string.
kernel_source (str) – Filename of the open.cl file to be called or string containing the open.cl source code
kernel_name (str) – Kernel method inside the open.cl file to be called most clij/clesperanto kernel functions have the same name as the file they are in
global_size (tuple (z,y,x), default = (1, 1, 1)) – Global_size according to OpenCL definition (usually shape of the destination image).
local_size (tuple (z,y,x), default = (1, 1, 1)) – Local_size according to OpenCL definition (usually default is good).
parameters (dict(str, [Array, float, int])) – Dictionary containing parameters. Take care: They must be of the right type and in the right order as specified in the open.cl file.
device (Device, default = None) – The device to execute the kernel on. If None, use the current device
- operation(name: str) Callable [source]
Returns a function from the pyclesperanto package
- Parameters:
name (str) – name of the operation
- Return type:
Callable function
- operations(must_have_categories: list = None, must_not_have_categories: list = None) dict [source]
Retrieve a dictionary of operations, which can be filtered by annotated categories.
- Parameters:
must_have_categories (list of str, optional) – if provided, the result will be filtered so that operations must contain all given categories.
must_not_have_categories (list of str, optional) – if provided, the result will be filtered so that operations must not contain all given categories.
- Returns:
dict of str
- Return type:
Callable function
Filters
Complete list of all available filters in pyclesperanto.
- absolute(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the absolute value of every individual pixel x in a given image. <pre>f(x) = |x| </pre>
- Parameters:
input_image (Image) – The input image to be processed.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- add_image_and_scalar(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Adds a scalar value s to all pixels x of a given image X. <pre>f(x, s) = x + s</pre>
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output image.
scalar (float (= 1)) – Scalar number to add to all pixels.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_addImageAndScalar
- add_images_weighted(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, factor1: float = 1, factor2: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Calculates the sum of pairs of pixels x and y from images X and Y weighted with factors a and b. <pre>f(x, y, a, b) = x * a + y * b</pre>
- Parameters:
input_image0 (Image) – First input image to add.
input_image1 (Image) – Second image to add.
output_image (Optional[Image] (= None)) – Output image where results are written into.
factor1 (float (= 1)) – Multiplication factor of each pixel of src0 before adding it.
factor2 (float (= 1)) – Multiplication factor of each pixel of src1 before adding it.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_addImagesWeighted
- binary_and(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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. <pre>f(x, y) = x & y</pre>
- Parameters:
input_image0 (Image) – First binary input image to be processed.
input_image1 (Image) – Second binary input image to be processed.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- binary_dilate(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a binary image with pixel values 0 and 1 containing the binary dilation of a given input image. The dilation apply the Moore neighborhood (8 pixels in 2D and 26 pixels in 3d) for the “box” connectivity and the von Neumann neighborhood (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. For a more flexible dilation with arbitrary shapes, use dilation() instead.
- Parameters:
input_image (Image) – Input image to process. Input image to process.
output_image (Optional[Image] (= None)) – Output result image. Output result image.
radius_x (float (= 1)) – Radius of sphere or box structuring element in X.
radius_y (float (= 1)) – Radius of sphere or box structuring element in Y.
radius_z (float (= 1)) – Radius of sphere or box structuring element in Z.
connectivity (str (= "box")) – Element shape, “box” or “sphere”.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_dilateBox [2] https://clij.github.io/clij2-docs/reference_dilateSphere
- binary_edge_detection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Binary input image where edges will be searched.
output_image (Optional[Image] (= None)) – Output image where edge pixels will be 1.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_binaryEdgeDetection
- binary_erode(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a binary image with pixel values 0 and 1 containing the binary erosion of a given input image. The erosion apply the Moore neighborhood (8 pixels in 2D and 26 pixels in 3d) for the “box” connectivity and the von Neumann neighborhood (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. For a more flexible erosion with arbitrary shapes, use erosion() instead.
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
radius_x (float (= 1)) – Radius of the eroding sphere or box structuring element in X.
radius_y (float (= 1)) – Radius of the eroding sphere or box structuring element in Y.
radius_z (float (= 1)) – Radius of the eroding sphere or box structuring element in Z.
connectivity (str (= "box")) – Element shape, “box” or “sphere”.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_erodeBox [2] https://clij.github.io/clij2-docs/reference_erodeSphere
- binary_infsup(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- binary_not(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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. <pre>f(x) = !x</pre>
- Parameters:
input_image (Image) – Binary input image to be inverted.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- binary_or(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.<pre>f(x, y) = x | y</pre>
- Parameters:
input_image0 (Image) – First binary input image to be processed.
input_image1 (Image) – Second binary input image to be processed.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- binary_subtract(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Subtracts one binary image from another.
- Parameters:
input_image0 (Image) – First binary input image to be processed.
input_image1 (Image) – Second binary input image to be subtracted from the first.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_binarySubtract
- binary_supinf(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- binary_xor(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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. <pre>f(x, y) = (x & !y) | (!x & y)</pre>
- Parameters:
input_image0 (Image) – First binary input image to be processed.
input_image1 (Image) – Second binary input image to be processed.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- block_enumerate(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, blocksize: int = 256, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- circular_shift(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, shift_x: int = 0, shift_y: int = 0, shift_z: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Apply a circular shift (roll) to the input image. Elements at the borders will be shifted to the other side of the image. The shift is specified for each dimension separately.
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
shift_x (int (= 0)) – Shift in x direction.
shift_y (int (= 0)) – Shift in y direction.
shift_z (int (= 0)) – Shift in z direction.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- convolve(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- copy(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Copies an image. <pre>f(x) = x</pre>
- 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.
- Return type:
Image
References
- copy_horizontal_slice(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, slice_index: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
This method has two purposes: It copies a 2D image to a given slice_index y position in a 3D image stack or It copies a given slice_index 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_index.
slice_index (int (= 0)) – Index of the slice to copy.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- copy_slice(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, slice_index: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
This method has two purposes: It copies a 2D image to a given slice_index z position in a 3D image stack or It copies a given slice_index 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_index.
slice_index (int (= 0)) – Index of the slice to copy.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- copy_vertical_slice(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, slice_index: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
This method has two purposes: It copies a 2D image to a given slice_index x position in a 3D image stack or It copies a given slice_index 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_index.
slice_index (int (= 0)) – Index of the slice to copy.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- crop(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, start_x: int = 0, start_y: int = 0, start_z: int = 0, width: int = 1, height: int = 1, depth: int = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- cubic_root(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- detect_label_edges(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_detectLabelEdges
- dilate_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a binary image with pixel values 0 and 1 containing the binary dilation of a given input image. The dilation takes the Moore neighborhood (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.
- Return type:
Image
References
- dilate_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a binary image with pixel values 0 and 1 containing the binary dilation of a given input image. The dilation takes the von Neumann neighborhood (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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_dilateSphere
- dilation(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, footprint: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the dilation operation between an image and a structuring element. The operation is applied in grayscale if the image is in grayscale. The structuring element is a binary image with pixel values 0 and 1, and must have the same dimensionality as the image (3D is the image is 3D, 2D if the image is 2D).
- Parameters:
input_image (Image) – Input image to process.
footprint (Image) – Structuring element to use for the operation.
output_image (Optional[Image] (= None)) – Output result image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- divide_images(dividend: numpy.ndarray | pyclesperanto._pyclesperanto._Array, divisor: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Divides two images X and Y by each other pixel wise. <pre>f(x, y) = x / y</pre>
- Parameters:
dividend (Image) – Input image to process.
divisor (Image) – Second input image to process.
output_image (Optional[Image] (= None)) – Output result image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_divideImages
- divide_scalar_by_image(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Divides a scalar by an image pixel by pixel. <pre>f(x, s) = s / x</pre>
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
scalar (float (= 0)) – Scalar value to divide the image with.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- equal(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines if two images A and B equal pixel wise. <pre>f(a, b) = 1 if a == b; 0 otherwise.</pre>
- Parameters:
input_image0 (Image) – First image to be compared with.
input_image1 (Image) – Second image to be compared with the first.
output_image (Optional[Image] (= None)) – Output binary image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- equal_constant(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines if an image A and a constant b are equal. <pre>f(a, b) = 1 if a == b; 0 otherwise.</pre>
- Parameters:
input_image (Image) – Input omage where every pixel is compared to the constant.
output_image (Optional[Image] (= None)) – Output binary image.
scalar (float (= 0)) – Scalar value to compare pixel with.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_equalConstant
- erode_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a binary image with pixel values 0 and 1 containing the binary erosion of a given input image. The erosion takes the Moore neighborhood (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.
- Return type:
Image
References
- erode_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a binary image with pixel values 0 and 1 containing the binary erosion of a given input image. The erosion takes the von Neumann neighborhood (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.
- Return type:
Image
References
- erosion(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, footprint: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the erosion operation between an image and a structuring element. The operation is applied in grayscale if the image is in grayscale. The structuring element is a binary image with pixel values 0 and 1, and must have the same dimensionality as the image (3D is the image is 3D, 2D if the image is 2D).
- Parameters:
input_image (Image) – Input image to process.
footprint (Image) – Structuring element to use for the operation.
output_image (Optional[Image] (= None)) – Output result image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- exponential(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- flip(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, flip_x: bool = True, flip_y: bool = True, flip_z: bool = True, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- gaussian_blur(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, sigma_x: float = 0, sigma_y: float = 0, sigma_z: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_gaussianBlur3D
- gaussian_derivative(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, sigma_x: float = 0, sigma_y: float = 0, sigma_z: float = 0, order_x: int = 0, order_y: int = 0, order_z: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Convolve the image with a gaussian derivate. The filter kernel can have nonisotropic sigma and order. The implementation is done separable. In case a sigma equals zero, the direction is not filtered. If all orders are zero, the filtering is equivalent to a Gaussian blur.
- 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.
order_x (int (= 0)) – Order of derivation along the x axis.
order_y (int (= 0)) – Order of derivation along the y axis.
order_z (int (= 0)) – Order of derivation along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- generate_distance_matrix(coordinate_list1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, coordinate_list2: numpy.ndarray | pyclesperanto._pyclesperanto._Array, distance_matrix_destination: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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:
coordinate_list1 (Image) – First coordinate list to process.
coordinate_list2 (Image) – Second coordinate list to process.
distance_matrix_destination (Optional[Image] (= None)) – Output result image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_generateDistanceMatrix
- gradient_x(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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: <pre>b’ = c a;</pre>
- 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.
- Return type:
Image
References
- gradient_y(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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: <pre>b’ = c a;</pre>
- 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.
- Return type:
Image
References
- gradient_z(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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: <pre>b’ = c a;</pre>
- 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.
- Return type:
Image
References
- grayscale_dilate(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a grayscale image containing the grayscale dilation of a given input image. The erosion apply the Moore neighborhood (8 pixels in 2D and 26 pixels in 3d) for the “box” connectivity and the von Neumann neighborhood (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.
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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimum3DBox [2] https://clij.github.io/clij2-docs/reference_minimum3DSphere
- grayscale_erode(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes a grayscale image containing the grayscale 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.
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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimum3DBox [2] https://clij.github.io/clij2-docs/reference_minimum3DSphere
- greater(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- greater_constant(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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)) – Scalar value to compare pixel with.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_greaterConstant
- greater_or_equal(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_greaterOrEqual
- greater_or_equal_constant(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 to compare pixel with.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_greaterOrEqualConstant
- hessian_eigenvalues(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, small_eigenvalue: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, middle_eigenvalue: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, large_eigenvalue: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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] The function return the list of eigenvalues as images, by decreasing order. The first image is the largest eigenvalue, Note: This function 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.
- Return type:
Image
- laplace(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_laplaceDiamond
- laplace_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- laplace_diamond(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_laplaceDiamond
- local_cross_correlation(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, kernel: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Compute the cross correlation of an image to a given kernel.
- Parameters:
input_image (Image) – Input image to process.
kernel (Image) – Input
output_image (Optional[Image] (= None)) – Output result image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- logarithm(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- mask(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, mask: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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. <pre>f(x,m) = (x if (m != 0); (0 otherwise))</pre>
- 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.
- Return type:
Image
References
- mask_label(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, label: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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. <pre>f(x,m,i) = (x if (m == i); (0 otherwise))</pre>
- 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.
- Return type:
Image
References
- maximum_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximum3DBox
- maximum_filter(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximum3DBox [2] https://clij.github.io/clij2-docs/reference_maximum3DSphere
- maximum_image_and_scalar(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the maximum of a constant scalar s and each pixel value x in a given image X. <pre>f(x, s) = max(x, s)</pre>
- 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximumImageAndScalar
- maximum_images(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the maximum of a pair of pixel values x, y from two given images X and Y. <pre>f(x, y) = max(x, y)</pre>
- 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximumImages
- maximum_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximum3DSphere
- maximum_x_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximumXProjection
- maximum_y_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximumYProjection
- maximum_z_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximumZProjection
- mean_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
- mean_filter(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_mean3DSphere
- mean_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_mean3DSphere
- mean_x_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_meanXProjection
- mean_y_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_meanYProjection
- mean_z_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_meanZProjection
- median(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_median3DSphere
- median_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
- median_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_median3DSphere
- minimum_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimum3DBox
- minimum_filter(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimum3DBox [2] https://clij.github.io/clij2-docs/reference_minimum3DSphere
- minimum_image_and_scalar(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the minimum of a constant scalar s and each pixel value x in a given image X. <pre>f(x, s) = min(x, s)</pre>
- 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimumImageAndScalar
- minimum_images(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the minimum of a pair of pixel values x, y from two given images X and Y. <pre>f(x, y) = min(x, y)</pre>
- 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimumImages
- minimum_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimum3DSphere
- minimum_x_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimumXProjection
- minimum_y_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimumYProjection
- minimum_z_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimumZProjection
- mode(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- mode_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
- mode_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
- modulo_images(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- multiply_image_and_position(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, dimension: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_multiplyImageAndCoordinate
- multiply_image_and_scalar(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Multiplies all pixels value x in a given image X with a constant scalar s. <pre>f(x, s) = x * s</pre>
- Parameters:
input_image (Image) – The input image to be multiplied with a constant.
output_image (Optional[Image] (= None)) – 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_multiplyImageAndScalar
- multiply_images(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Multiplies all pairs of pixel values x and y from two image X and Y. <pre>f(x, y) = x * y</pre>
- Parameters:
input_image0 (Image) – First input image to be multiplied.
input_image1 (Image) – Second image to be multiplied.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_multiplyImages
- multiply_matrix(matrix1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, matrix2: numpy.ndarray | pyclesperanto._pyclesperanto._Array, matrix_destination: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Multiplies two matrices with each other. Shape of matrix1 should be equal to shape of matrix2 transposed.
- Parameters:
matrix1 (Image) – First matrix to process.
matrix2 (Image) – Second matrix to process.
matrix_destination (Optional[Image] (= None)) – Output result matrix.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_multiplyMatrix
- nan_to_num(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, nan: float = 0, posinf: float = numpy.nan_to_num, neginf: float = numpy.nan_to_num, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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)) – 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.
- Return type:
Image
References
[1] https://numpy.org/doc/stable/reference/generated/numpy.nan_to_num.html
- nonzero_maximum(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumBox [2] https://clij.github.io/clij2-docs/reference_nonzeroMaximumDiamond
- nonzero_maximum_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumBox
- nonzero_maximum_diamond(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_nonzeroMaximumDiamond
- nonzero_minimum(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumBox [2] https://clij.github.io/clij2-docs/reference_nonzeroMinimumDiamond
- nonzero_minimum_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumBox
- nonzero_minimum_diamond(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_nonzeroMinimumDiamond
- not_equal(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines if two images A and B equal pixel wise. f(a, b) = 1 if a != b; 0 otherwise.
- Parameters:
input_image0 (Image) – First image to be compared with.
input_image1 (Image) – 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.
- Return type:
Image
References
- not_equal_constant(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_notEqualConstant
- onlyzero_overwrite_maximum(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, flag: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Apply a local maximum filter to an image which only overwrites pixels with value 0.
- Parameters:
input_image (Image) – Input image to process.
flag (Image) – Output
output_image (Optional[Image] (= None)) – Output image.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumBox [2] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumDiamond
- onlyzero_overwrite_maximum_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, flag: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Apply a local maximum filter to an image which only overwrites pixels with value 0.
- Parameters:
input_image (Image) – Input image to process.
flag (Image) – Output
output_image (Optional[Image] (= None)) – Output image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumBox
- onlyzero_overwrite_maximum_diamond(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, flag: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Apply a local maximum filter to an image which only overwrites pixels with value 0.
- Parameters:
input_image (Image) – Input image to process.
flag (Image) – Output
output_image (Optional[Image] (= None)) – Output image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_onlyzeroOverwriteMaximumDiamond
- pad(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, size_x: int = 0, size_y: int = 0, size_z: int = 0, value: float = 0, center: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Pads an image with a given size along dimensions with a given value.
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
size_x (int (= 0)) – New size along x axis.
size_y (int (= 0)) – New size along y axis.
size_z (int (= 0)) – New size along z axis.
value (float (= 0)) – Value to pad with.
center (bool (= False)) – Center the image in the middle of the padded image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- paste(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, destination_x: int = 0, destination_y: int = 0, destination_z: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
destination_x (int (= 0)) – Origin pixel coodinate in x to paste.
destination_y (int (= 0)) – Origin pixel coodinate in y to paste.
destination_z (int (= 0)) – Origin pixel coodinate in z to paste.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- power(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes all pixels value x to the power of a given exponent a. <pre>f(x, a) = x ^ a</pre>
- 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.
- Return type:
Image
References
- power_images(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- range(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, start_x: int | None = None, stop_x: int | None = None, step_x: int | None = None, start_y: int | None = None, stop_y: int | None = None, step_y: int | None = None, start_z: int | None = None, stop_z: int | None = None, step_z: int | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- read_values_from_positions(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, list: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- reciprocal(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://numpy.org/doc/stable/reference/generated/numpy.reciprocal.html
- replace_intensities(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_replaceIntensities
- replace_intensity(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, value_to_replace: float = 0, value_replacement: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
value_to_replace (float (= 0)) – Old value.
value_replacement (float (= 1)) – New value.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_replaceIntensity
- replace_value(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, value_to_replace: float = 0, value_replacement: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
value_to_replace (float (= 0)) – Old value.
value_replacement (float (= 1)) – New value.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_replaceIntensity
- replace_values(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_replaceIntensities
- set(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Sets all pixel values x of a given image X to a constant value v. <pre>f(x) = v</pre>
- Parameters:
input_image (Image) – Input image to process.
scalar (float (= 0)) – Value to set.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- set_column(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, column_index: int = 0, value: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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_index (int (= 0)) – Column index.
value (float (= 0)) – Value to set.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- set_image_borders(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, value: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_setImageBorders
- set_nonzero_pixels_to_pixelindex(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, offset: int = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- set_plane(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, plane_index: int = 0, value: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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_index (int (= 0)) – Plane index.
value (float (= 0)) – Value to set.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- set_ramp_x(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- set_ramp_y(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- set_ramp_z(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- set_row(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, row_index: int = 0, value: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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_index (int (= 0))
value (float (= 0))
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- set_where_x_equals_y(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, value: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_setWhereXequalsY
- set_where_x_greater_than_y(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, value: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_setWhereXgreaterThanY
- set_where_x_smaller_than_y(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, value: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_setWhereXsmallerThanY
- sign(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- smaller(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- smaller_constant(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_smallerConstant
- smaller_or_equal(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_smallerOrEqual
- smaller_or_equal_constant(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_smallerOrEqualConstant
- sobel(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- square_root(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- std_z_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_standardDeviationZProjection
- subtract_image_from_scalar(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, scalar: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Subtracts one image X from a scalar s pixel wise. <pre>f(x, s) = s x</pre>
- 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_subtractImageFromScalar
- sum_reduction_x(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, blocksize: int = 256, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- sum_x_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_sumXProjection
- sum_y_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_sumYProjection
- sum_z_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_sumZProjection
- transpose_xy(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Transpose X and Y axes of an image.
- Parameters:
input_image (Image) – The input image.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- transpose_xz(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Transpose X and Z axes of an image.
- Parameters:
input_image (Image) – The input image.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- transpose_yz(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Transpose Y and Z axes of an image.
- Parameters:
input_image (Image) – The input image.
output_image (Optional[Image] (= None)) – Output image where results are written into.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- undefined_to_zero(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_undefinedToZero
- unpad(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, size_x: int = 0, size_y: int = 0, size_z: int = 0, center: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Removes padding from an image along dimensions.
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
size_x (int (= 0)) – New size along x axis.
size_y (int (= 0)) – New size along y axis.
size_z (int (= 0)) – New size along z axis.
center (bool (= False)) – Center the image in the middle of the padded image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- variance_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
- variance_filter(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
connectivity (str (= "box")) – Filter neigborhood
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_varianceBox [2] https://clij.github.io/clij2-docs/reference_varianceSphere
- variance_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_varianceSphere
- write_values_to_positions(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_writeValuesToPositions
- x_position_of_maximum_x_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- x_position_of_minimum_x_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- y_position_of_maximum_y_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- y_position_of_minimum_y_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- z_position_of_maximum_z_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- z_position_of_minimum_z_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- z_position_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, position: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Project a defined Z-slice of a 3D stack into a 2D image. Which Z-slice is defined as the position image, which represents an altitude map.
- Parameters:
input_image (Image) – Input image stack
position (Image) – altitude map
output_image (Optional[Image] (= None)) – Output image
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_zPositionProjection
- absolute_difference(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines the absolute difference pixel by pixel between two images. <pre>f(x, y) = |x y| </pre>
- 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_absoluteDifference
- add_images(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Calculates the sum of pairs of pixels x and y of two images X and Y. <pre>f(x, y) = x + y</pre>
- 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.
- Return type:
Image
References
- binary_closing(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Closing operator, applies binary morphological closing to intensity images using a sphere or box shaped 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 of the sphere or box element along the x axis.
radius_y (float (= 1)) – Radius of the sphere or box element along the y axis.
radius_z (float (= 1)) – Radius of the sphere or box element along the z axis.
connectivity (str (= "box")) – Element shape, “box” or “sphere”
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- binary_opening(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Closing operator, applies binary morphological opening to intensity images using a sphere or box shaped 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 of the sphere or box element along the x axis.
radius_y (float (= 1)) – Radius of the sphere or box element along the y axis.
radius_z (float (= 1)) – Radius of the sphere or box element along the z axis.
connectivity (str (= "box")) – Element shape, “box” or “sphere”
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- bottom_hat(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_bottomHatBox [2] https://clij.github.io/clij2-docs/reference_bottomHatSphere
- bottom_hat_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_bottomHatBox
- bottom_hat_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_bottomHatSphere
- clip(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, min_intensity: float | None = None, max_intensity: float | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://numpy.org/doc/stable/reference/generated/numpy.clip.html
- closing(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, footprint: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Closing operator, applies morphological closing to intensity images using a custom structuring element provided as input. This operator also works with binary images.
- Parameters:
input_image (Image) – Input image to process.
footprint (Image) – Structuring element for the operation.
output_image (Optional[Image] (= None)) – Output result image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- closing_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: int = 1, radius_y: int = 1, radius_z: int = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Closing operator, applies grayscale morphological closing to intensity images using a box shaped 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 (= 1)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- closing_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Closing operator, applies grayscale morphological closing to intensity images using a sphere shaped 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 (= 1)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- concatenate_along_x(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_combineHorizontally
- concatenate_along_y(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_combineVertically
- concatenate_along_z(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_concatenateStacks
- count_touching_neighbors(touch_matrix: numpy.ndarray | pyclesperanto._pyclesperanto._Array, touching_neighbors_count_destination: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, ignore_background: bool = True, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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:
touch_matrix (Image) – Input touch matrix to process.
touching_neighbors_count_destination (Optional[Image] (= None)) – Output vector of touch count.
ignore_background (bool (= True))
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_countTouchingNeighbors
- crop_border(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, border_size: int = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- degrees_to_radians(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- detect_maxima(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 0, radius_y: float = 0, radius_z: float = 0, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (float (= 0)) – Radius along the x axis.
radius_y (float (= 0)) – 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_detectMaximaBox [2] https://clij.github.io/clij2-docs/reference_detectMaximaSphere
- detect_maxima_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 0, radius_y: float = 0, radius_z: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (float (= 0)) – Radius along the x axis.
radius_y (float (= 0)) – Radius along the y axis.
radius_z (float (= 0)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_detectMaximaBox
- detect_minima(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 0, radius_y: float = 0, radius_z: float = 0, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (float (= 0)) – Radius along the x axis.
radius_y (float (= 0)) – 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_detectMinimaBox [2] https://clij.github.io/clij2-docs/reference_detectMinimaSphere
- detect_minima_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 0, radius_y: float = 0, radius_z: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (float (= 0)) – Radius along the x axis.
radius_y (float (= 0)) – Radius along the y axis.
radius_z (float (= 0)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_detectMinimaBox
- difference_of_gaussian(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = 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: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_differenceOfGaussian3D
- divide_by_gaussian_background(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, sigma_x: float = 2, sigma_y: float = 2, sigma_z: float = 2, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_divideByGaussianBackground
- extend_labeling_via_voronoi(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_extendLabelingViaVoronoi
- extended_depth_of_focus_sobel_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, sigma: float = 5, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Depth projection using the local sobel gradient magnitude maxima to determine the best focus plane. The sigma apply a gaussian blur for smoothness of the projection.
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
sigma (float (= 5)) – Sigma for Gaussian blur.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- extended_depth_of_focus_variance_projection(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 10, radius_y: float = 10, sigma: float = 5, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Depth projection using the local variance maxima to determine the best focus plane. The radius parameter control the local variance calculation, and the sigma apply a gaussian blur for smoothness of the projection.
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
radius_x (float (= 10)) – Sphere radius filter in x axis.
radius_y (float (= 10)) – Sphere radius filter in y axis.
sigma (float (= 5)) – Sigma for Gaussian blur.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- grayscale_closing(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Closing operator, applies grayscale morphological closing to intensity images using a sphere or box shaped 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 (= 1)) – Radius along the z axis.
connectivity (str (= "box")) – Element shape, “box” or “sphere”
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- grayscale_opening(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Opening operator, Applies morphological opening to intensity images using a sphereshaped or boxshepd 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 (= 1)) – Radius along the z axis.
connectivity (str (= "box")) – Element shape, “box” or “sphere”
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- hessian_gaussian_eigenvalues(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, small_eigenvalue: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, middle_eigenvalue: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, large_eigenvalue: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, sigma: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines the Hessian matrix eigenvalues using the gaussian derivative method and returns the small, middle and large eigenvalue images. The function return the list of eigenvalues as images, by decreasing order. The first image is the largest eigenvalue,
- Parameters:
input_image (Image) – Input image to process.
small_eigenvalue (Optional[Image] (= None)) – Output result image for the small eigenvalue.
middle_eigenvalue (Optional[Image] (= None)) – Output result image for the middle eigenvalue.
large_eigenvalue (Optional[Image] (= None)) – Output result image for the large eigenvalue.
sigma (float (= 1)) – Sigma of the Gaussian kernel.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- invert(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Computes the negative value of all pixels in a given image. It is recommended to convert images to 32bit float before applying this operation. <pre>f(x) = x</pre> 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.
- Return type:
Image
References
- label_spots(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- large_hessian_eigenvalue(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- maximum_of_all_pixels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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.
- Return type:
float
References
[1] https://clij.github.io/clij2-docs/reference_maximumOfAllPixels
- minimum_of_all_pixels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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.
- Return type:
float
References
[1] https://clij.github.io/clij2-docs/reference_minimumOfAllPixels
- minimum_of_masked_pixels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, mask: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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.
- Return type:
float
References
[1] https://clij.github.io/clij2-docs/reference_minimumOfMaskedPixels
- opening(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, footprint: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Opening operator, applies morphological opening to intensity images using a custom structuring element provided as input. This operator also works with binary images.
- Parameters:
input_image (Image) – Input image to process.
footprint (Image) – Structuring element for the operation.
output_image (Optional[Image] (= None)) – Output result image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- opening_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Opening operator, 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 (float (= 1)) – Radius along the x axis.
radius_y (float (= 1)) – Radius along the y axis.
radius_z (float (= 1)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- opening_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Opening operator, 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 (= 1)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- radians_to_degrees(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- reduce_labels_to_label_edges(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_reduceLabelsToLabelEdges
- reduce_stack(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, reduction_factor: int = 2, offset: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Reduces the number of z-slices in a stack by a given factor. With the offset you have control which slices stays: with a factor 3 and offset 0, slices 0,3,6, etc. are kept. with a factor 4 and offset 1, slices 1,5,9, etc. are kept.
- Parameters:
input_image (Image) – Input image.
output_image (Optional[Image] (= None)) – Output image.
reduction_factor (int (= 2)) – Reduction factor.
offset (int (= 0)) – Offset.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- small_hessian_eigenvalue(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- square(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://numpy.org/doc/stable/reference/generated/numpy.square.html
- squared_difference(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_squaredDifference
- standard_deviation(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (float (= 1)) – Radius along the x axis.
radius_y (float (= 1)) – Radius along the y axis.
radius_z (float (= 1)) – Radius along the z axis.
connectivity (str (= "box")) – Neigborhood shape, “box” or “sphere”
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_standardDeviationBox [2] https://clij.github.io/clij2-docs/reference_standardDeviationSphere
- standard_deviation_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (float (= 1)) – Radius along the x axis.
radius_y (float (= 1)) – Radius along the y axis.
radius_z (float (= 1)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_standardDeviationBox
- standard_deviation_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 (float (= 1)) – Radius along the x axis.
radius_y (float (= 1)) – Radius along the y axis.
radius_z (float (= 1)) – Radius along the z axis.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_standardDeviationSphere
- sub_stack(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, start_z: int = 0, end_z: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Crop a volume into a new volume, along the z-axis.
- Parameters:
input_image (Image) – Input image.
output_image (Optional[Image] (= None)) – Output image.
start_z (int (= 0)) – Start z coordinate of the crop.
end_z (int (= 0)) – End z coordinate of the crop.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- subtract_gaussian_background(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, sigma_x: float = 2, sigma_y: float = 2, sigma_z: float = 2, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_subtractGaussianBackground
- subtract_images(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Subtracts one image X from another image Y pixel wise. <pre>f(x, y) = x y</pre>
- 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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_subtractImages
- sum_of_all_pixels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = 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.
- Return type:
float
References
[1] https://clij.github.io/clij2-docs/reference_sumOfAllPixels
- top_hat(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_topHatBox [2] https://clij.github.io/clij2-docs/reference_topHatSphere
- top_hat_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
- top_hat_sphere(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius_x: float = 1, radius_y: float = 1, radius_z: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_topHatSphere
- bounding_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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) – Input binary image
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
list
References
- center_of_mass(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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) – Input image
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
list
References
[1] https://clij.github.io/clij2-docs/reference_centerOfMass
- clahe(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, tile_size: int = 8, clip_limit: float = 0.01, minimum_intensity: float = nan, maximum_intensity: float = nan, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Applies CLAHE (Contrast Limited Adaptive Histogram Equalization) to the input image. The algorithm is adapted from the work of Hugo Raveton (https://github.com/HugoRaveton/pyopencl_clahe)
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
tile_size (int (= 8)) – Size of the tiles to be used for CLAHE.
clip_limit (float (= 0.01)) – Clip limit for CLAHE.
minimum_intensity (float (= float('nan'))) – Minimum intensity value.
maximum_intensity (float (= float('nan'))) – Maximum intensity value.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- exclude_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, list: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input label image
list (Image) – Vector of 0 and 1 flagging labels to remove
output_image (Optional[Image] (= None)) – Output label image
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabels
- exclude_labels_on_edges(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, exclude_x: bool = True, exclude_y: bool = True, exclude_z: bool = True, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Removes all labels from a label map which touch the edges of the image. Remaining label elements are renumbered afterwards.
- Parameters:
input_image (Image) – Input label image
output_image (Optional[Image] (= None)) – Output label image
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOnEdges
- flag_existing_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- gamma_correction(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, gamma: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input image
output_image (Optional[Image] (= None)) – Output image
gamma (float (= 1))
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_gammaCorrection
- generate_binary_overlap_matrix(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – First input label image
input_image1 (Image) – Second input label image
output_image (Optional[Image] (= None)) – Output overlap matrix
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_generateBinaryOverlapMatrix
- generate_touch_matrix(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image_matrix: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input label image
output_image_matrix (Optional[Image] (= None)) – Output touch matrix
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_generateTouchMatrix
- histogram(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, num_bins: int = 256, minimum_intensity: float = nan, maximum_intensity: float = nan, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input image to derive histogram from
output_image (Optional[Image] (= None)) – Output histogram
num_bins (int (= 256))
minimum_intensity (float (= float('nan')))
maximum_intensity (float (= float('nan')))
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- jaccard_index(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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: <pre>s = f(j) = 2 j / (j + 1)</pre>
- Parameters:
input_image0 (Image) – First binary image to compare
input_image1 (Image) – Second binary image to compare
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
float
References
[1] https://clij.github.io/clij2-docs/reference_jaccardIndex
- labelled_spots_to_pointlist(label: numpy.ndarray | pyclesperanto._pyclesperanto._Array, pointlist: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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:
label (Image) – Input
pointlist (Optional[Image] (= None)) – Output coordinate list
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_labelledSpotsToPointList
- maximum_position(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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.
- Return type:
list
- mean_of_all_pixels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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.
- Return type:
float
References
[1] https://clij.github.io/clij2-docs/reference_meanOfAllPixels
- minimum_position(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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.
- Return type:
list
- morphological_chan_vese(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, num_iter: int = 100, smoothing: int = 1, lambda1: float = 1, lambda2: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- remove_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, list: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input label image
list (Image) – Vector of 0 and 1 flagging labels to remove
output_image (Optional[Image] (= None)) – Output label image
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabels
- remove_labels_on_edges(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, exclude_x: bool = True, exclude_y: bool = True, exclude_z: bool = True, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Removes all labels from a label map which touch the edges of the image. Remaining label elements are renumbered afterwards.
- Parameters:
input_image (Image) – Input label image
output_image (Optional[Image] (= None)) – Output label image
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOnEdges
- sato_filter(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, sigma_minimum: float = 1, sigma_maximum: float = 3, sigma_step: float = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Applies the multi-scale ridge detection Sato filter. This filter was first introduced by Sato et al. in 1998 (https://doi.org/10.1016/S1361-8415(98)80009-1)
- Parameters:
input_image (Image) – Input image to process.
output_image (Optional[Image] (= None)) – Output result image.
sigma_minimum (float (= 1)) – Minimum sigma value for the filter.
sigma_maximum (float (= 3)) – Maximum sigma value for the filter.
sigma_step (float (= 1)) – Step size for the sigma values.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
- statistics_of_background_and_labelled_pixels(intensity: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, label: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) dict
Compute, for the background and labels, 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 equal to the label image if not provided. The label image is set to the entire image if not provided.
- Parameters:
intensity (Optional[Image] (= None)) – Intensity image.
label (Optional[Image] (= None)) – Label image to compute the statistics.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
dict
References
[1] https://clij.github.io/clij2-docs/reference_statisticsOfBackgroundAndLabelledPixels
- statistics_of_labelled_pixels(intensity: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, label: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = 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 equal to the label image if not provided. The label image is set to the entire image if not provided.
- Parameters:
intensity (Optional[Image] (= None)) – Intensity image.
label (Optional[Image] (= None)) – Label image to compute the statistics.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
dict
References
[1] https://clij.github.io/clij2-docs/reference_statisticsOfLabelledPixels
- centroids_of_labels(label_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, centroids_coordinates: numpy.ndarray | pyclesperanto._pyclesperanto._Array, include_background: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines the centroids of all labels in a label image or image stack. It writes the resulting coordinates in point list image of dimensions n * d where n is the number of labels and d=3 the dimensionality (x,y,z) of the original image.
- Parameters:
label_image (Image) – Label image where the centroids will be determined from.
centroids_coordinates (Image) – Output list of coordinates where the centroids will be written to.
include_background (bool (= False)) – Determines if the background label should be included.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_centroidsOfLabels
- exclude_labels_with_map_values_out_of_range(values_map: numpy.ndarray | pyclesperanto._pyclesperanto._Array, label_map_input: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, minimum_value_range: float = 0, maximum_value_range: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Exclude labels with values outside a given value range based on a vector of values associated with the labels.
- Parameters:
values_map (Image) – Vector of values associated with the labels.
label_map_input (Image) – Input image where labels will be filtered.
output_image (Optional[Image] (= None)) – Output image where labels will be written to.
minimum_value_range (float (= 0)) – Minimum value to keep.
maximum_value_range (float (= 100)) – Maximum value to keep.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsWithValuesOutOfRange
- exclude_labels_with_map_values_within_range(values_map: numpy.ndarray | pyclesperanto._pyclesperanto._Array, label_map_input: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, minimum_value_range: float = 0, maximum_value_range: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Exclude labels with values inside a given value range based on a vector of values associated with the labels.
- Parameters:
values_map (Image) – Vector of values associated with the labels.
label_map_input (Image) – Input image where labels will be filtered.
output_image (Optional[Image] (= None)) – Output image where labels will be written to.
minimum_value_range (float (= 0)) – Minimum value to keep.
maximum_value_range (float (= 100)) – Maximum value to keep.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsWithValuesWithinRange
- extension_ratio_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines the ratio of the extension for every label in a label map and returns it as a parametric map. The extension ration is defined as the maximum distance of any pixel in the label to the label’s centroid divided by the average distance of all pixels in the label to the centroid.
- Parameters:
input_image (Image) – Input label image.
output_image (Optional[Image] (= None)) – Output parametric image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_extensionRatioMap
- label_bounding_box(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, label_id: int, device: pyclesperanto._pyclesperanto._Device | None = 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 image
label_id (int) – Identifier of label
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
list
References
- label_pixel_count_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Takes a label map, determines the number of pixels per label and replaces every label with the that number. This results in a parametric image expressing area or volume.
- Parameters:
input_image (Image) – Label image to measure
output_image (Optional[Image] (= None)) – Parametric image computed
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_pixelCountMap
- maximum_extension_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines for every label the maximum distance of any pixel to the centroid in a label map and returns it as a parametric map. The extension ration is defined as the maximum distance of any pixel in the label to the label’s centroid divided by the average distance of all pixels in the label to the centroid.
- Parameters:
input_image (Image) – Input label image.
output_image (Optional[Image] (= None)) – Output parametric image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_meanExtensionMap
- maximum_intensity_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, labels: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Takes an image and a corresponding label map, determines the maximum intensity per label and replaces every label with the that number. This results in a parametric image expressing maximum object intensity.
- Parameters:
input_image (Image) – intensity image
labels (Image) – label image
output_image (Optional[Image] (= None)) – Parametric image computed
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maximumIntensityMap
- mean_extension_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Determines for every label the mean distance of any pixel to the centroid in a label map and returns it as a parametric map. The extension ration is defined as the maximum distance of any pixel in the label to the label’s centroid divided by the average distance of all pixels in the label to the centroid.
- Parameters:
input_image (Image) – Input label image.
output_image (Optional[Image] (= None)) – Output parametric image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_meanExtensionMap
- mean_intensity_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, labels: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Takes an image and a corresponding label map, determines the mean intensity per label and replaces every label with the that number. This results in a parametric image expressing mean object intensity.
- Parameters:
input_image (Image) – intensity image
labels (Image) – label image
output_image (Optional[Image] (= None)) – Parametric image computed
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_meanIntensityMap
- mean_squared_error(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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) – First image to compare
input_image1 (Image) – Second image to compare
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
float
References
[1] https://clij.github.io/clij2-docs/reference_meanSquaredError
- minimum_intensity_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, labels: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Takes an image and a corresponding label map, determines the minimum intensity per label and replaces every label with the that number. This results in a parametric image expressing minimum object intensity.
- Parameters:
input_image (Image) – intensity image
labels (Image) – label image
output_image (Optional[Image] (= None)) – Parametric image computed
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_minimumIntensityMap
- percentile(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, percentile: float = 50.0, device: pyclesperanto._pyclesperanto._Device | None = None) float
Computes the percentile value of an image.
- Parameters:
input_image (Image) – Input image.
percentile (float (= 50.0)) – Percentile to compute.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
float
- pixel_count_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Takes a label map, determines the number of pixels per label and replaces every label with the that number. This results in a parametric image expressing area or volume.
- Parameters:
input_image (Image) – Label image to measure
output_image (Optional[Image] (= None)) – Parametric image computed
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_pixelCountMap
- relabel_sequential(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, blocksize: int = 4096, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input label image.
output_image (Optional[Image] (= None)) – Output label image.
blocksize (int (= 4096)) – Renumbering is done in blocks for performance reasons.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_closeIndexGapsInLabelMap
- remove_labels_with_map_values_out_of_range(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, values: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, min_value: float = 0, max_value: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Remove labels with values outside a given value range based on a vector of values associated with the labels.
- Parameters:
input_image (Image) – Input image where labels will be filtered.
values (Image) – Vector of
output_image (Optional[Image] (= None)) – Output image where labels will be written to.
min_value (float (= 0)) – Minimum value to keep.
max_value (float (= 100)) – Maximum value to keep.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsWithValuesOutOfRange
- remove_labels_with_map_values_within_range(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, values: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, min_value: float = 0, max_value: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Remove labels with values inside a given value range based on a vector of values associated with the labels.
- Parameters:
input_image (Image) – Input image where labels will be filtered.
values (Image) – Vector of
output_image (Optional[Image] (= None)) – Output image where labels will be written to.
min_value (float (= 0)) – Minimum value to keep.
max_value (float (= 100)) – Maximum value to keep.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsWithValuesWithinRange
- spots_to_pointlist(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input binary image of spots
output_image (Optional[Image] (= None)) – Output coordinate list of spots
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_spotsToPointList
- standard_deviation_intensity_map(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, labels: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Takes an image and a corresponding label map, determines the standard deviation intensity per label and replaces every label with the that number. This results in a parametric image expressing std object intensity.
- Parameters:
input_image (Image) – intensity image
labels (Image) – label image
output_image (Optional[Image] (= None)) – Parametric image computed
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_standardDeviationIntensityMap
- threshold_otsu(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input image to threshold.
output_image (Optional[Image] (= None)) – Output binary image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
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
- array_equal(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, device: pyclesperanto._pyclesperanto._Device | None = 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) – First array to compare
input_image1 (Image) – Second array to compare
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
bool
References
[1] https://numpy.org/doc/stable/reference/generated/numpy.array_equal.html
- combine_labels(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, input_image1: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
- connected_component_labeling(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_connectedComponentsLabelingBox
- connected_components_labeling(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, connectivity: str = 'box', device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_connectedComponentsLabelingBox
- exclude_labels_outside_size_range(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, minimum_size: float = 0, maximum_size: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Filter labelled objects outside of the min/max size range value.
- Parameters:
input_image (Image) – Input label image.
output_image (Optional[Image] (= None)) – Output label image.
minimum_size (float (= 0)) – Minimum size of labels to keep.
maximum_size (float (= 100)) – Maximum size of labels to keep.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
- filter_label_by_size(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, minimum_size: float = 0, maximum_size: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Filter labelled objects outside of the min/max size range value.
- Parameters:
input_image (Image) – Input label image.
output_image (Optional[Image] (= None)) – Output label image.
minimum_size (float (= 0)) – Minimum size of labels to keep.
maximum_size (float (= 100)) – Maximum size of labels to keep.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
- merge_touching_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Merge touching labels of a label image and relabel the result sequentially.
- Parameters:
input_image (Image) – Input label image.
output_image (Optional[Image] (= None)) – Output label image.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
- reduce_labels_to_centroids(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Take a label map and reduce each label to its centroid.
- Parameters:
input_image (Image) – Label image to reduce.
output_image (Optional[Image] (= None)) – Output label image with centroids.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_reduceLabelsToCentroids
- dilate_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius: int = 2, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input label image to erode
output_image (Optional[Image] (= None)) – Output label image
radius (int (= 2))
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- erode_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius: int = 1, relabel: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input label image
output_image (Optional[Image] (= None)) – Output label image
radius (int (= 1))
relabel (bool (= False)) – Relabel the image, e.g. if object disappear or split.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- exclude_large_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, minimum_size: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Removes labels from a label map which are higher a given minimum size.
- Parameters:
input_image (Image) – Label image to filter.
output_image (Optional[Image] (= None)) – Output label image filtered.
minimum_size (float (= 100)) – Smallest size object to keep.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
- exclude_small_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, maximum_size: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Removes labels from a label map which are below a given maximum size.
- Parameters:
input_image (Image) – Label image to filter.
output_image (Optional[Image] (= None)) – Output label image filtered.
maximum_size (float (= 100)) – Largest size object to exclude.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
- gauss_otsu_labeling(input_image0: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, outline_sigma: float = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 segment
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.
- Return type:
Image
References
[1] https://ieeexplore.ieee.org/document/4310076 [2] https://en.wikipedia.org/wiki/Connected-component_labeling
- masked_voronoi_labeling(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, mask: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input binary image
mask (Image) – Input
output_image (Optional[Image] (= None)) – Output label image
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_maskedVoronoiLabeling
- remove_large_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, maximum_size: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Removes labeled objects bigger than a given size (in pixels) from a label map.
- Parameters:
input_image (Image) – Label image to filter.
output_image (Optional[Image] (= None)) – Output label image filtered.
maximum_size (float (= 100)) – Biggest size object allowed.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
- remove_small_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, minimum_size: float = 100, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Removes labelled objects small than a given size (in pixels) from a label map.
- Parameters:
input_image (Image) – Label image to filter.
output_image (Optional[Image] (= None)) – Output label image filtered.
minimum_size (float (= 100)) – Smallest size object allowed.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
- voronoi_labeling(input_binary: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_labels: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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_binary (Image) – Input binary image
output_labels (Optional[Image] (= None)) – Output label image
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
References
[1] https://clij.github.io/clij2-docs/reference_voronoiLabeling
- affine_transform(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, transform_matrix: list | None = None, interpolate: bool = False, resize: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 image to be transformed.
output_image (Optional[Image] (= None)) – Output image.
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.
- Return type:
Image
- closing_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 image.
output_image (Optional[Image] (= None)) – Output label image.
radius (int (= 0)) – Radius size for the closing.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- erode_connected_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius: int = 1, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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) – Input image to process
output_image (Optional[Image] (= None)) – Output label image
radius (int (= 1))
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- eroded_otsu_labeling(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, number_of_erosions: int = 5, outline_sigma: float = 2, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 image to be transformed.
output_image (Optional[Image] (= None)) – Output label image.
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.
- Return type:
Image
References
[1] https://github.com/biovoxxel/bv3dbox [2] https://zenodo.org/badge/latestdoi/434949702
- opening_labels(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, radius: int = 0, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 image.
output_image (Optional[Image] (= None)) – Output label image.
radius (int (= 0)) – Radius size for the opening.
device (Optional[Device] (= None)) – Device to perform the operation on.
- Return type:
Image
- rigid_transform(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = 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: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 image to be transformed.
output_image (Optional[Image] (= None)) – Output image.
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.
- Return type:
Image
- rotate(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, angle_x: float = 0, angle_y: float = 0, angle_z: float = 0, centered: bool = True, interpolate: bool = False, resize: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 image to be rotated.
output_image (Optional[Image] (= None)) – Output image.
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.
- Return type:
Image
- scale(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, factor_x: float = 1, factor_y: float = 1, factor_z: float = 1, centered: bool = True, interpolate: bool = False, resize: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Scale the image by given factors.
- Parameters:
input_image (Image) – Input image to be scaled.
output_image (Optional[Image] (= None)) – Output image.
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.
- Return type:
Image
- translate(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, translate_x: float = 0, translate_y: float = 0, translate_z: float = 0, interpolate: bool = False, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
Translate the image by a given vector.
- Parameters:
input_image (Image) – Input image to be translated.
output_image (Optional[Image] (= None)) – Output image.
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.
- Return type:
Image
- voronoi_otsu_labeling(input_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array, output_image: numpy.ndarray | pyclesperanto._pyclesperanto._Array | None = None, spot_sigma: float = 2, outline_sigma: float = 2, device: pyclesperanto._pyclesperanto._Device | None = None) numpy.ndarray | pyclesperanto._pyclesperanto._Array
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 image.
output_image (Optional[Image] (= None)) – Output label image.
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.
- Return type:
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