erode_mask_vol {fMRItools} | R Documentation |
Erode 3D mask
Description
Erode a volumetric mask by a certain number of voxel layers. For each layer, any in-mask voxel adjacent to at least one out-of-mask voxel is removed from the mask.
Usage
erode_mask_vol(vol, n_erosion = 1, out_of_mask_val = NA)
Arguments
vol |
The 3D array to erode. The mask to erode is defined by all values
not in |
n_erosion |
The number of layers to erode 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. The first value of this vector will be used to
replace eroded voxels. 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 eroded vol
. It is the same as vol
, but eroded
voxels are replaced with out_of_mask_val[1]
.