Functions

In addition to the function available for processing EEG data, a number of functions are provided specifically for the processing of SSR data

Import

Neuroimaging.read_EEGFunction
read_EEG(fname::AbstractString)
read_EEG(args...)

Read a file or IO stream and store the data in an GeneralEEG type.

Arguments

  • fname: Name of the file to be read
  • min_epoch_length: Minimum epoch length in samples. Shorter epochs will be removed (0)
  • max_epoch_length: Maximum epoch length in samples. Longer epochs will be removed (0 = all)
  • valid_triggers: Triggers that are considered valid, others are removed ([1,2])
  • stimulation_amplitude: Amplitude of stimulation (NaN)
  • remove_first: Number of epochs to be removed from start of recording (0)
  • max_epochs: Maximum number of epochs to retain (0 = all)

Supported file formats

  • BIOSEMI (.bdf)
source

Querying data

Neuroimaging.samplingrateMethod
samplingrate(t::Type, s::EEG)
samplingrate(s::EEG)

Return the sampling rate of an EEG type in Hz as the requested type. If no type is provided, the sampling rate is returned as a floating point number.

Examples

s = read_EEG(filename)
samplingrate(s)
source
Neuroimaging.channelnamesMethod
channelnames(s::EEG)

Return the names of sensors in EEG measurement.

Examples

s = read_EEG(filename)
channelnames(s)
source
Neuroimaging.sensorsMethod
sensors(s::EEG)
channelnames(s::EEG, l::AbstractVector{AbstractString})

Returns the sensors for an EEG recording.

Examples

s = read_EEG(filename)
sensors(s)
source
Neuroimaging.dataMethod
data(s::EEG)
data(s::EEG, channel::AbstractString)
data(s::EEG, channels::AbstractVector{AbstractString})

Return the data stored in the type object. This may be useful for integration with custom processing.

Examples

s = read_EEG(filename)
data(s)
data(s, "Cz")
data(s, ["Cz", "P2"])
source

Manipulating data

Base.hcatMethod
hcat(a::EEG, b::EEG)

Concatenate two EEG measurements together, effectively creating a single long measurement.

Examples

hcat(a, b)
source
Neuroimaging.add_channelMethod
add_channel(a::EEG, data::Vector, chanLabel::AbstractString)

Add a channel to the EEG type with specified channel names.

Examples

s = read_EEG(filename)
new_channel = mean(s.data, 2)
s = add_channel(s, new_channel, "MeanChannelData")
source
Neuroimaging.remove_channel!Method
remove_channel!(a::EEG, channelname::AbstractString)
remove_channel!(a::EEG, channelnames::Array{AbstractString})
remove_channel!(a::EEG, channelidx::Int)
remove_channel!(a::EEG, channelidxs::Array{Int})

Remove channel(s) from EEG as specifed by channelname or channelidx.

Examples

a = read_EEG(filename)
remove_channel!(a, ["TP8", "Cz"])
source
Neuroimaging.keep_channel!Method
keep_channel!(a::EEG, channelname::AbstractString)
keep_channel!(a::EEG, channelnames::Array{AbstractString})
keep_channel!(a::EEG, channelidxs::Array{Int})

Remove all channels except those requested from EEG.

Examples

a = read_EEG(filename)
keep_channel!(a, ["P8", "Cz"])
source
Neuroimaging.trim_channelMethod
trim_channel(a::EEG, stop::Int; start::Int=1)

Trim EEG recording by removing data after stop specifed samples and optionally before start samples.

Examples

s = trim_channel(s, 8192*300, start=8192)
source
Neuroimaging.merge_channelsFunction
merge_channels(a::EEG, merge_Chans::Array{S}, new_name::S) where {S<:AbstractString}
merge_channels(a::EEG, merge_Chans::S, new_name::S) where {S<:AbstractString}

Average EEG channels listed in merge_Chans and label the averaged channel as new_name.

Examples

s = merge_channels(s, ["P6", "P8"], "P68")
source

Filtering

Neuroimaging.filter_highpassMethod
filter_highpass(a::EEG; cutOff::Real=2, fs::Real=samplingrate(a), order::Int=0, kwargs...)

Apply a high pass filter.

If order is zero then its computed magically.

Examples

a = read_EEG(fname)
b = filter_highpass(a)
c = filter_highpass(a, cutOff = 1)
source
Neuroimaging.filter_lowpassMethod
filter_lowpass(a::EEG; cutOff::Real=150, fs::Real=samplingrate(a), order::Int=0, kwargs...)

Apply a low pass filter.

If order is zero then its computed magically.

Examples

a = read_EEG(fname)
b = filter_lowpass(a)
c = filter_lowpass(a, cutOff = 1)
source

Epoching