CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

labelSpots

Transforms a binary image with single pixles set to 1 to a labelled spots image.

Transforms a spots image as resulting from maximum/minimum detection in an image of the same size where every spot has a number 1, 2, … n.

Categories: Filter, Labels, Binary

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

labelSpots often follows after

labelSpots is often followed by

Usage in ImageJ macro

Ext.CLIJ2_labelSpots(Image input_spots, Image labelled_spots_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 input_spots = clij2.push(input_spotsImagePlus);
labelled_spots_destination = clij2.create(input_spots);
// Execute operation on GPU
clij2.labelSpots(input_spots, labelled_spots_destination);
// show result
labelled_spots_destinationImagePlus = clij2.pull(labelled_spots_destination);
labelled_spots_destinationImagePlus.show();

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

% get input parameters
input_spots = clij2.pushMat(input_spots_matrix);
labelled_spots_destination = clij2.create(input_spots);
% Execute operation on GPU
clij2.labelSpots(input_spots, labelled_spots_destination);
% show result
labelled_spots_destination = clij2.pullMat(labelled_spots_destination)

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

clij2 = CLICY.getInstance();

// get input parameters
input_spots_sequence = getSequence();
input_spots = clij2.pushSequence(input_spots_sequence);
labelled_spots_destination = clij2.create(input_spots);
// Execute operation on GPU
clij2.labelSpots(input_spots, labelled_spots_destination);
// show result
labelled_spots_destination_sequence = clij2.pullSequence(labelled_spots_destination)
Icy.addSequence(labelled_spots_destination_sequence);
// cleanup memory on GPU
clij2.release(input_spots);
clij2.release(labelled_spots_destination);
clEsperanto Python (experimental)
import pyclesperanto_prototype as cle

cle.label_spots(input_spots, labelled_spots_destination)

Example notebooks

spots_pointlists_matrices_tables
tribolium_morphometry
bead_segmentation.ipynb

Example scripts

spots_pointlists_matrices_tables.ijm
tribolium_morphometry.ijm

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint