View source: R/channel-compose.R
compose_channel | R Documentation |
In some cases, for example, deep-brain stimulation ('DBS'),
it is often needed to analyze averaged electrode channels from segmented
'DBS' leads, or create bipolar contrast between electrode channels, or
to generate non-equally weighted channel averages for 'Laplacian' reference.
compose_channel
allows users to generate a phantom channel that does
not physically exist, but is treated as a normal electrode channel in 'RAVE'.
compose_channel(
subject,
number,
from,
weights = rep(1/length(from), length(from)),
normalize = FALSE,
force = FALSE,
label = sprintf("Composed-%s", number),
signal_type = c("auto", "LFP", "Spike", "EKG", "Audio", "Photodiode", "Unknown")
)
subject |
'RAVE' subject |
number |
new channel number, must be positive integer, cannot be existing electrode channel numbers |
from |
a vector of electrode channels that is used to compose this
new channel, must be non-empty; see |
weights |
numerical weights used on each |
normalize |
whether to normalize the weights such that the composed
channel has the same variance as |
force |
whether to overwrite existing composed channel if it exists;
default is false. By specifying |
label |
the label for the composed channel; will be stored at
|
signal_type |
signal type of the composed channel; default is
|
Nothing
library(raveio)
# Make sure demo subject exists in this example, just want to make
# sure the example does not error out
if(
interactive() && "demo" %in% get_projects() &&
"DemoSubject" %in% as_rave_project('demo')$subjects() &&
local({
subject <- as_rave_subject("demo/DemoSubject")
!100 %in% subject$electrodes
})
) {
# the actual example code:
# new channel 100 = 2 x channel 14 - (channe 15 + 16)
compose_channel(
subject = "demo/DemoSubject",
number = 100,
from = c(14, 15, 16),
weights = c(2, -1, -1),
normalize = FALSE
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.