imaging-surface {ieegio} | R Documentation |
Supports surface geometry, annotation, measurement, and
time-series data.
Please use the high-level function read_surface
, which calls
other low-level functions internally.
read_surface(file, format = "auto", type = NULL, ...)
write_surface(
x,
con,
format = c("gifti", "freesurfer"),
type = c("geometry", "annotations", "measurements", "color", "time_series"),
...
)
io_read_fs(
file,
type = c("geometry", "annotations", "measurements"),
format = "auto",
name = basename(file),
...
)
io_read_gii(file)
io_write_gii(x, con, ...)
file , con |
path the file |
format |
format of the file, see 'Arguments' section in
|
type |
type of the data; ignored if the file format is 'GIfTI'. For 'FreeSurfer' files, supported types are
|
... |
for |
x |
surface (geometry, annotation, measurement) data |
name |
name of the data; default is the file name |
A surface object container
library(ieegio)
# geometry
geom_file <- "gifti/GzipBase64/sujet01_Lwhite.surf.gii"
# measurements
shape_file <- "gifti/GzipBase64/sujet01_Lwhite.shape.gii"
# time series
ts_file <- "gifti/GzipBase64/fmri_sujet01_Lwhite_projection.time.gii"
if(ieegio_sample_data(geom_file, test = TRUE)) {
geometry <- read_surface(ieegio_sample_data(geom_file))
print(geometry)
measurement <- read_surface(ieegio_sample_data(shape_file))
print(measurement)
time_series <- read_surface(ieegio_sample_data(ts_file))
print(time_series)
# merge measurement & time_series into geometry
merged <- merge(geometry, measurement, time_series)
print(merged)
# make sure you install `rgl` package
plot(merged, name = c("measurements", "Shape001"))
plot(merged, name = "time_series",
slice_index = c(1, 11, 21, 31))
}