Compute a brain-like mask from image intensities
Source:R/all_generic.R, R/filebacked_neurovec.R, R/mapped_neurovec.R, and 2 more
automask-methods.RdBuilds a spatial mask from image content rather than requiring an external mask. The implementation is AFNI-inspired: it computes a clip level, applies thresholding to a representative 3D image, retains the largest connected component, and optionally applies peel/unpeel cleanup.
Usage
automask(
x,
mfrac = 0.5,
gradual = TRUE,
representative = "mean_abs",
peels = 1L,
peel_threshold = 17L,
connect = c("26-connect", "18-connect", "6-connect")
)
# S4 method for class 'FileBackedNeuroVec'
automask(
x,
mfrac = 0.5,
gradual = TRUE,
representative = "mean_abs",
peels = 1L,
peel_threshold = 17L,
connect = c("26-connect", "18-connect", "6-connect")
)
# S4 method for class 'MappedNeuroVec'
automask(
x,
mfrac = 0.5,
gradual = TRUE,
representative = "mean_abs",
peels = 1L,
peel_threshold = 17L,
connect = c("26-connect", "18-connect", "6-connect")
)
# S4 method for class 'DenseNeuroVec'
automask(
x,
mfrac = 0.5,
gradual = TRUE,
representative = "mean_abs",
peels = 1L,
peel_threshold = 17L,
connect = c("26-connect", "18-connect", "6-connect")
)
# S4 method for class 'AbstractSparseNeuroVec'
automask(
x,
mfrac = 0.5,
gradual = TRUE,
representative = "mean_abs",
peels = 1L,
peel_threshold = 17L,
connect = c("26-connect", "18-connect", "6-connect")
)
# S4 method for class 'NeuroVol'
automask(
x,
mfrac = 0.5,
gradual = TRUE,
representative = "mean_abs",
peels = 1L,
peel_threshold = 17L,
connect = c("26-connect", "18-connect", "6-connect")
)Arguments
- x
A neuroimaging object.
- mfrac
Fraction used in the clip-level update step.
- gradual
If
TRUE, use a spatially varying clip map across octants. IfFALSE, use a single global clip threshold.- representative
For multi-volume inputs, the 3D summary image used for thresholding. Supported values are
"mean_abs"and"median".- peels
Number of AFNI-style peel/unpeel iterations. Use
0to disable.- peel_threshold
Minimum number of 18-neighbors required for a voxel to survive peeling.
- connect
Connectivity used when retaining the largest component.