vtkimagedata scalar value at specific point(world point)

Hello, I’m trying to get scalar from vtkimagedata

I set scalars to the vtkimagedata (0,1,2,3,4,5, etc)

And I want to get interpolated data such as 0.99955, 1.4325… at a single 3D point which is inside the bound of image.

How can I calculate that?


As far as I know, values in a vtkImageData are cell-centered (a voxel has a singe color). So, if you probe a location it’ll likely fall inside one cell (not interpolated).