Erode, dilate, or get the borders of a mask along the cortical surface
edit_mask_surf(
x,
mwall = NULL,
surf = NULL,
hemisphere = c("left", "right"),
do = c("erode", "dilate", "borders"),
depth = 1
)erode_mask_surf(
x,
mwall = NULL,
surf = NULL,
hemisphere = c("left", "right"),
depth = 1
)
dilate_mask_surf(
x,
mwall = NULL,
surf = NULL,
hemisphere = c("left", "right"),
depth = 1
)
x
after erosion or dilation.
Vector of the data mask to edit, and the medial wall mask.
These can be specified in two ways. First, mwall
can be a logical vector
with each entry corresponding to a vertex as the cortical surface, and
using FALSE
values to indicate medial wall vertices. In this first case,
x
should then be a logical vector with each entry corresponding to a
TRUE
value in mwall
. TRUE
values in x
should
indicate the mask to be edited.
Second, mwall
can be NULL
(default) in which case x
should then be a logical vector with each entry corresponding to a vertex
on the cortical surface. TRUE
values in x
should indicate the
mask to be edited.
In either case, xii$data$cortex_left[,1]
and
xii$meta$cortex$medial_wall_mask$left
should work.
Provide one: the surface in the same resolution as the data, or the name of the hemisphere of the surface to resample and use (default: resample the left surface).
"erode"
(default), "dilate"
, or "borders"
.
"erode"
removes faces with at least one vertex not inside the mask.
"dilate"
adds faces with at least one vertex inside the mask.
"borders"
obtains the vertices inside the mask which share a face
with at least one vertex not inside the mask.
How many iterations of the edit? Default: 1
. Does not
apply to "borders"
.
The depth of the edit is determined by the number of edges between the
vertices. To erode or dilate based on spatial distance (mm), see
-cifti-dilate
and -cifti-erode
.
Other surface-related:
add_surf()
,
boundary_mask_surf()
,
even_vert_samp()
,
is.surf()
,
load_surf()
,
mask_surf()
,
read_surf()
,
resample_surf()
,
rotate_surf()
,
surf_area()
,
view_surf()
,
write_surf_gifti()