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

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

excludeLabelsOnEdges often follows after

excludeLabelsOnEdges is often followed by

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);
clEsperanto Python (experimental)
import pyclesperanto_prototype as cle

cle.exclude_labels_on_edges(label_map_input, label_map_destination)

Example notebooks

labeling
outlines_numbers_overlay
count_blobs.ipynb

Example scripts

excludeLabelsOnEdges.ijm
labeling.ijm
outlines_numbers_overlay.ijm
segmentation.py

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint