spm_sample_vol.m 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. function varargout = spm_sample_vol(varargin)
  2. % Return voxel values from an image volume - a compiled routine
  3. % FORMAT X = spm_sample_vol(V,x,y,z,hold)
  4. % V - spm_vol structure
  5. % x - matrix of x coordinates {voxels}
  6. % y - matrix of y coordinates {voxels}
  7. % z - matrix of z coordinates {voxels}
  8. % hold - interpolation method for the resampling:
  9. % 0 : Zero-order hold (nearest neighbour)
  10. % 1 : First-order hold (trilinear interpolation)
  11. % 2->127 : Higher order Lagrange (polynomial) interpolation
  12. % using different holds (second-order upwards)
  13. % -127 - -1 : Different orders of sinc interpolation
  14. %
  15. % X - output image
  16. %
  17. % FORMAT [X,dX,dY,dZ] = spm_sample_vol(V,x,y,z,hold)
  18. % Similar to above, except that the derivatives in the three orthogonal
  19. % directions are also returned.
  20. %__________________________________________________________________________
  21. %
  22. % spm_sample_vol returns the voxel values from an image volume indicated
  23. % by V at coordinates x,y,z. Values from coordinates outside the image
  24. % are set to zero. x, y and z must be matrices of the same dimensions.
  25. %
  26. % See also: spm_vol.m, spm_slice_vol.m
  27. %__________________________________________________________________________
  28. % Copyright (C) 1999-2015 Wellcome Trust Centre for Neuroimaging
  29. % John Ashburner
  30. % $Id: spm_sample_vol.m 6340 2015-02-16 12:25:56Z guillaume $
  31. %-This is merely the help file for the compiled routine
  32. error('spm_sample_vol.c not compiled - see Makefile')