# Please get your own sample data first. This package does not
# provide sample data for privacy and license concerns :)
if(interactive() && file.exists("sampledata.nev")) {
library(readNSx)
# ---- Import for the first time --------------------------------
import_nsp(
path = "sampledata.nev",
prefix = file.path(
"~/BIDSRoot/MyDataSet/sub-YAB/ses-008/ieeg/",
"sub-YAB_ses-008_task-congruency_acq-NSP1_run-01"
),
exclude_events = "spike", partition_prefix = "/part"
)
# ---- Load header information --------------------------------
prefix <- "sub-YAB_ses-008_task-congruency_acq-NSP1_run-01"
nev <- get_nev(prefix)
ns3 <- get_nsx(prefix, which = 3)
# get nev from nsx, or nsx from nev
get_nev(ns3)
get_nsx(nev, which = 5)
# ---- Load channel data
result <- get_channel(prefix, channel_id = 10)
channel_signal <- result$channel_detail$part1$data
channel_signal[]
}
Run the code above in your browser using DataLab