CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

labelMeanIntensityMap

Takes an image and a corresponding label map, determines the mean intensity per label and replaces every label with the that number.

This results in a parametric image expressing mean object intensity.

Categories: Labels, Measurements, Visualisation

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_labelMeanIntensityMap(Image intensity_image, Image label_map, Image 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 intensity_image = clij2.push(intensity_imageImagePlus);
ClearCLBuffer label_map = clij2.push(label_mapImagePlus);
destination = clij2.create(intensity_image);
// Execute operation on GPU
clij2.labelMeanIntensityMap(intensity_image, label_map, destination);
// show result
destinationImagePlus = clij2.pull(destination);
destinationImagePlus.show();

// cleanup memory on GPU
clij2.release(intensity_image);
clij2.release(label_map);
clij2.release(destination);
Matlab
% init CLIJ and GPU
clij2 = init_clatlab();

% get input parameters
intensity_image = clij2.pushMat(intensity_image_matrix);
label_map = clij2.pushMat(label_map_matrix);
destination = clij2.create(intensity_image);
% Execute operation on GPU
clij2.labelMeanIntensityMap(intensity_image, label_map, destination);
% show result
destination = clij2.pullMat(destination)

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

clij2 = CLICY.getInstance();

// get input parameters
intensity_image_sequence = getSequence();
intensity_image = clij2.pushSequence(intensity_image_sequence);
label_map_sequence = getSequence();
label_map = clij2.pushSequence(label_map_sequence);
destination = clij2.create(intensity_image);
// Execute operation on GPU
clij2.labelMeanIntensityMap(intensity_image, label_map, destination);
// show result
destination_sequence = clij2.pullSequence(destination)
Icy.addSequence(destination_sequence);
// cleanup memory on GPU
clij2.release(intensity_image);
clij2.release(label_map);
clij2.release(destination);
clEsperanto Python (experimental)
import pyclesperanto_prototype as cle

cle.label_mean_intensity_map(intensity_image, label_map, destination)

Example notebooks

parametric_maps.ipynb

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint