Interpolate points in a given mesh from DVF image volume

I have generated a volumetric mesh and saved it as a vtkUnstrcturedGrid (i.e. a .vtk file). Now what I want is that I need to deform it according to the deforamtion vector field stored in nifti format. The dimension of that nifti file is 5. For example the shape of this image is (203, 127, 161, 1, 3).

In order to achieve that I should interpolate each point in the mesh from this DVF. How can I do this using VTK ? Can you please elaborate with an example ?

Please help me on this matter. Thank you very much for your time and consideration.

Here I extracted a volumetric mesh from a nifti image which has a dimension of (203, 127, 161). I have then applied a non-rigid deformation to this nifti file and saved the deformation vector field as another nifti file. The shape of this DVF nifti mage is (203, 127, 161, 1, 3). Here the deformation field is the final position of the voxel after it has been transformed, i.e. it is the initial position of the voxel + the displacement of the voxel.

Now I need to distort the volumetric mesh based on this deformation vector field. How can I accomplish this using VTK ? Could you please give an example ?

I highly appricaite your willingness to help me out on this issue.

I’m looking for a solution to this. Please some one let me know any steps for this ?

You can use the displacement field in a vtkGridTransform and transform to the mesh with that using vtkTransformFilter.

Note that image transformation requires a resampling transform, which is the inverse of the modelling transform, which is required fro transforming meshes. If you work with medical images then also make sure to use a consistent patient coordinate system (LPS or RAS everywhere).