CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

reduceLabelsToLabelledSpots

Takes a label map and reduces all labels to their center spots. Label IDs stay and background will be zero.

Category: Labels

Usage in ImageJ macro

Ext.CLIJx_reduceLabelsToLabelledSpots(Image input_labels, Image destination_labels);

Usage in object oriented programming languages

Java
// init CLIJ and GPU
import net.haesleinhuepf.clijx.CLIJx;
import net.haesleinhuepf.clij.clearcl.ClearCLBuffer;
CLIJx clijx = CLIJx.getInstance();

// get input parameters
ClearCLBuffer input_labels = clijx.push(input_labelsImagePlus);
destination_labels = clijx.create(input_labels);
// Execute operation on GPU
clijx.reduceLabelsToLabelledSpots(input_labels, destination_labels);
// show result
destination_labelsImagePlus = clijx.pull(destination_labels);
destination_labelsImagePlus.show();

// cleanup memory on GPU
clijx.release(input_labels);
clijx.release(destination_labels);
Matlab
% init CLIJ and GPU
clijx = init_clatlabx();

% get input parameters
input_labels = clijx.pushMat(input_labels_matrix);
destination_labels = clijx.create(input_labels);
% Execute operation on GPU
clijx.reduceLabelsToLabelledSpots(input_labels, destination_labels);
% show result
destination_labels = clijx.pullMat(destination_labels)

% cleanup memory on GPU
clijx.release(input_labels);
clijx.release(destination_labels);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint