CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

maximumDistanceOfTouchingNeighbors

Takes a touch matrix and a distance matrix to determine the maximum distance of touching neighbors for every object.

Categories: Measurements, Graphs

Usage in ImageJ macro

Ext.CLIJx_maximumDistanceOfTouchingNeighbors(Image distance_matrix, Image touch_matrix, Image distancelist_destination);

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 distance_matrix = clijx.push(distance_matrixImagePlus);
ClearCLBuffer touch_matrix = clijx.push(touch_matrixImagePlus);
distancelist_destination = clijx.create(distance_matrix);
// Execute operation on GPU
clijx.maximumDistanceOfTouchingNeighbors(distance_matrix, touch_matrix, distancelist_destination);
// show result
distancelist_destinationImagePlus = clijx.pull(distancelist_destination);
distancelist_destinationImagePlus.show();

// cleanup memory on GPU
clijx.release(distance_matrix);
clijx.release(touch_matrix);
clijx.release(distancelist_destination);
Matlab
% init CLIJ and GPU
clijx = init_clatlabx();

% get input parameters
distance_matrix = clijx.pushMat(distance_matrix_matrix);
touch_matrix = clijx.pushMat(touch_matrix_matrix);
distancelist_destination = clijx.create(distance_matrix);
% Execute operation on GPU
clijx.maximumDistanceOfTouchingNeighbors(distance_matrix, touch_matrix, distancelist_destination);
% show result
distancelist_destination = clijx.pullMat(distancelist_destination)

% cleanup memory on GPU
clijx.release(distance_matrix);
clijx.release(touch_matrix);
clijx.release(distancelist_destination);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint