Definitions of electrode with local field potential signal type
Source:R/class008-LFP_electrode.R
LFP_electrode.RdPlease use a safer new_electrode function to
create instances. This documentation is to describe the member methods
of the electrode class LFP_electrode
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 classes
ravepipeline::RAVESerializable -> ravecore::RAVEAbstarctElectrode -> LFP_electrode
Active bindings
h5_fname'HDF5' file name
validwhether current electrode is valid: subject exists and contains current electrode or reference; subject electrode type matches with current electrode type
raw_sample_ratevoltage sample rate
power_sample_ratepower/phase sample rate
preprocess_infopreprocess information
power_filepath to power 'HDF5' file
phase_filepath to phase 'HDF5' file
voltage_filepath to voltage 'HDF5' file
Methods
Method new()
constructor
Usage
LFP_electrode$new(subject, number, quiet = FALSE)Arguments
subject, number, quietsee constructor in
RAVEAbstarctElectrode
Method .load_wavelet()
load referenced wavelet coefficients (internally used)
Usage
LFP_electrode$.load_wavelet(
type = c("power", "phase", "wavelet-coefficient"),
reload = FALSE
)Method load_data_with_epochs()
method to load electrode data
Usage
LFP_electrode$load_data_with_epochs(
type = c("power", "phase", "voltage", "wavelet-coefficient", "raw-voltage")
)Arguments
typedata type such as
"power","phase","voltage","wavelet-coefficient", and"raw-voltage". For"power","phase", and"wavelet-coefficient", 'Wavelet' transforms are required. For"voltage", 'Notch' filters must be applied. All these types except for"raw-voltage"will be referenced. For"raw-voltage", no reference will be performed since the data will be the "raw" signal (no processing).
Method load_dimnames_with_epochs()
get expected dimension names
Usage
LFP_electrode$load_dimnames_with_epochs(
type = c("power", "phase", "voltage", "wavelet-coefficient", "raw-voltage")
)Method load_data_with_blocks()
load electrode block-wise data (with no reference), useful when epoch is absent
Usage
LFP_electrode$load_data_with_blocks(
blocks,
type = c("power", "phase", "voltage", "wavelet-coefficient", "raw-voltage"),
simplify = TRUE
)Arguments
blockssession blocks
typedata type such as
"power","phase","voltage","raw-voltage"(with no filters applied, as-is from imported),"wavelet-coefficient". Note that if type is"raw-voltage", then the data only needs to be imported; for"voltage"data, 'Notch' filters must be applied; for all other types, 'Wavelet' transforms are required.simplifywhether to simplify the result
Method load_dim_with_blocks()
get expected dimension information for block-based loader
Usage
LFP_electrode$load_dim_with_blocks(
blocks,
type = c("power", "phase", "voltage", "wavelet-coefficient", "raw-voltage")
)Examples
# Download subject demo/DemoSubject
if(has_rave_subject("demo/DemoSubject")) {
subject <- as_rave_subject("demo/DemoSubject", strict = FALSE)
# Electrode 14 in demo/DemoSubject
e <- new_electrode(subject = subject, number = 14, signal_type = "LFP")
# Load CAR reference "ref_13-16,24"
ref <- new_reference(subject = subject, number = "ref_13-16,24",
signal_type = "LFP")
e$set_reference(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_with_epochs("power")
names(dimnames(power))
# Subset power
subset(power, Time ~ Time < 0, Electrode ~ Electrode == 14)
# clear cache on hard disk
e$clear_cache()
ref$clear_cache()
}