CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

labelSurface

Takes a label map and excludes all labels which are not on the surface.

For each label, a ray from a given center towards the label. If the ray crosses another label, the labelin question is not at the surface and thus, removed.

Categories: Measurements, Labels

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

Usage in ImageJ macro

Ext.CLIJ2_labelSurface(Image input_labels, Image destination_labels, Number relative_center_x, Number relative_center_y, Number relative_center_z);

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 input_labels = clij2.push(input_labelsImagePlus);
destination_labels = clij2.create(input_labels);
float relative_center_x = 1.0;
float relative_center_y = 2.0;
float relative_center_z = 3.0;
// Execute operation on GPU
clij2.labelSurface(input_labels, destination_labels, relative_center_x, relative_center_y, relative_center_z);
// show result
destination_labelsImagePlus = clij2.pull(destination_labels);
destination_labelsImagePlus.show();

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

% get input parameters
input_labels = clij2.pushMat(input_labels_matrix);
destination_labels = clij2.create(input_labels);
relative_center_x = 1.0;
relative_center_y = 2.0;
relative_center_z = 3.0;
% Execute operation on GPU
clij2.labelSurface(input_labels, destination_labels, relative_center_x, relative_center_y, relative_center_z);
% show result
destination_labels = clij2.pullMat(destination_labels)

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

clij2 = CLICY.getInstance();

// get input parameters
input_labels_sequence = getSequence();
input_labels = clij2.pushSequence(input_labels_sequence);
destination_labels = clij2.create(input_labels);
relative_center_x = 1.0;
relative_center_y = 2.0;
relative_center_z = 3.0;
// Execute operation on GPU
clij2.labelSurface(input_labels, destination_labels, relative_center_x, relative_center_y, relative_center_z);
// show result
destination_labels_sequence = clij2.pullSequence(destination_labels)
Icy.addSequence(destination_labels_sequence);
// cleanup memory on GPU
clij2.release(input_labels);
clij2.release(destination_labels);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint