GPU accelerated image processing for everyone
Authors: Robert Haase, Daniela Vorkel, July 2019
This macro shows how to rotate stacks in the GPU, and how different the results are when using CLIJ or ImageJ.
run("Close All");
run("Blobs (25K)");
run("Invert LUT");
input = getTitle();
run("CLIJ2 Macro Extensions", "cl_device=1070");
Ext.CLIJ2_clear();
// push data to GPU
Ext.CLIJ2_push(input);
run("Duplicate...", " ");
run("Rotate... ", "angle=45 grid=1 interpolation=Bilinear");
rotated_cpu = getTitle();
Ext.CLIJ2_affineTransform2D(input, rotated_gpu, "-center rotate=45 center"); // show results Ext.CLIJ2_pull(rotated_gpu);
imageCalculator("Subtract create 32-bit", rotated_cpu, rotated_gpu);
At the end of the macro, clean up:
Ext.CLIJ2_clear();