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.

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 Java

clij2.labelSpots(input_spots, labelled_spots_destination);
// 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);

Usage in Matlab

clij2.labelSpots(input_spots, labelled_spots_destination);
% 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);

Usage in Icy

clij2.labelSpots(input_spots, labelled_spots_destination);
// 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);

Example notebooks

spots_pointlists_matrices_tables
tribolium_morphometry

Example scripts

spots_pointlists_matrices_tables.ijm
tribolium_morphometry.ijm

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint