GPU accelerated image processing for everyone
Determines the absolute difference between two images and sets all pixels to 1 where it is below or equal a given tolerance, and 0 otherwise.
Category: Math
Availability: Available in Fiji by activating the update sites clij and clij2. This function is part of clijx_-0.30.1.21.jar.
Ext.CLIJx_similar(Image input_image1, Image input_image2, Image binary_destination, Number tolerance);
// init CLIJ and GPU import net.haesleinhuepf.clijx.CLIJx; import net.haesleinhuepf.clij.clearcl.ClearCLBuffer; CLIJx clijx = CLIJx.getInstance(); // get input parameters ClearCLBuffer input_image1 = clijx.push(input_image1ImagePlus); ClearCLBuffer input_image2 = clijx.push(input_image2ImagePlus); binary_destination = clijx.create(input_image1); float tolerance = 1.0;
// Execute operation on GPU clijx.similar(input_image1, input_image2, binary_destination, tolerance);
// show result binary_destinationImagePlus = clijx.pull(binary_destination); binary_destinationImagePlus.show(); // cleanup memory on GPU clijx.release(input_image1); clijx.release(input_image2); clijx.release(binary_destination);
% init CLIJ and GPU clijx = init_clatlabx(); % get input parameters input_image1 = clijx.pushMat(input_image1_matrix); input_image2 = clijx.pushMat(input_image2_matrix); binary_destination = clijx.create(input_image1); tolerance = 1.0;
% Execute operation on GPU clijx.similar(input_image1, input_image2, binary_destination, tolerance);
% show result binary_destination = clijx.pullMat(binary_destination) % cleanup memory on GPU clijx.release(input_image1); clijx.release(input_image2); clijx.release(binary_destination);