CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

flagLabelsOnEdges

Determines which labels in a label map touch the edges of the image (in X, Y and Z if the image is 3D).

It results in a vector image with values 1 (touches edges) and 0 (does not touch edge). The entry in the vector (index 0) corresponds to background, following entries correspond to labels.

Categories: Filter, Labels

Availability: Available in Fiji by activating the update sites clij and clij2. This function is part of clijx_-0.32.0.1.jar.

Usage in ImageJ macro

Ext.CLIJx_flagLabelsOnEdges(Image label_map_input, Image flag_vector_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 label_map_input = clijx.push(label_map_inputImagePlus);
flag_vector_destination = clijx.create(label_map_input);
// Execute operation on GPU
clijx.flagLabelsOnEdges(label_map_input, flag_vector_destination);
// show result
flag_vector_destinationImagePlus = clijx.pull(flag_vector_destination);
flag_vector_destinationImagePlus.show();

// cleanup memory on GPU
clijx.release(label_map_input);
clijx.release(flag_vector_destination);
Matlab
% init CLIJ and GPU
clijx = init_clatlabx();

% get input parameters
label_map_input = clijx.pushMat(label_map_input_matrix);
flag_vector_destination = clijx.create(label_map_input);
% Execute operation on GPU
clijx.flagLabelsOnEdges(label_map_input, flag_vector_destination);
% show result
flag_vector_destination = clijx.pullMat(flag_vector_destination)

% cleanup memory on GPU
clijx.release(label_map_input);
clijx.release(flag_vector_destination);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint