-
Notifications
You must be signed in to change notification settings - Fork 0
Import data & preprocessing
Data can be imported in the toolbox in many formats. Supported formats are:
If you store your spiking in a double (or sparse) Matrix, you can input it directly to the toolbox. This method is suitable for homogeneous trial that all have the same length. The spiking data matrix is expected to be three dimensional with dimension (nUnits x TrialL x nTrials), where:
- nUnits is the number of single units (or multi units) available in the dataset
- TrialL is the length of the trials. Being stored in 3d matrix all trials have to be the same length
- nTrials is the number of available trials in the dataset.
If this option is chosen, the toolbox will require additional arguments:
- time is a ( TrialL x 1 ) double vector of timestamps. It is mainly used in preprocessing and plotting and has to be the same length as the second dimension of D
- condition is a (nTrials x 1) string vector of trial labels. These are used to mask trials when only some conditions needs to be visualized or processed.
- area is a (nUnits x 1) string vector of unit labels and it used to aggregate units based on areas where they were recorded. Same as condition, this is used to to visualize or process a subset of units
D = spikingData: % input double data (nUnits x TrialL x nTrials)
T = trialTime; % Time vector (TrialL x 1)
C = trialLabels; % Condition labels (nTrials x 1)
A = areaLabels; % Area labels (nUnits x 1)
fs = samplingFrequency; % Sampling frequency (1 x 1)
NE = NeuralEmbedding(D,...
"fs", fs,...
"time",T,...
"area",A,...
"condition",C);If you store your spiking data in a cell-array, you can input it directly to the toolbox. This method is suitable for inhomogeneous trials that all have different lengths. The cell array is expected to have one cell per trial, hence being nTrials long. Each cell is expected to contain a double (or sparse) 2D spiking data matrix with dimension (nUnits x TrialL).
If this option is chosen, the toolbox will require additional arguments:
- time is a ( nTrials x 1 ) cell-array each containing a (TrialL x 1) double vector of timestamps. It is mainly used in preprocessing and plotting and has to be the same length as the second dimension of D
- condition is a (nTrials x 1) string vector of trial labels. These are used to mask trials when only some conditions needs to be visualized or processed.
- area is a (nUnits x 1) string vector of unit labels and it used to aggregate units based on areas where they were recorded. Same as condition, this is used to to visualize or process a subset of units
D = spikingData: % input data, cells (nTrials x 1) of (nUnits x TrialL)
T = trialTimes; % Time vector, cells (nTrials x 1) of (TrialL x 1)
C = trialLabels; % Condition labels (nTrials x 1)
A = areaLabels; % Area labels (nUnits x 1)
fs = samplingFrequency; % Sampling frequency (1 x 1)
NE = NeuralEmbedding(D,...
"fs",fs,...
"time",T,...
"area",A,...
"condition",C);If you store your spiking data in a field of a struct-array, you can input it directly to the toolbox. This method is suitable for inhomogeneous trials that all have different lengths. The struct-array is expected to have one cell per trial, hence being nTrials long, and can store additional information about the data in the struct itself. If everything is provided this way, you wont need additional arguments. If you forget something, the toolbox will remind you (and get angry). Each element of the array is expected to have the following fields:
- data, (nUnits x TrialL) double or sparse spiking data
- time, (TrialL x 1) double array of timestamps for the trial
- area, (nUnits x 1) string array of unit label
- condition, (1 x 1) trial label string scalar
With everything properly configured, initializing the toolbox is as simple as
NE = NeuralEmbedding(D,...
"fs",fs);