GPU accelerated image processing for everyone
Takes a label map, determines the centroids of all labels and writes the distance of all labelled pixels to their centroid in the result image. Background pixels stay zero.
Categories: Measurements, Labels
Availability: Available in Fiji by activating the update sites clij and clij2. This function is part of clijx_-0.30.1.21.jar.
Ext.CLIJx_euclideanDistanceFromLabelCentroidMap(Image labelmap_input, Image destination);
// init CLIJ and GPU import net.haesleinhuepf.clijx.CLIJx; import net.haesleinhuepf.clij.clearcl.ClearCLBuffer; CLIJx clijx = CLIJx.getInstance(); // get input parameters ClearCLBuffer labelmap_input = clijx.push(labelmap_inputImagePlus); destination = clijx.create(labelmap_input);
// Execute operation on GPU clijx.euclideanDistanceFromLabelCentroidMap(labelmap_input, destination);
// show result destinationImagePlus = clijx.pull(destination); destinationImagePlus.show(); // cleanup memory on GPU clijx.release(labelmap_input); clijx.release(destination);
% init CLIJ and GPU clijx = init_clatlabx(); % get input parameters labelmap_input = clijx.pushMat(labelmap_input_matrix); destination = clijx.create(labelmap_input);
% Execute operation on GPU clijx.euclideanDistanceFromLabelCentroidMap(labelmap_input, destination);
% show result destination = clijx.pullMat(destination) % cleanup memory on GPU clijx.release(labelmap_input); clijx.release(destination);
import pyclesperanto_prototype as cle cle.euclidean_distance_from_label_centroid_map(labelmap_input, destination)