CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

parametricWatershed

Apply a binary watershed to a binary image and introduce black pixels between objects.

To have control about where objects are cut, the sigma parameters allow to control a Gaussian blur filter applied to the internally used distance map.

Category: Binary

Availability: Available in Fiji by activating the update sites clij and clij2. This function is part of clijx_-0.32.0.1.jar.

Usage in ImageJ macro

Ext.CLIJx_parametricWatershed(Image binary_source, Image destination, Number sigma_x, Number sigma_y, Number sigma_z);

Usage in object oriented programming languages

Java
// init CLIJ and GPU
import net.haesleinhuepf.clijx.CLIJx;
import net.haesleinhuepf.clij.clearcl.ClearCLBuffer;
CLIJx clijx = CLIJx.getInstance();

// get input parameters
ClearCLBuffer binary_source = clijx.push(binary_sourceImagePlus);
destination = clijx.create(binary_source);
float sigma_x = 1.0;
float sigma_y = 2.0;
float sigma_z = 3.0;
// Execute operation on GPU
clijx.parametricWatershed(binary_source, destination, sigma_x, sigma_y, sigma_z);
// show result
destinationImagePlus = clijx.pull(destination);
destinationImagePlus.show();

// cleanup memory on GPU
clijx.release(binary_source);
clijx.release(destination);
Matlab
% init CLIJ and GPU
clijx = init_clatlabx();

% get input parameters
binary_source = clijx.pushMat(binary_source_matrix);
destination = clijx.create(binary_source);
sigma_x = 1.0;
sigma_y = 2.0;
sigma_z = 3.0;
% Execute operation on GPU
clijx.parametricWatershed(binary_source, destination, sigma_x, sigma_y, sigma_z);
% show result
destination = clijx.pullMat(destination)

% cleanup memory on GPU
clijx.release(binary_source);
clijx.release(destination);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint