sum_neighbors_vol {fMRItools} | R Documentation |
Sum of each voxel's neighbors
Description
For each voxel in a 3D logical or numeric array, sum the values of the six neighboring voxels.
Usage
sum_neighbors_vol(arr, pad = 0)
Arguments
arr |
The 3D array. |
pad |
In order to compute the sum, the array is temporarily padded along
each edge with the value of |
Details
Diagonal voxels are not considered adjacent, i.e. the voxel at (0,0,0) is not adjacent to the voxels at (1,1,0) or (1,1,1), although it is adjacent to (1,0,0).
Value
An array with the same dimensions as arr
. Each voxel value
will be the sum across the immediate neighbors. If arr
was a logical
array, this value will be between 0 and 6.