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.
erode_vol(vol, n_erosion = 1, out_of_mask_val = NA)
vol | The volume to erode. Out-of-mask voxels should be indicated by a
value in |
---|---|
n_erosion | The number of layers to erode the mask by. |
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 in this vector will be used to replace
the eroded voxels. Default: |