Interpolate a 3D array

Dale_James_Black
Wed, 01 Feb 2023 20:27:14 +0000
Signal and Image Processing

If I have a 3D array along with a unit normal vector and point for a plane that intersects that array, how would I use Interpolations.jl to create a new 3D array that is the same size as the original array but where all the voxels are interpolated to be perpendicular to that plane? So far I have an interpolation but I am not sure how to use it:

# Define original array
A = rand(512, 512, 320)

# Define the normal vector of the plane
normal = [0.980998, -0.0695175, -0.181134]

# Define a point on the plane
point = [190, 195, 7]

A_x, A_y, A_z = 1:512, 1:512, 1:320
nodes = (A_x, A_y, A_z)
itp = interpolate(nodes, A, Gridded(Linear()))

20 posts - 5 participants