Skip to content

Unstructured interpolation of 2D/3D data at arbitrary locations

Notifications You must be signed in to change notification settings

kvttt/UnstructuredInterpolation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Unstructured Interpolation

Given a 3D array of data, with an implicitly defined coordinate system, i.e., voxel coordinates, and given a set of points in this coordinate system (not necessarily integer), I want to interpolate the data at these given points, which is also known as unstructured interpolation.

In PyTorch, torch.nn.functional.grid_sample is the easiest way to do this. However, exploiting the power of this function for our task is not straightforward.

Usage

For a given 2D/3D array of data values of shape 1CHW(D) and a set of points points of shape ND, run the following code to interpolate the data at the given points:

output = unstructured_interpolation(values, points)

The returned tensor will be of shape NC.

About

Unstructured interpolation of 2D/3D data at arbitrary locations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages