dilate_mask_vol {fMRItools} | R Documentation |
Dilate 3D mask
Description
Dilate a volumetric mask by a certain number of voxel layers. For each layer, any out-of-mask voxel adjacent to at least one in-mask voxel is added to the mask.
Usage
dilate_mask_vol(vol, n_dilate = 1, out_of_mask_val = NA, new_val = 1)
Arguments
vol |
The 3D array to dilate. The mask to dilate is defined by all
values not in |
n_dilate |
The number of layers to dilate the mask by. Default:
|
out_of_mask_val |
A voxel is not included in the mask if and only if its
value is in this vector. Default: |
new_val |
Value for voxels newly added to the mask. Default: |
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
The dilated vol
. It is the same as vol
, but dilated
voxels are replaced with new_val
.