sph2fs | R Documentation |
Transform spherical coordinates to FreeSurfer surface space to plot things around a brain.
sph2fs(
lon,
lat,
radius = surf.radius.fsaverage(),
center = surf.center.fsaverage(),
deg = TRUE
)
lon |
numerical vector, the longitudes, passed to |
lat |
numerical vector, the latitudes, passed to |
radius |
numerical vector, the radii, passed to |
center |
numerical vector of length 3, the x, y, and z coordinates of the target center. The |
deg |
logical, whether to use degrees (as opposed to radians) as the unit for 'lat' and 'lon'. Passed to |
This function can be used to plot things in FreeSurfer space using spherical coordinates, as commonly used in EEG to define electrode positions. Requires the 'sphereplot' package.
## Not run:
# Draw voxels on a sphere around fsaverage:
lat = seq.int(from=0, to=360, by=30);
lon = rep(0, length(lat));
vis.fs.surface('~/software/freesurfer/subjects/fsaverage/surf/lh.white');
fsbrain::rglvoxels(sph2fs(lat, lon), voxelcol = 'red');
fsbrain::rglvoxels(sph2fs(lon, lat), voxelcol = 'green');
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.