Data Types

A feature of the Julia programming language is the strong type system. This package exploits that strength and defines various types for storing information about your neuroimaging data. A general hierarchy of neuroimaging types is provided.

A number of types are provided to handle different types of data. Functions are provided to perform common operations on each type. For example, the function channelnames would return the correct information when called on a general eeg recording or steady state response data type. Users should interact with types using function, and not address the underlying fields directly. This allows the underlying data type to be improved without breaking existing code. For example, do not address sensor.label, you should use label(sensor).

Types also exist for storing metadata. For example, electrodes are a sub type of the Sensor type. And the position of the sensors may be in the Talairach space, which is a subtype of the Coordinate type. This type hierarchy may be more than two levels deep. For example, the source type inherits from the optode type which inherits from the sensor type. All functions that operate on the top level type will also operate on lower level types, but not all functions that operate on low level types would operate on the top level. For example, the SSR type supports the function modulationrate() but the EEG type does not, as not all EEG measurements were obtained with a modulated stimulus.

A brief description of each type is provided below. See the following documentation sections for more details of each type, including examples and function APIs.

Supported Data Types

Measurement

This package provides for different neuroimaging techniques such as EEG and fNIRS. All of these types inherit from the top level abstract NeuroimagingMeasurement type.

Neuroimaging.NeuroimagingMeasurementType

Abstract type for storing Neuroimaing data.

All other neuroimaging types inherit from this type. All neuroimaing types support the following functions:

  • samplingrate()
  • channelnames()
  • remove_channel!()
  • keep_channel!()
  • trim_channel()
  • highpass_filter()
  • lowpass_filter()
  • data()
  • plot()

Examples

data = # load your neuroimaging data
samplingrate(data)  # Returns the sampling rate
channelnames(data)  # Returns the channel names
source

Within the NeuroimagingMeasurement type a sub type is provided for each supported imaging modality (e.g., EEG). Within each imaging modality, types are provided to represent the experimental paradigm used to collect the data (e.g., SSR or RestingStateEEG). Additionally a General type is provided for data that is collected using a paradigm not yet supported in Neuroimaging.jl (e.g., GeneralEEG). This hierarchical structure allows for specific features to be added to analysis procedures for specific experimental designs, while inheriting generic features and function from the parent types. For example, see the Auditory Steady State Response Example which uses the SSR type which is a sub type of EEG. In this example, we see that any EEG function to be run on SSR data, such as filtering or resampling, but also allows for application specific functions such as specific frequency analysis statistical tests.

Support for more types is welcomed

If you would like to add support for a different experimental paradigm by adding a sub type then please raise an issue on the GitHub page and we can work through it together. Some additional types that would be good to support are RestingStateEEG, P300, etc.

Neuroimaging.EEGType

Abstract type to represent Electroencephalography (EEG) data.

The following types inherit from the EEG type and can be used to process your data:

  • GeneralEEG: Used to store data without assumption of any experimental paradigm.
  • SSR: Used to store data acquired with a steady state response experiment paradigm.
  • TR: Used to store data acquired with a transient response experiment paradigm.

Examples

data = # load your EEG data using for example read_EEG()

samplingrate(data)  # Returns the sampling rate
channelnames(data)  # Returns the channel names
source
Neuroimaging.GeneralEEGType

Type for storing general EEG data without assumption of any experimental paradigm.

Examples

s = read_EEG(filename)
s = rereference(s, "Cz")
s = remove_channel!(s, "Cz")
source
Neuroimaging.SSRType

Type for storing data acquired with a steady state response (SSR) experimental paradigm.

In addition to the functions available for all EEG types, the SSR type supports:

  • modulationrate()

The following standard names are used when saving data to the processing dictionary.

  • Name: The identifier for the participant
  • Side: Side of stimulation
  • Carrier_Frequency: Carrier frequency of the stimulus
  • Amplitude: Amplitude of the stimulus
  • epochs: The epochs extracted from the recording
  • sweeps: The extracted sweeps from the recording

Example

Put an example here

s = read_SSR("filename")
s.modulationrate = 40.0391u"Hz"
s = rereference(s, "Cz")
source
Neuroimaging.TRType

Type for storing data acquired with a transient response (TR) experimental paradigm.

Example

Put an example here

s = read_TR("filename")
s = rereference(s, "Cz")
source

Sensor

Support is provided for the storing of sensor information via the Sensor type. As with the neuroimaging type, several sub types inherit from this top level type.

Neuroimaging.SensorType

Abstract type for storing neuroimaging sensors.

Other types inherit from the Sensor type. And common functions can be run on all sensors sub types. All sensors have a label and coordinate. Some sensors also store additional information. For example, fNIRS sensors may hold wavelength information.

All Sensor types support the following functions:

  • label()
  • labels()
  • x()
  • y()
  • z()
my_sensor = # Create a electrode, optode etc
label(my_sensor)  # Returns the sensor name
x(my_sensor)      # Returns the x coordinate of the sensor
source

Support is currently provided for EEG and fNIRS sensor types. Additional types are welcomed.

Coordinate

Support is provided for the storing of coordinate information via the Coordinate type.

Neuroimaging.CoordinateType

Abstract type for coordinates in three dimensions

All sub types have x, y, z coordinates. And conversion is available between subtypes using the convert function.

bv_coord = (0.3, 2, 3.1)
tal_coord = convert(Talairach, mni)
source

Specific coordinate systems available are.

Other

These types need to be better documented.

Neuroimaging.VolumeImageType

Volume Image

This composite type contains volume image information

Fields

  • data: contains the recorded data
  • x, y, z, t Arrays containing spatial and time information
  • method AbstractString of method used to compute tomography
  • info: additional information in dictionary

processing Fields

The following standard names are used when saving data to the info dictionary.

  • Regularisation: Regularisation used in tomography
  • NormalisationConstant: Value used to normalise image to maximum of 1
  • FileName: Name of file
source
Neuroimaging.DipoleType

Dipole type.

Parameters

  • coord_system: The coordinate system that the locations are stored in
  • x,y,z: Location of dipole
  • x,y,z/ori: Orientation of dipole
  • color: Color of dipole for plotting
  • state: State of dipol
  • size: size of dipole
source