-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathspm_sample_vol.m
36 lines (33 loc) · 1.54 KB
/
spm_sample_vol.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function varargout = spm_sample_vol(varargin)
% returns voxel values from a memory mapped image - a compiled routine
% FORMAT X = spm_sample_vol(V,x,y,z,hold);
% V - is a memory mapped image volume
% x - matrix of x coordinates {pixels}
% y - matrix of y coordinates {pixels}
% z - matrix of z coordinates {pixels}
% hold - sets the interpolation method for the resampling.
% 0 Zero-order hold (nearest neighbour).
% 1 First-order hold (trilinear interpolation).
% 2->127 Higher order Lagrange (polynomial) interpolation using
% different holds (second-order upwards).
% -127 - -1 Different orders of sinc interpolation.
% X - output image
%
% OR [X,dX,dY,dZ] = spm_sample_vol(V,x,y,z,hold);
% Similar to above, except that the derivatives in the three orthogonal
% directions are also returned.
%_______________________________________________________________________
%
% spm_sample_vol will return the voxel values from a memory mapped
% volume indicated by V at coordinates x,y,z. Values from coordinates
% outside the image are set to zero. x, y and z must be matrices of the
% same dimensions
%
% see also spm_slice_vol.m
%
%_______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% John Ashburner
% $Id: spm_sample_vol.m 1143 2008-02-07 19:33:33Z spm $
%-This is merely the help file for the compiled routine
error('spm_sample_vol.c not compiled - see Makefile')