Hi, this is my first post. I need some help trying to run Spike Field Coherence. I think I was successful in importing a .mat file with the spike time stamps following the conventions outlined in this tutorial (https://neuroimage.usc.edu/brainstorm/e-phys/ConvertToBrainstormEvents) (See attached screenshot #1). And then importing as “Brainstorm .mat”. The spikes show up as events, as intended. Some ephys functions work, like obtaining a PSTH, or the raster plot. But I cannot get Spike Field Coherence to work. I keep getting this error “The time-selection must be around the spikes” (see Screenshot #2, filename has been redacted). I have selected multiple time windows, all with multiple spike events in a second (around 3 to 5 per second), and it doesn’t recognize them. Does it have something to do with how I am importing the spike events?
Is there a minimum of spikes/second that this function needs?
I was definitely not doing that. I didn’t know that’s how it worked. I run Spike Field Coherence on all the epochs around the spikes as you said. I got 870 Epochs. When I try to run it over the folder of 870 Epochs, I get this error.
***************************************************************************
** Error: \[process_spike_field_coherence\] Electrophysiology > Spike field coherence
** 255: Dot indexing is not supported for variables of this type.
**
** stack:
** >process_spike_field_coherence.m>get_FFTs at 255
** >process_spike_field_coherence.m>Run at 126
** >process_spike_field_coherence.m at 31
** >bst_process.m>Run at 236
** >bst_process.m at 38
** >panel_process1.m>RunProcess at 138
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 781
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 301
**
**
***************************************************************************
When I try to run it over a single epoch, I get a very similar message.
***************************************************************************
** Error: \[process_spike_field_coherence\] Electrophysiology > Spike field coherence
** Line 255: Dot indexing is not supported for variables of this type.
**
** Call stack:
** >process_spike_field_coherence.m>get_FFTs at 255
** >process_spike_field_coherence.m>Run at 126
** >process_spike_field_coherence.m at 31
** >bst_process.m>Run at 236
** >bst_process.m at 38
** >panel_process1.m>RunProcess at 138
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 781
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 301
**
**
***************************************************************************
Do you know by any chance what is this dot indexing and how do I change that about my epochs?
Did you happen to follow the provided tutorials on electrophysiology?
By following those with the provide data it is possible to see how to use the e-phy functions in Brainstorm.
Regarding the error, it suggests there is a problem with structure that contains the imported Epoch data. This is likely to have its origin in the step where the events where added.
Can you share the following?
A screenshot of the database (tree) in the Brainstorm GUI
The structure of the events in the imported epochs. For one of the imported epochs:
Right-click on it, then File > Copy filepath to clipboard
In Matlab run the command DataMat = in_bst_data('COPIEDPATH');
In Matlab run the following commands and share the results:
Thank you so much, sorry for the delay. Yes I followed the tutorial. Everything has been imported using Brainstorm tools, except the Spike events, but I followed the importing instructions following this tutorial (https://neuroimage.usc.edu/brainstorm/e-phys/ConvertToBrainstormEvents).
Regarding this, when I import into the database from raw, I use the spike events to create the Epochs (as indicated by your last coment), the spike event becomes (0.0s), and I have no events, DataMat.Events is empty. Thus, it shows me this:
DataMat = in_bst_data('/media/raul/BrainstormDB/brainstorm_db/data/SubjectJW/TI_Session_band/data_Spikes_Channel_1__1__trial001.mat');
>> DataMat.Events
length(DataMat.Events)
{trial.Events.label}
ans =
[ ]
ans =
0
Unable to resolve the name 'trial.Events.label'.
But, I do have other epochs with spike events, so that we can see their Event Structure.
Apologies for the misdirection. Importing the epochs around the spike events ('Spikes Channel 1 |1|') will not be useful to compute the spike field coherence. You need to import either either with condition markers (or a time segment of your data), then the imported epochs (or 1 epoch in case of importing a time segment) will have the spike events.
What happens when you run the SFC on the imported (4mA_5Hz_global) files?
For you channel names, is there a channel just label as 1?
Asking as the event name suggest that label: 'Spikes Channel 1 |1|'
No, I have no Channel 1, I just used Channel 1 as a place holder. Does the actual channel name matter?, should I import it with a name of a channel that actually exist? (In my case for example, Channel B’1?)
Yes, it has to be the name of a channel present in the data.
Ideally the channel where the spikes where found, so when coherence is computed is between the LFP of that channel, and the LFP of all the other channels.