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.

Category: Visualisation

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

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 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
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);
Matlab
% 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);
Icy JavaScript
// 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);
clEsperanto Python (experimental)
import pyclesperanto_prototype as cle

cle.draw_box(destination, x, y, z, width, height, depth, value)

Example notebooks

convolution.ipynb

Example scripts

rotating_sphere.ijm
tubeness.ijm

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint