class_docstr: Applies a displacement field to a point set given in vtk format.
  Any discrete deformation field, given in physical coordinates and
  which volume covers the extent of the vtk point set, is a valid
  ``warp`` file. FSL interfaces are compatible, for instance any
  field computed with :class:`nipype.interfaces.fsl.utils.ConvertWarp`.
  
  Example::
  
      from nipype.algorithms.mesh import WarpPoints
      wp = WarpPoints()
      wp.inputs.points = 'surf1.vtk'
      wp.inputs.warp = 'warpfield.nii'
      res = wp.run()
code: def _run_interface(self, runtime):
      import nibabel as nb
      from scipy import ndimage
  
      r = tvtk.PolyDataReader(file_name=self.inputs.points)
      r.update()
      mesh = VTKInfo.vtk_output(r)
      points = np.array(mesh.points)
      warp_dims = nb.funcs.four_to_three(nb.load(self.inputs.warp))
  
      affine = warp_dims[0].affine
      # voxsize = warp_dims[0].header.get_zooms()
      vox2ras = affine[0:3, 0:3]
      ras2vox = np.linalg.inv(vox2ras)
      origin = affine[0:3, 3]
      voxpoints = np.array(
          [np.dot(ras2vox, (p - origin)) for p in points]
      )
  
      warps = []
      for axis in warp_dims:
          wdata = axis.dataobj  # four_to_three ensures this is an array
          if np.any(wdata != 0):
              warp = ndimage.map_coordinates(
                  wdata, voxpoints.transpose()
              )
          else:
              warp = np.zeros((points.shape[0],))
  
          warps.append(warp)
  
      disps = np.squeeze(np.dstack(warps))
      newpoints = [p + d for p, d in zip(points, disps)]
      mesh.points = newpoints
      w = tvtk.PolyDataWriter()
      VTKInfo.configure_input_data(w, mesh)
      w.file_name = self._gen_fname(
          self.inputs.points, suffix="warped", ext=".vtk"
      )
      w.write()
      return runtime
  
imports: import os.path
  import numpy
  from numpy import linalg
  from ..None import logging
  from ..interfaces.base import BaseInterface, traits, TraitedSpec, File, BaseInterfaceInputSpec
  from ..interfaces.vtkbase import tvtk
  from ..interfaces import vtkbase
label_desc: Use image node_id 2 for calling the WarpPoints obj's underlying member method code with example usage: obj._run_interface(runtime) and returns: runtime