CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

drawBox

Draws a box at a given start point with given size. All pixels other than in the box are untouched. Consider using set(buffer, 0); in advance.

drawBox is often followed by

Usage in ImageJ macro

Ext.CLIJ2_drawBox(Image destination, Number x, Number y, Number z, Number width, Number height, Number depth, Number value);

Usage in Java

clij2.drawBox(destination, x, y, z, width, height, depth, value);
// init CLIJ and GPU
import net.haesleinhuepf.clij2.CLIJ2;
import net.haesleinhuepf.clij.clearcl.ClearCLBuffer;
CLIJ2 clij2 = CLIJ2.getInstance();

// get input parameters
destination = clij2.create();
float x = 1.0;
float y = 2.0;
float z = 3.0;
float width = 4.0;
float height = 5.0;
float depth = 6.0;
float value = 7.0;
// Execute operation on GPU
clij2.drawBox(destination, x, y, z, width, height, depth, value);
//show result
destinationImagePlus = clij2.pull(destination);
destinationImagePlus.show();

// cleanup memory on GPU
clij2.release(destination);

Usage in Matlab

clij2.drawBox(destination, x, y, z, width, height, depth, value);
% init CLIJ and GPU
clij2 = init_clatlab();

% get input parameters
destination = clij2.create();
x = 1.0;
y = 2.0;
z = 3.0;
width = 4.0;
height = 5.0;
depth = 6.0;
value = 7.0;
% Execute operation on GPU
clij2.drawBox(destination, x, y, z, width, height, depth, value);
% show result
destination = clij2.pullMat(destination)

% cleanup memory on GPU
clij2.release(destination);

Usage in Icy

clij2.drawBox(destination, x, y, z, width, height, depth, value);
// init CLIJ and GPU
importClass(net.haesleinhuepf.clicy.CLICY);
importClass(Packages.icy.main.Icy);

clij2 = CLICY.getInstance();

// get input parameters
destination = clij2.create();
x = 1.0;
y = 2.0;
z = 3.0;
width = 4.0;
height = 5.0;
depth = 6.0;
value = 7.0;
// Execute operation on GPU
clij2.drawBox(destination, x, y, z, width, height, depth, value);
// show result
destination_sequence = clij2.pullSequence(destination)
Icy.addSequence(destination_sequence);
// cleanup memory on GPU
clij2.release(destination);

Example scripts

rotating_sphere.ijm

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint