CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

averageDistanceOfNFarOffPoints

Determines the average of the n far off (most distant) points for every point in a distance matrix.

This corresponds to the average of the n maximum values (rows) for each column of the distance matrix.

Usage in ImageJ macro

Ext.CLIJ2_averageDistanceOfNFarOffPoints(Image distance_matrix, Image distance+_list_destination, Number nFarOffPointsTofind);

Usage in Java

clij2.averageDistanceOfNFarOffPoints(distance_matrix, distance+_list_destination, nFarOffPointsTofind);
// init CLIJ and GPU
import net.haesleinhuepf.clij2.CLIJ2;
import net.haesleinhuepf.clij.clearcl.ClearCLBuffer;
CLIJ2 clij2 = CLIJ2.getInstance();

// get input parameters
ClearCLBuffer distance_matrix = clij2.push(distance_matrixImagePlus);
distance+_list_destination = clij2.create(distance_matrix);
int nFarOffPointsTofind = 10;
// Execute operation on GPU
clij2.averageDistanceOfNFarOffPoints(distance_matrix, distance+_list_destination, nFarOffPointsTofind);
//show result
distance+_list_destinationImagePlus = clij2.pull(distance+_list_destination);
distance+_list_destinationImagePlus.show();

// cleanup memory on GPU
clij2.release(distance_matrix);
clij2.release(distance+_list_destination);

Usage in Matlab

clij2.averageDistanceOfNFarOffPoints(distance_matrix, distance+_list_destination, nFarOffPointsTofind);
% init CLIJ and GPU
clij2 = init_clatlab();

% get input parameters
distance_matrix = clij2.pushMat(distance_matrix_matrix);
distance+_list_destination = clij2.create(distance_matrix);
nFarOffPointsTofind = 10;
% Execute operation on GPU
clij2.averageDistanceOfNFarOffPoints(distance_matrix, distance+_list_destination, nFarOffPointsTofind);
% show result
distance+_list_destination = clij2.pullMat(distance+_list_destination)

% cleanup memory on GPU
clij2.release(distance_matrix);
clij2.release(distance+_list_destination);

Usage in Icy

clij2.averageDistanceOfNFarOffPoints(distance_matrix, distance+_list_destination, nFarOffPointsTofind);
// init CLIJ and GPU
importClass(net.haesleinhuepf.clicy.CLICY);
importClass(Packages.icy.main.Icy);

clij2 = CLICY.getInstance();

// get input parameters
distance_matrix_sequence = getSequence();
distance_matrix = clij2.pushSequence(distance_matrix_sequence);
distance+_list_destination = clij2.create(distance_matrix);
nFarOffPointsTofind = 10;
// Execute operation on GPU
clij2.averageDistanceOfNFarOffPoints(distance_matrix, distance+_list_destination, nFarOffPointsTofind);
// show result
distance+_list_destination_sequence = clij2.pullSequence(distance+_list_destination)
Icy.addSequence(distance+_list_destination_sequence);
// cleanup memory on GPU
clij2.release(distance_matrix);
clij2.release(distance+_list_destination);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint