CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

meanOfTouchingNeighborsMap

Takes a label image and a parametric intensity image and will replace each labels value in the parametric image by the mean average value of neighboring labels. The radius of the neighborhood can be configured:

Note: Values of all pixels in a label each must be identical.

Parameters

parametric_map : Image label_map : Image parametric_map_destination : Image radius : int ignore_touching_background : bool

Returns

parametric_map_destination

Categories: Measurements, Filter, Graphs

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

Usage in ImageJ macro

Ext.CLIJx_meanOfTouchingNeighborsMap(Image parametric_map, Image label_map, Image parametric_map_destination, Number radius, Boolean ignore_touching_background);

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 parametric_map = clijx.push(parametric_mapImagePlus);
ClearCLBuffer label_map = clijx.push(label_mapImagePlus);
parametric_map_destination = clijx.create(parametric_map);
int radius = 10;
boolean ignore_touching_background = true;
// Execute operation on GPU
clijx.meanOfTouchingNeighborsMap(parametric_map, label_map, parametric_map_destination, radius, ignore_touching_background);
// show result
parametric_map_destinationImagePlus = clijx.pull(parametric_map_destination);
parametric_map_destinationImagePlus.show();

// cleanup memory on GPU
clijx.release(parametric_map);
clijx.release(label_map);
clijx.release(parametric_map_destination);
Matlab
% init CLIJ and GPU
clijx = init_clatlabx();

% get input parameters
parametric_map = clijx.pushMat(parametric_map_matrix);
label_map = clijx.pushMat(label_map_matrix);
parametric_map_destination = clijx.create(parametric_map);
radius = 10;
ignore_touching_background = true;
% Execute operation on GPU
clijx.meanOfTouchingNeighborsMap(parametric_map, label_map, parametric_map_destination, radius, ignore_touching_background);
% show result
parametric_map_destination = clijx.pullMat(parametric_map_destination)

% cleanup memory on GPU
clijx.release(parametric_map);
clijx.release(label_map);
clijx.release(parametric_map_destination);
clEsperanto Python (experimental)
import pyclesperanto_prototype as cle

cle.mean_of_touching_neighbors_map(parametric_map, label_map, parametric_map_destination, radius, ignore_touching_background)

Example notebooks

neighbors_of_neighbors.ipynb

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint