Set values for a displacement field


I want to set values for a displacement field. If the position is on a grid point, i.e. something like [2,3,4], I will just use SetPixel(). However, sometimes the position is not on a grid point, like [0.5, 1.7, 3.5]. It looks SetPixel() only supports integers for voxel location. After the vector values are set, I will interpolate the displacement field to make sure every grid point has a value.

What’s the best way to perform the value setup and interpolation?


Maybe you want to use DisplacementFieldTransform instead of manually doing it? Or some other filter from that module?