NeuroAnalyzer Glossary

The glossary defines terms and conventions specific to NeuroAnalyzer. Examples use the EEG recording from the tutorial files:

using NeuroAnalyzer
eeg = import_edf("files/eeg/eeg-test-edf.edf")

Bad channel

A channel marked as unusable (e.g. flat, noisy or disconnected). Bad channels are stored as a Boolean vector, one value per channel, in obj.header.recording[:bad_channel], and can be selected with ch = "bad". With the exclude_bad_channels preference set, bad channels are excluded from analyses that support it. See Mark bad channels.

BEM

Boundary element model: a head model of nested closed surfaces (inner skull, outer skull, scalp) with the conductivity of each compartment, used to compute forward solutions. Stored as a BEM object (surfaces, conductivities and, optionally, the BEM solution matrix); loaded with import_bem(). See Boundary element models.

Channel

A single signal recorded over time. Each channel has a label (e.g. "Fp1"), a channel type (e.g. "eeg" or "eog") and a unit (e.g. "μV"). Channel properties are stored in the header:

rec = eeg.header.recording
println("labels: ", rec[:label][1:5])
println("types:  ", rec[:channel_type][[1, 17, 22, 24]])
println("units:  ", rec[:unit][1:3])
labels: ["Fp1", "Fp2", "F3", "F4", "C3"]
types:  ["eeg", "ref", "eog", "ecg"]
units:  ["μV", "μV", "μV"]

Channel selection

Functions select channels with the ch keyword argument, which accepts:

  • a label: ch = "Fp1"
  • a vector of labels: ch = ["Fp1", "Fp2"]
  • a channel type: ch = "eeg", ch = "eog"; group types are also accepted: "meg" (magnetometers and gradiometers), "nirs" (all NIRS signal types), "sensors" (all motion sensor types)
  • "all" - all channels
  • "bad" - channels marked as bad
  • a regular expression, matched anywhere in the label: ch = r"^F" (all labels starting with F)

Labels, types and keywords may be mixed in a vector, e.g. ch = ["eeg", "eog"]. get_channel() returns the channel numbers of a selection:

println(get_channel(eeg; ch = r"^F"))
println(get_channel(eeg; ch = ["eog", "ecg"]))
[1, 2, 3, 4, 11, 12, 19]
[22, 23, 24]

Channel type

The kind of signal a channel contains, e.g. "eeg", "ref" (reference electrode), "eog", "ecg", "emg", "mag" and "grad" (MEG magnetometers and gradiometers), "nirs_od" (NIRS optical density), "accel" (accelerometer), "mrk" (marker channel) or "other". All available channel types are listed in the NeuroAnalyzer.channel_types variable.

Coordinate frame

The coordinate system of positions (in mm) of MRI volumes, surfaces, source spaces and dipoles, stored in their frame field: :ras (scanner RAS of the MRI), :tkr (FreeSurfer surface RAS, the frame of FreeSurfer surfaces and BEM models), :mni (MNI template space), :head (the head frame of the anatomical landmarks) or :unknown. 4×4 transforms (mm → mm) move objects between frames (surface_transform(), landmarks_transform(), locs_transform()).

Coregistration

Alignment of the digitized head of a recording (anatomical landmarks, EEG electrodes, head shape points; head frame) with the MRI of the subject: coregister() fits the digitized points to the scalp surface and returns the head → MRI transform. See Coregistration.

Data

The recorded signal values, stored in obj.data as a 3-dimensional array of 64-bit floats: channels × samples × epochs. A continuous recording has one epoch:

println("channels × samples × epochs: ", size(eeg.data))
channels × samples × epochs: (24, 308480, 1)

Analysis results are returned as vectors (e.g. one value per channel), matrices (e.g. channels × epochs) or arrays of higher dimension (e.g. channels × frequencies × epochs).

Data type

The kind of recording a NEURO object holds, stored in obj.header.recording[:data_type] and returned by datatype():

  • eeg - electroencephalography (EEG)
  • ecog - electrocorticography (ECoG)
  • seeg - stereoelectroencephalography (SEEG)
  • ieeg - intracranial electroencephalography (iEEG)
  • csd - current source density (CSD)
  • meg - magnetoencephalography (MEG)
  • nirs - near-infrared spectroscopy (NIRS)
  • sensors - various body sensors
  • eda - electrodermal activity (EDA)
  • mep - motor evoked potentials (MEP)
  • erp - event-related potential (ERP)
  • erf - event-related field (ERF)
  • tpt - two-point pinch test (TPT)

All available data types are listed in the NeuroAnalyzer.data_types variable. Many functions accept only some data types, e.g. average_epochs() requires EEG, MEG or NIRS.

Dipole

An equivalent current dipole: a point source with a position and a moment (strength and orientation), fitted to EEG/MEG data with dipole_fit() (spherical or BEM head model) and stored as a DIPOLE object (positions in mm, moments in nAm, goodness of fit). See Dipole fitting.

Epoch

A segment of recorded data, defined either by markers (e.g. stimulus onsets) or by fixed time intervals. Every NEURO object contains at least one epoch; a continuous recording is a single epoch. All epochs have the same length:

ep = epoch(eeg; ep_len = 2)
println("epochs: ", nepochs(ep), ", length: ", epoch_len(ep), " samples")
epochs: 602, length: 512 samples

Epoching is done after filtering, which should be applied to the continuous signal.

Epoch time

The time axis of a single epoch, in seconds, stored in obj.epoch_time. For epochs created with an offset (e.g. a pre-stimulus baseline), the epoch time starts at a negative value, so that 0 is the event onset:

ep = epoch(eeg; ep_len = 2, offset = 0.5)
println("epoch time: ", ep.epoch_time[1], " … ", ep.epoch_time[end], " s")
epoch time: -0.5 … 1.49609375 s

See also time points.

ERP / ERF object

The result of average_epochs(): an object of data type erp (EEG) or erf (MEG) containing only the signal channels. Epoch 1 is the average of all epochs; the following epochs are the individual epochs:

erp = average_epochs(ep)
println("data type: ", datatype(erp), ", epochs: ", nepochs(erp),
        " (average + ", nepochs(ep), ")")
data type: erp, epochs: 603 (average + 602)

Fiducials

Anatomical landmarks used to align channel locations with the head: the nasion (between the eyes), the inion (at the back of the head) and the left and right preauricular points (LPA, RPA, in front of the ears). Their default positions in NeuroAnalyzer’s head coordinates are stored in NeuroAnalyzer.fiducial_points. Fiducials of digitizations, MRI volumes and electrode files are loaded with import_landmarks(); they define the head frame and are used for coregistration.

Forward solution

The lead field: the signal at each channel produced by a dipole of unit moment (1 A·m) at each source of a source space, computed from a BEM model, the sensor positions and the coregistration with forward(), or loaded with import_fwd(). Stored as a FORWARD object (gain matrix: channels × sources, free or fixed orientation, SI units). See Forward solutions.

Head frame

The coordinate frame defined by the anatomical fiducials: the x axis from the LPA through the RPA, the y axis through the nasion, the z axis up (Neuromag/MNE-Python, BIDS CapTrak). EEG electrodes, MEG sensors and fitted dipoles are in the head frame; head_frame() returns the transform from the frame of the landmarks.

History

The list of processing steps applied to a NEURO object, with their parameters, stored in obj.history; each processing function appends an entry. history() prints it:

println(ep.history)
["epoch(obj; marker_value=\"\", marker_type=\"\", offset=0.5, ep_len=2, overlap=0, condition=\"value\", exclude_bad_segments=false, reject=nothing, flat=nothing)"]

Inverse operator

The parts of a minimum-norm source estimate that do not depend on the data (whitener, source covariance with depth weighting and orientation prior, SVD of the whitened lead field), computed once with inverse_operator() (from a forward solution and a noise covariance) or loaded with import_inv() (saved with export_inv()), and applied to data with apply_inverse() (MNE, dSPM, sLORETA). Stored as an INVERSE object. See Minimum-norm estimates.

Label

The name of a channel, e.g. "Fp1" for EEG or "S1_D1 OD" for NIRS. Labels are returned by labels() and must be unique. On import, EEG labels are cleaned by default (e.g. "EEG Fp1" → "Fp1"), see the clean_labels keyword of the importers.

Locs

The positions of electrodes or sensors (e.g. EEG electrodes or NIRS optodes), stored in obj.locs, a data frame with one row per channel. Positions are stored in three coordinate systems:

  • Cartesian (loc_x, loc_y, loc_z)
  • Planar (loc_radius, loc_theta), for 2-D head plots
  • Spherical (loc_radius_sph, loc_theta_sph, loc_phi_sph)

Angles are in degrees; theta is measured counter-clockwise from the X axis (right) and phi is the elevation above the XY plane. Coordinates are normalized so that the head fits a unit sphere.

NeuroAnalyzer uses the RAS (Right-Anterior-Superior) coordinate system:

Axis Positive direction Negative direction
X Right Left
Y Anterior (front) Posterior (rear)
Z Superior (top) Inferior (bottom)
load_locs!(eeg; file_name = "files/locs/standard-10-20-cap19-elmiko.locs")
eeg.locs[1:3, :]
3×9 DataFrame
Row label loc_radius loc_theta loc_x loc_y loc_z loc_radius_sph loc_theta_sph loc_phi_sph
String Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
1 Fp1 0.51111 108.0 -0.308829 0.950477 -0.034896 1.0 108.0 -1.9998
2 Fp2 0.51111 72.0 0.308829 0.950477 -0.034896 1.0 72.0 -1.9998
3 F3 0.33333 129.0 -0.545004 0.673024 0.500009 1.0 129.0 30.0006

See Channel locations.

Marker

An event recorded with the signal, such as a stimulus onset or a button press. Markers are stored in obj.markers, a data frame with one row per event and five columns:

  • type - kind of marker: "stim", "response", "annotation", "BAD" (bad segment), "boundary" (discontinuity), "epoch" or "other"
  • start - time of the event in seconds
  • length - duration of the event in seconds (0 for instantaneous events)
  • value - event value or description (e.g. "S01")
  • channel - labels of the channels the event refers to (a vector); an empty vector means all channels

Markers are added with add_marker!() and used to create event-related epochs with epoch(obj; marker_value = ...).

Montage

A set of channels derived from the recorded ones, e.g. a bipolar montage in which each channel is the difference of two electrodes ("Fp1-F7"). Montages are applied with reference_custom(); montage files can be imported with import_montage() and edited with edit_montage(). See also reference.

MRI object

An MRI volume (one or more 3D volumes) with the affine transform from voxel indices to mm in its coordinate frame, stored as an MRI object; loaded with import_nifti(), import_mgh(), import_dicom() or import_bst_mri(). See MRI.

Mutator

A function that modifies its input object in place instead of returning a modified copy. Mutators have the ! suffix, e.g. delete_channel!() or load_locs!(); the version without ! returns a new object and leaves the input unchanged. Mutators save memory for large recordings.

NEURO object

The fundamental data structure in NeuroAnalyzer. Each object contains:

A NEURO object is created by importing a recording (e.g. import_edf(), import_fiff(), import_nirs()), by loading a saved object (load_neuro()) or by creating an empty one (create_object()). See NEURO objects.

Noise covariance

The covariance of the signals without the activity of interest (e.g. of the pre-stimulus baseline or an empty-room MEG recording), used to whiten the data in dipole fitting and minimum-norm estimates. Estimated with noise_cov() or loaded with import_cov(); stored as a NOISECOV object. See Noise covariance.

Pick

A named group of EEG channel locations: :left, :right, :central (midline), :frontal, :temporal, :parietal and :occipital (or their abbreviations :l, :r, :c, :f, :t, :p, :o). Picks are combined with AND, e.g. [:left, :frontal]:

println(channel_pick(eeg; pick = [:left, :frontal]))
["Fp1", "F3", "F7"]

Region picks are based on the letters of the 10–20 labels (F, T, P, O, z) and laterality on odd (left) and even (right) electrode numbers.

Plugin

An external Julia file that adds functions to NeuroAnalyzer; plugins are installed with plugins_install() and loaded at startup. See Plugins.

Preferences

Persistent settings of NeuroAnalyzer: progress bars, verbose messages, colors and exclusion of bad channels. They are changed with set_progress_bar(), set_verbose(), set_colors(), set_exclude_bad_channels() or set_prefs() and stored between sessions. See Preferences.

Private function

A function whose name starts with _ (e.g. NeuroAnalyzer._band_power()). Private functions work on plain vectors and arrays and are used internally by the public functions that take NEURO objects; they are not exported, may change without notice, and are not intended for regular use.

Reference

The electrode (or combination of electrodes) against which potentials are measured. The current reference is stored in obj.header.recording[:reference]. A recording can be re-referenced, e.g. to the common average (reference_avg()), the auricular (reference_a()) or mastoid electrodes (reference_m()), a single electrode (reference_ce()), the surface Laplacian (reference_slap(), reference_plap()), a point at infinity (REST, reference_rest()) or a custom montage (reference_custom()).

Sampling rate

The number of samples recorded per second (Hz), returned by sr(). The Nyquist frequency, the highest frequency that can be represented, is half of the sampling rate.

println("sampling rate: ", sr(eeg), " Hz")
sampling rate: 256 Hz

Segment

A part of the signal given by its start and end time in seconds, e.g. seg = (10, 20), used by plotting functions and some editing functions.

Signal channel

A channel whose type matches the data type of the object, i.e. a channel carrying the measured brain signal:

  • EEG: "eeg" channels (e.g. "Fp1", "C3")
  • MEG: magnetometers ("mag") and gradiometers ("grad")
  • NIRS: NIRS channels (e.g. optical density, "nirs_od", or hemoglobin concentrations, "nirs_hbo", "nirs_hbr")

Reference ("ref"), EOG, ECG, EMG and marker channels are recorded with the signal but are not signal channels; some functions (e.g. average_epochs(), reference_avg()) use only signal channels.

Source estimate

The activity of each source of a source space over time: one value (scalar, e.g. dSPM) or three components (vector) per source and time point, the output of apply_inverse(); MNE-Python source estimates (.stc, .w) are loaded with import_stc() and saved with export_stc(). The sources are a subset of the vertices of the cortical surface: stc_surface() spreads their values to all vertices (smoothing over the surface, as MNE-Python, or nearest source) and plot_stc() plots them on the white, pial or inflated surface. Stored as a SOURCEESTIMATE object. See Minimum-norm estimates.

Source space

The candidate positions of the brain sources (dipoles): vertices of the cortical surface (source_space(), e.g. oct6 spacing), points of a volume grid inside the inner skull (source_space_volume()) or discrete points, with their orientations (normals of the cortex); loaded from MNE-Python with import_src(). Stored as a SOURCESPACE object. See Boundary element models.

Study

A group-level analysis of the recordings of several subjects, sessions and groups (design table with covariates), stored as a STUDY object: batch processing of all recordings, cached measures (ERPs, spectra, time-frequency power), grand averages and group statistics. See Study.

Surface

A triangulated mesh (vertices in mm and triangles) with optional per-vertex values (e.g. curvature, atlas labels, source estimates) in a coordinate frame, stored as a SURFACE object; loaded with import_surf() (FreeSurfer), import_inflated(), import_stl(), import_bst_surf() or import_ft_surf() and plotted with plot_surface().

Time points

The time of every sample of the recording, in seconds from the start, stored in obj.time_pts. After epoching, time points continue across epochs (they give the time of each sample in the original recording); see also epoch time.

Unit

The physical unit of a channel, stored in obj.header.recording[:unit], e.g. "μV" (EEG), "fT" (MEG magnetometers), "fT/cm" (MEG gradiometers), "μV/m²" (current source density), "μM/mm" (NIRS hemoglobin concentration), "m/s²" (accelerometer), "μS" (EDA). All available units are listed in the NeuroAnalyzer.channel_units variable.

Whitening

Conversion of the data and the lead field to units of the noise standard deviation with the noise covariance (whitener()), so that channels of different types and units (EEG, magnetometers, gradiometers) can be combined; the directions removed by projectors (SSP, EEG average reference) and Maxwell filtering are dropped (rank reduction).