Please use a safer new_reference
function to
create instances. This documentation is to describe the member methods
of the electrode class LFP_reference
Value
if the reference number if NULL
or 'noref'
, then
returns 0, otherwise returns a FileArray-class
If simplify
is enabled, and only one block is loaded,
then the result will be a vector (type="voltage"
) or a matrix
(others), otherwise the result will be a named list where the names
are the blocks.
Super class
raveio::RAVEAbstarctElectrode
-> LFP_reference
Active bindings
exists
whether electrode exists in subject
h5_fname
'HDF5' file name
valid
whether current electrode is valid: subject exists and contains current electrode or reference; subject electrode type matches with current electrode type
raw_sample_rate
voltage sample rate
power_sample_rate
power/phase sample rate
preprocess_info
preprocess information
power_file
path to power 'HDF5' file
phase_file
path to phase 'HDF5' file
voltage_file
path to voltage 'HDF5' file
Methods
Inherited methods
Method new()
constructor
Usage
LFP_reference$new(subject, number, quiet = FALSE)
Arguments
subject, number, quiet
see constructor in
RAVEAbstarctElectrode
Method .load_wavelet()
load referenced wavelet coefficients (internally used)
Usage
LFP_reference$.load_wavelet(
type = c("power", "phase", "wavelet-coefficient"),
reload = FALSE
)
Method load_data()
method to load electrode data
Usage
LFP_reference$load_data(
type = c("power", "phase", "voltage", "wavelet-coefficient")
)
Method load_blocks()
load electrode block-wise data (with reference), useful when epoch is absent
Usage
LFP_reference$load_blocks(
blocks,
type = c("power", "phase", "voltage", "wavelet-coefficient"),
simplify = TRUE
)
Examples
if (FALSE) { # \dontrun{
# Download subject demo/DemoSubject
subject <- as_rave_subject("demo/DemoSubject")
# Electrode 14 as reference electrode (Bipolar referencing)
e <- new_reference(subject = subject, number = "ref_14",
signal_type = "LFP")
# Reference "ref_13-16,24" (CAR or white-matter reference)
ref <- new_reference(subject = subject, number = "ref_13-16,24",
signal_type = "LFP")
ref
# Set epoch
e$set_epoch(epoch = 'auditory_onset')
# Set loading window
e$trial_intervals <- list(c(-1, 2))
# Preview
print(e)
# Now epoch power
power <- e$load_data("power")
names(dimnames(power))
# Subset power
subset(power, Time ~ Time < 0, Electrode ~ Electrode == 14)
# clear cache on hard disk
e$clear_cache()
} # }