Closed chiatchechang closed 2 years ago
good point about nearest neighbor.
We should use an explicit formula similar to how opengl specifies it: https://stackoverflow.com/questions/38030310/what-happens-in-the-case-of-nearest-neighbour-interpolation-opengl-centre-of-pix
An image might help, but it should be unambiguous as-is now.
In channelfromimage3d, when filter is set to "nearest", sampling at an arbitrary (u,v,w) returns the floating point value defined by the closest point (u',v',w') to (u,v,w) which transforms back to a voxel center in the 3D image resource.
Isn't it possible to have several points at the same minimum distance? It is not specified which value should be used in this case.
(If filter is set to "linear", I guess the the eight closest points coordinates could be technically ambiguous but in that case, the interpolated value should be the same whatever closest points we choose so it's a non-issue.)