CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

morphoLibJRemoveLargestRegion

Apply MorpholibJ Remove Border Labels to a label image.

Category: Labels

Availability: Available in Fiji by activating the update sites clij, clij2 and clijx-assistant-extensions. This function is part of clijx-assistant-morpholibj_-0.4.2.22.jar.

Usage in ImageJ macro

Ext.CLIJx_morphoLibJRemoveLargestRegion(Image labels_input, Image labels_destination, Boolean left, Boolean right, Boolean top, Boolean bottom, Boolean front, Boolean back);

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 labels_input = clijx.push(labels_inputImagePlus);
labels_destination = clijx.create(labels_input);
boolean left = true;
boolean right = false;
boolean top = false;
boolean bottom = true;
boolean front = true;
boolean back = true;
// Execute operation on GPU
clijx.morphoLibJRemoveLargestRegion(labels_input, labels_destination, left, right, top, bottom, front, back);
// show result
labels_destinationImagePlus = clijx.pull(labels_destination);
labels_destinationImagePlus.show();

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

% get input parameters
labels_input = clijx.pushMat(labels_input_matrix);
labels_destination = clijx.create(labels_input);
left = true;
right = false;
top = false;
bottom = true;
front = true;
back = true;
% Execute operation on GPU
clijx.morphoLibJRemoveLargestRegion(labels_input, labels_destination, left, right, top, bottom, front, back);
% show result
labels_destination = clijx.pullMat(labels_destination)

% cleanup memory on GPU
clijx.release(labels_input);
clijx.release(labels_destination);

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint