GPU accelerated image processing for everyone
Apply MorpholibJs Classic Watershed to an image.
Connectedness: 4 (2D) / 6 (3D)
Categories: Binary, Filter, Labels
Availability: Available in Fiji by activating the update sites clij, clij2 and clijx-assistant-extensions. This function is part of clijx-assistant-morpholibj_-0.6.0.1.jar.
Ext.CLIJx_morphoLibJClassicWatershed(Image gradient_input, Image binary_restriction_input, Image destination, Number h_min, Number h_max);
// init CLIJ and GPU import net.haesleinhuepf.clijx.CLIJx; import net.haesleinhuepf.clij.clearcl.ClearCLBuffer; CLIJx clijx = CLIJx.getInstance(); // get input parameters ClearCLBuffer gradient_input = clijx.push(gradient_inputImagePlus); ClearCLBuffer binary_restriction_input = clijx.push(binary_restriction_inputImagePlus); destination = clijx.create(gradient_input); float h_min = 1.0; float h_max = 2.0;
// Execute operation on GPU clijx.morphoLibJClassicWatershed(gradient_input, binary_restriction_input, destination, h_min, h_max);
// show result destinationImagePlus = clijx.pull(destination); destinationImagePlus.show(); // cleanup memory on GPU clijx.release(gradient_input); clijx.release(binary_restriction_input); clijx.release(destination);
% init CLIJ and GPU clijx = init_clatlabx(); % get input parameters gradient_input = clijx.pushMat(gradient_input_matrix); binary_restriction_input = clijx.pushMat(binary_restriction_input_matrix); destination = clijx.create(gradient_input); h_min = 1.0; h_max = 2.0;
% Execute operation on GPU clijx.morphoLibJClassicWatershed(gradient_input, binary_restriction_input, destination, h_min, h_max);
% show result destination = clijx.pullMat(destination) % cleanup memory on GPU clijx.release(gradient_input); clijx.release(binary_restriction_input); clijx.release(destination);