GPU accelerated image processing for everyone
Takes a label map and reduces all labels to their center spots. Label IDs stay and background will be zero.
Category: Labels
Ext.CLIJx_reduceLabelsToLabelledSpots(Image input_labels, Image destination_labels);
// 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);
% 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);