MedicalVisualization
3D Texture Interpolation (Nearest-Neighbour)
← Bilinear Interpolation | ● | Trilinear Interpolation →
A volume is given with the dimensions w,h,d (in voxels). The voxel value of the i-th column, j-th row and k-th slice is given by V(i,j,k). This equals the (i+w(j+kh))-th element in the linear memory layout.
Then the data value at normalized texture coordinate (s,t,r)∈[0,1] is determined via Nearest-Neighbour Interpolation of voxels V(i,j,k) at the index:
i=⌊s⋅(w−1)+12⌋
j=⌊t⋅(h−1)+12⌋
k=⌊r⋅(d−1)+12⌋
The scalar function is therefore:
f(s,t,r)=
V(⌊s⋅(w−1)+12⌋,
⌊t⋅(h−1)+12⌋,
⌊r⋅(d−1)+12⌋)