CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

excludeLabelsOnEdges

Removes all labels from a label map which touch the edges of the image (in X, Y and Z if the image is 3D).

Remaining label elements are renumbered afterwards.

Categories: Filter, Labels

excludeLabelsOnEdges often follows after

Usage in ImageJ macro

Ext.CLIJ2_excludeLabelsOnEdges(Image label_map_input, Image label_map_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 label_map_input = clij2.push(label_map_inputImagePlus);
label_map_destination = clij2.create(label_map_input);
// Execute operation on GPU
clij2.excludeLabelsOnEdges(label_map_input, label_map_destination);
// show result
label_map_destinationImagePlus = clij2.pull(label_map_destination);
label_map_destinationImagePlus.show();

// cleanup memory on GPU
clij2.release(label_map_input);
clij2.release(label_map_destination);
Matlab
% init CLIJ and GPU
clij2 = init_clatlab();

% get input parameters
label_map_input = clij2.pushMat(label_map_input_matrix);
label_map_destination = clij2.create(label_map_input);
% Execute operation on GPU
clij2.excludeLabelsOnEdges(label_map_input, label_map_destination);
% show result
label_map_destination = clij2.pullMat(label_map_destination)

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

clij2 = CLICY.getInstance();

// get input parameters
label_map_input_sequence = getSequence();
label_map_input = clij2.pushSequence(label_map_input_sequence);
label_map_destination = clij2.create(label_map_input);
// Execute operation on GPU
clij2.excludeLabelsOnEdges(label_map_input, label_map_destination);
// show result
label_map_destination_sequence = clij2.pullSequence(label_map_destination)
Icy.addSequence(label_map_destination_sequence);
// cleanup memory on GPU
clij2.release(label_map_input);
clij2.release(label_map_destination);

Example notebooks

labeling

Example scripts

excludeLabelsOnEdges.ijm
labeling.ijm
segmentation.py

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint