CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

divideImages

Divides two images X and Y by each other pixel wise.

f(x, y) = x / y

Category: Math

Usage in ImageJ macro

Ext.CLIJ2_divideImages(Image divident, Image divisor, Image destination);

Usage in object oriented programming languages

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

// get input parameters
ClearCLBuffer divident = clij2.push(dividentImagePlus);
ClearCLBuffer divisor = clij2.push(divisorImagePlus);
destination = clij2.create(divident);
// Execute operation on GPU
clij2.divideImages(divident, divisor, destination);
// show result
destinationImagePlus = clij2.pull(destination);
destinationImagePlus.show();

// cleanup memory on GPU
clij2.release(divident);
clij2.release(divisor);
clij2.release(destination);
Matlab
% init CLIJ and GPU
clij2 = init_clatlab();

% get input parameters
divident = clij2.pushMat(divident_matrix);
divisor = clij2.pushMat(divisor_matrix);
destination = clij2.create(divident);
% Execute operation on GPU
clij2.divideImages(divident, divisor, destination);
% show result
destination = clij2.pullMat(destination)

% cleanup memory on GPU
clij2.release(divident);
clij2.release(divisor);
clij2.release(destination);
Icy JavaScript
// init CLIJ and GPU
importClass(net.haesleinhuepf.clicy.CLICY);
importClass(Packages.icy.main.Icy);

clij2 = CLICY.getInstance();

// get input parameters
divident_sequence = getSequence();
divident = clij2.pushSequence(divident_sequence);
divisor_sequence = getSequence();
divisor = clij2.pushSequence(divisor_sequence);
destination = clij2.create(divident);
// Execute operation on GPU
clij2.divideImages(divident, divisor, destination);
// show result
destination_sequence = clij2.pullSequence(destination)
Icy.addSequence(destination_sequence);
// cleanup memory on GPU
clij2.release(divident);
clij2.release(divisor);
clij2.release(destination);
clEsperanto Python (experimental)
import pyclesperanto_prototype as cle

cle.divide_images(divident, divisor, destination)

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint