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
Neuroimaging.Neuroimaging
— ModuleA Julia package for process neuroimaing data.
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.NeuroimagingMeasurement
— TypeAbstract 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
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.
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.EEG
— TypeAbstract 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
Neuroimaging.GeneralEEG
— TypeType 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")
Neuroimaging.SSR
— TypeType 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 participantSide
: Side of stimulationCarrier_Frequency
: Carrier frequency of the stimulusAmplitude
: Amplitude of the stimulusepochs
: The epochs extracted from the recordingsweeps
: The extracted sweeps from the recording
Example
Put an example here
s = read_SSR("filename")
s.modulationrate = 40.0391u"Hz"
s = rereference(s, "Cz")
Neuroimaging.TR
— TypeType for storing data acquired with a transient response (TR) experimental paradigm.
Example
Put an example here
s = read_TR("filename")
s = rereference(s, "Cz")
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.Sensor
— TypeAbstract 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
Support is currently provided for EEG and fNIRS sensor types. Additional types are welcomed.
Neuroimaging.Electrode
— TypeElectrode sensor type used in EEG measurements.
Neuroimaging.Optode
— TypeOptode abstract sensor type used in fNIRS measrurements.
Neuroimaging.Source
— TypeSource optode sensor type used in fNIRS measurements.
Neuroimaging.Detector
— TypeDetector optode sensor type used in fNIRS measurements.
Coordinate
Support is provided for the storing of coordinate information via the Coordinate
type.
Neuroimaging.Coordinate
— TypeAbstract 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)
Specific coordinate systems available are.
Neuroimaging.BrainVision
— TypeType for BrainVision coordinate system.
Neuroimaging.Talairach
— TypeType for Talairach coordinate system.
Neuroimaging.SPM
— TypeType for SPM coordinate system.
Neuroimaging.UnknownCoordinate
— TypeType to be used when the coordinate system is unknown.
Other
These types need to be better documented.
Neuroimaging.VolumeImage
— TypeVolume Image
This composite type contains volume image information
Fields
data
: contains the recorded datax
,y
,z
,t
Arrays containing spatial and time informationmethod
AbstractString of method used to compute tomographyinfo
: additional information in dictionary
processing
Fields
The following standard names are used when saving data to the info dictionary.
Regularisation
: Regularisation used in tomographyNormalisationConstant
: Value used to normalise image to maximum of 1FileName
: Name of file
Neuroimaging.Dipole
— TypeDipole 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