Convert number of NN smoothing iterations to a FreeSurfer Gaussian smoothing FWHM.
Source:R/fwhm_smoothing.R
niters2fwhm.RdInverse of fwhm2niters: convert a number of nearest-neighbor (NN) smoothing iterations into the equivalent Gaussian smoothing kernel width, given as the full width at half maximum (FWHM) in millimeters.
Arguments
- niters
positive integer, the number of NN smoothing iterations (the
num_iterparameter ofpervertexdata.smoothnn).- surface
a mesh, represented as an
fs.surfaceinstance from thefreesurferformatspackage, atmesh3dinstance fromrgl, or a character string representing the path of a surface file to load. Used to compute the mean vertex area. Ignored ifavg_vertex_areais given.- avg_vertex_area
numeric scalar, the mean vertex area of the mesh in square millimeters (squared mesh units). If
NULL(the default), it is computed fromsurface. See details for how FreeSurfer's own numbers differ.- k
positive integer, the k-ring neighborhood size to use for NN smoothing. The FreeSurfer-based calibration below is only valid for the 1-ring neighborhood (
k=1); a warning is issued otherwise.
Value
numeric scalar, the FWHM in millimeters of the Gaussian smoothing kernel that the given number of NN smoothing iterations approximates.
Details
This is the inverse of fwhm2niters, using the same empirically calibrated FreeSurfer formula (utils/mrisutils.cpp in the FreeSurfer source):
It is useful to check what amount of Gaussian smoothing (FWHM) a given number of NN smoothing iterations corresponds to, e.g., to report the equivalent FWHM in a paper or to compare settings across methods. The calibration is only valid for the 1-ring neighborhood (k=1).
See also
fwhm2niters for the forward conversion, pervertexdata.smoothnn and pervertexdata.smoothnn.adj for the actual NN smoothing.
Examples
if (FALSE) { # \dontrun{
mesh = freesurferformats::read.fs.surface(system.file("extdata", "fsaverage_mesh_lh_white", package = "haze", mustWork = TRUE));
fwhm = niters2fwhm(92, surface = mesh); # ~10 mm FWHM
} # }