CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

touchMatrixToMesh

Takes a pointlist with dimensions nd with n point coordinates in d dimensions and a touch matrix of size nn to draw lines from all points to points if the corresponding pixel in the touch matrix is 1.

Parameters

pointlist : Image n*d matrix representing n coordinates with d dimensions. touch_matrix : Image A 2D binary matrix with 1 in pixels (i,j) where label i touches label j. mesh_destination : Image The output image where results are written into.

Categories: Graphs, Visualisation

touchMatrixToMesh often follows after

touchMatrixToMesh is often followed by

Usage in ImageJ macro

Ext.CLIJ2_touchMatrixToMesh(Image pointlist, Image touch_matrix, Image mesh_destination);

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 pointlist = clij2.push(pointlistImagePlus);
ClearCLBuffer touch_matrix = clij2.push(touch_matrixImagePlus);
mesh_destination = clij2.create(pointlist);
// Execute operation on GPU
clij2.touchMatrixToMesh(pointlist, touch_matrix, mesh_destination);
// show result
mesh_destinationImagePlus = clij2.pull(mesh_destination);
mesh_destinationImagePlus.show();

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

% get input parameters
pointlist = clij2.pushMat(pointlist_matrix);
touch_matrix = clij2.pushMat(touch_matrix_matrix);
mesh_destination = clij2.create(pointlist);
% Execute operation on GPU
clij2.touchMatrixToMesh(pointlist, touch_matrix, mesh_destination);
% show result
mesh_destination = clij2.pullMat(mesh_destination)

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

clij2 = CLICY.getInstance();

// get input parameters
pointlist_sequence = getSequence();
pointlist = clij2.pushSequence(pointlist_sequence);
touch_matrix_sequence = getSequence();
touch_matrix = clij2.pushSequence(touch_matrix_sequence);
mesh_destination = clij2.create(pointlist);
// Execute operation on GPU
clij2.touchMatrixToMesh(pointlist, touch_matrix, mesh_destination);
// show result
mesh_destination_sequence = clij2.pullSequence(mesh_destination)
Icy.addSequence(mesh_destination_sequence);
// cleanup memory on GPU
clij2.release(pointlist);
clij2.release(touch_matrix);
clij2.release(mesh_destination);
clEsperanto Python (experimental)
import pyclesperanto_prototype as cle

cle.touch_matrix_to_mesh(pointlist, touch_matrix, mesh_destination)

Example notebooks

neighbors_of_neighbors
spots_pointlists_matrices_tables
tribolium_morphometry

Example scripts

large_matrices.ijm
neighbors_of_neighbors.ijm
rotating_sphere.ijm
spots_pointlists_matrices_tables.ijm
tribolium_morphometry.ijm
mesh_close_points.m

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint