CLIJ2

Logo

GPU accelerated image processing for everyone

CLIJ2 home

applyVectorfield

Image

Deforms an image according to distances provided in the given vector images.

It is recommended to use 32-bit images for input, output and vector images.

Parameters

source : Image The input image to be processed. vector_x : Image Pixels in this image describe the distance in X direction pixels should be shifted during warping. vector_y : Image Pixels in this image describe the distance in Y direction pixels should be shifted during warping. destination : Image The output image where results are written into.

Category: Transformations

Availability: Available in Fiji by activating the update site clij. This function is part of clij-core-1.7.4.0.jar.

Usage in ImageJ macro

Ext.CLIJ_applyVectorfield(Image source, Image vector_x, Image vector_y, Image destination);

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 source = clijx.push(sourceImagePlus);
ClearCLBuffer vector_x = clijx.push(vector_xImagePlus);
ClearCLBuffer vector_y = clijx.push(vector_yImagePlus);
destination = clijx.create(source);
// Execute operation on GPU
clijx.applyVectorfield(source, vector_x, vector_y, destination);
// show result
destinationImagePlus = clijx.pull(destination);
destinationImagePlus.show();

// cleanup memory on GPU
clijx.release(source);
clijx.release(vector_x);
clijx.release(vector_y);
clijx.release(destination);
Matlab
% init CLIJ and GPU
clijx = init_clatlabx();

% get input parameters
source = clijx.pushMat(source_matrix);
vector_x = clijx.pushMat(vector_x_matrix);
vector_y = clijx.pushMat(vector_y_matrix);
destination = clijx.create(source);
% Execute operation on GPU
clijx.applyVectorfield(source, vector_x, vector_y, destination);
% show result
destination = clijx.pullMat(destination)

% cleanup memory on GPU
clijx.release(source);
clijx.release(vector_x);
clijx.release(vector_y);
clijx.release(destination);

Example scripts

applyVectorField.py

Back to CLIJ2 reference Back to CLIJ2 documentation

Imprint