GPU accelerated image processing for everyone
Determines the average of the n closest points for every point in a distance matrix.
This corresponds to the average of the n minimum values (rows) for each column of the distance matrix.
distance_matrix : Image The a distance matrix to be processed. distance_list_destination : Image A vector image with the same width as the distance matrix and height=1, depth=1. Determined average distances will be written into this vector. n_closest_points_to_find : Number Number of smallest distances which should be averaged.
Categories: Graphs, Measurements
Availability: Available in Fiji by activating the update sites clij and clij2. This function is part of clij2_-2.5.0.1.jar.
Ext.CLIJ2_averageDistanceOfNClosestPoints(Image distance_matrix, Image distance_list_destination, Number n_closest_points_to_find);
// 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 n_closest_points_to_find = 10;
// Execute operation on GPU clij2.averageDistanceOfNClosestPoints(distance_matrix, distance_list_destination, n_closest_points_to_find);
// 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);
% init CLIJ and GPU clij2 = init_clatlab(); % get input parameters distance_matrix = clij2.pushMat(distance_matrix_matrix); distance_list_destination = clij2.create(distance_matrix); n_closest_points_to_find = 10;
% Execute operation on GPU clij2.averageDistanceOfNClosestPoints(distance_matrix, distance_list_destination, n_closest_points_to_find);
% show result distance_list_destination = clij2.pullMat(distance_list_destination) % cleanup memory on GPU clij2.release(distance_matrix); clij2.release(distance_list_destination);
// 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); n_closest_points_to_find = 10;
// Execute operation on GPU clij2.averageDistanceOfNClosestPoints(distance_matrix, distance_list_destination, n_closest_points_to_find);
// 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);