CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

touchMatrixToAdjacencyMatrix

Converts a touch matrix in an adjacency matrix

Categories: Transformations, Graphs

Usage in ImageJ macro

Ext.CLIJ2_touchMatrixToAdjacencyMatrix(Image touch_matrix, Image adjacency_matrix);

Usage in object oriented programming languages

Java
// init CLIJ and GPU
import net.haesleinhuepf.clij2.CLIJ2;
import net.haesleinhuepf.clij.clearcl.ClearCLBuffer;
CLIJ2 clij2 = CLIJ2.getInstance();

// get input parameters
ClearCLBuffer touch_matrix = clij2.push(touch_matrixImagePlus);
ClearCLBuffer adjacency_matrix = clij2.push(adjacency_matrixImagePlus);
// Execute operation on GPU
clij2.touchMatrixToAdjacencyMatrix(touch_matrix, adjacency_matrix);
// show result

// cleanup memory on GPU
clij2.release(touch_matrix);
clij2.release(adjacency_matrix);
Matlab
% init CLIJ and GPU
clij2 = init_clatlab();

% get input parameters
touch_matrix = clij2.pushMat(touch_matrix_matrix);
adjacency_matrix = clij2.pushMat(adjacency_matrix_matrix);
% Execute operation on GPU
clij2.touchMatrixToAdjacencyMatrix(touch_matrix, adjacency_matrix);
% show result

% cleanup memory on GPU
clij2.release(touch_matrix);
clij2.release(adjacency_matrix);
Icy JavaScript
// init CLIJ and GPU
importClass(net.haesleinhuepf.clicy.CLICY);
importClass(Packages.icy.main.Icy);

clij2 = CLICY.getInstance();

// get input parameters
touch_matrix_sequence = getSequence();
touch_matrix = clij2.pushSequence(touch_matrix_sequence);
adjacency_matrix_sequence = getSequence();
adjacency_matrix = clij2.pushSequence(adjacency_matrix_sequence);
// Execute operation on GPU
clij2.touchMatrixToAdjacencyMatrix(touch_matrix, adjacency_matrix);
// show result

// cleanup memory on GPU
clij2.release(touch_matrix);
clij2.release(adjacency_matrix);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint