10248
Comment:
|
9112
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Brainstorm's Suite for Invasive Neurophysiology = '''Note: '''In order to follow this tutorial, you need the latest version of Brainstorm (at least version 01-Nov-2018). |
= Brainstorm's Suite for Multi-unit Electrophysiology = |
Line 6: | Line 4: |
{{attachment:intro.png||width="700"}} | {{attachment:ephys_intro.png}} |
Line 8: | Line 6: |
<<TableOfContents(2,2)>> | <<TableOfContents(3,2)>> |
Line 13: | Line 11: |
Invasive electrophysiological recordings capture the spiking activity of individual or small groups of neurons. Since spiking events are transient phenomena (the typical duration of spikes is 1ms), the sampling rate of e-phys recording systems is typically much faster than for scalp EEG and MEG recordings. State-of-the-art acquisition systems can accommodate simultaneous recordings from hundreds of channels over several multi-electrode arrays positioned across the preparation. | Invasive electrophysiological recordings capture the spiking activity of individual or small groups of neurons. Since spiking events are transient phenomena (the typical duration of spikes is 1ms), the sampling rate of e-phys recording systems is typically much faster than for scalp EEG and MEG recordings. State-of-the-art acquisition systems can accommodate simultaneous recordings from hundreds of channels over several multi-electrode arrays positioned across the preparation, ultimately producing vast amounts of data. |
Line 19: | Line 17: |
All the function that will be described on this toolbox, are located in the ''Electrophysiology'' processes tab. | Note that the operations used here are not detailed, the goal of this tutorial is not to introduce Brainstorm to new users. For in-depth explanations of the interface and theoretical foundations, please refer to the [[http://neuroimage.usc.edu/brainstorm/Tutorials#Get_started|introduction tutorials]]. |
Line 21: | Line 19: |
Any toolboxes embedded represent the work of their respective authors and '''__need to be appropriately cited__'''. Links to the papers that the toolboxes correspond to are located on each section. | == How to cite == Researchers publishing results obtained with this electrophysiology toolbox are kindly asked to cite: |
Line 23: | Line 22: |
'''''__[[https://www.dropbox.com/s/dht96m1vzc6aybh/Tutorial%20e-Phys.rar?dl=0|Tutorial Dataset]]__''''' | * Nasiotis K, Cousineau M, Tadel F, Peyrache A, Leahy RM, Pack CC, Baillet S<<BR>> [[https://www.nature.com/articles/s41597-019-0242-z|Integrated open-source software for multiscale electrophysiology]]<<BR>>'''Scientific Data''', Oct 2019 * All the external toolboxes embedded in this pipeline as Brainstorm plugins. Links to the articles that the toolboxes correspond to are located in each section. |
Line 25: | Line 25: |
This tutorial uses a dataset collected from Nardin Nakhla in Dr. Christopher Pack’s lab (www.packlab.mcgill.ca), from a macaque monkey with a penetration chamber implanted in areas MT and MST. The recording probe consisted of 32 channels and 1 reference electrode. Users can download this tutorial data that will contain a converted Plexon acquisition system raw file (ytu288c-01.plx), an events file (this is a converted to Brainstorm events file that labels the experimental conditions appropriately), a channel positioning file and an anatomy folder (Floyd MRI) that can all be imported to Brainstorm. The task for the animal was to maintain fixation on a target while a superflow stimulus (dots that rotate, expand or translate in a partially coherent mode) was presented in one of 9 possible visual locations (as shown in the figure below). The events from the stimulation system are saved along with pre-spike-sorted events. | == Tutorial dataset == ==== Description ==== This tutorial uses a dataset collected by Nardin Nakhla in [[https://www.packlab.mcgill.ca/|Dr. Christopher Pack’s lab]], from a macaque monkey with a penetration chamber implanted in areas MT and MST. The recording probe consisted of 32 channels and 1 reference electrode. |
Line 27: | Line 29: |
{{attachment:stimulus.png||width="400"}} | The task for the animal was to maintain fixation on a target while a superflow stimulus (dots that rotate, expand or translate in a partially coherent mode) was presented in one of 9 possible visual locations (as shown in the figure below). The events from the stimulation system are saved along with pre-spike-sorted events. |
Line 29: | Line 31: |
== Importing raw e-phys data == {{attachment:importingRaw.png||width="700"}} |
. {{attachment:stimulus.gif}} |
Line 32: | Line 33: |
The importation of raw e-phys data into Brainstorm follows the same procedure as it does for any other raw recording. Users firstly assign a name for their protocol/study, followed by the name of the subject/monkey, and sequentially can review their raw file. | ==== Download the dataset ==== * Go to the [[http://neuroimage.usc.edu/bst/download.php|Download]] page of this website, and download the file: '''sample_ephys.zip''' * Unzip it in a folder that is not in any of the Brainstorm folders (program folder or database folder) |
Line 34: | Line 37: |
All these steps are briefly repeated here for the example e-Phys file for completeness. | ==== Files ==== * '''ytu288c-01.plx''': Raw recordings from a Plexon acquisition system * '''ytu288c-01_events.csv''': Events file, that labels the experimental conditions appropriately * '''floyd_t1.nii''': T1-weighted MRI scan of the monkey's head * '''floyd_cortex.mesh''': Cortex surface reconstructed from the MRI |
Line 36: | Line 43: |
'''''__Create Protocol__''''' | <<BR>><<BR>> |
Line 38: | Line 45: |
* When a new study needs to be analyzed, users have to create a new protocol: File -> New Protocol. * Give the Protocol name: ''Tutorial_e-Phys. '' * For the anatomy set it to: ''No, use individual anatomy. '' * Default Channel File: ''No, use one channel file per acquisition run.'' |
{{attachment:ephys_import.gif}} |
Line 43: | Line 47: |
{{attachment:newProtocol.png}} | == Create protocol == * Create a new protocol: File > New protocol. * Enter the protocol name: ''Tutorial_e-Phys. '' * Default anatomy: ''No, use individual anatomy. '' * Default channel file: ''No, use one channel file per acquisition run.''<<BR>><<BR>> {{attachment:newProtocol.png}} |
Line 45: | Line 53: |
Press create, and this will create the new protocol. | * Right-click on the top protocol node > '''New subject'''.<<BR>><<BR>> {{attachment:newSubject_new.gif}} * Enter the monkey name: '''Floyd''', and keep the other options unchanged.<<BR>><<BR>> {{attachment:FloydSubject.png}} |
Line 47: | Line 56: |
'''__''Add Subject''__''' | == Import anatomy (Optional) == Users can now import the anatomy of the monkey if needed. However, the pipeline described in this tutorial does not require an anatomical MRI, you may skip this section to save some time. |
Line 49: | Line 59: |
The next step will be to set the subject/monkey. Right click on the protocol created: Tutorial_e-Phys (subjects) and select New Subject (Make sure the Functional Data (sorted by subjects) tab is selected– select it under the Tutorial_e-Phys drop-down). | * Right-click on the subject folder > Import MRI: * Set the file format: All MRI files (subject space) * Select the file: sample_ephys/floyd_t1.nii * Set approximately the NAS/RPA/LPA fiducials, as described [[https://neuroimage.usc.edu/brainstorm/Tutorials/ImportAnatomy#Fiducial_points|here]] for humans. Save. * Right-click on the MRI > MRI segmentation > Generate head surface. Keep default options. * Right-click on the subject folder > Import surface: * Set the file format: All surface files * Select the file: floyd_cortex.mesh * Apply the same transformation: NO |
Line 51: | Line 69: |
{{attachment:newSubject.png}} | {{attachment:floyd_mri.gif||width="331",height="324"}} {{attachment:floyd_cortex.gif||width="328",height="259"}} |
Line 53: | Line 71: |
A new window will appear that allows users to set the Subject name and to choose the individual anatomy and default channel file. Choose no for both default anatomy and default channel file. | == Import recordings == * Go to ''Functional data'' side of the protocol. * Right-click on the Subject (Floyd) > ''Review raw file.'' * Set the file format: EEG:Plexon (*.plx;.pl2) * Select the file: sample_ephys/ytu288c-01.plx * {{attachment:reviewRaw_main_window.gif}} {{attachment:selectRaw_popup.gif}} * Once the procedure is complete, this will create a new folder ''(ytu288c-01)'' and two new files in the database: a channel file (''Plexon channels (33)'') and the ''Link to raw file''. These two files contain all the information from the header of the acquisition system. <<BR>><<BR>> {{attachment:importedRaw_main_window.gif}} |
Line 55: | Line 79: |
Use subject Name: ''Floyd'' | {{{#!wiki note Importing of this file might last a few minutes. Plexon .plx files cannot be accessed efficiently. In order to avoid waiting times while scrolling through the file, the .plx files are first converted into .bst files (Brainstorm binary format). This conversion causes the initial delay, but improves the user experience when reviewing the file. This is not typically the case for files for other acquisition systems. }}} Double-click on the Link to raw file to open the recordings viewer. This is a very easy way to inspect the recordings for artifacts or stimulation effects since only the selected part is loaded in memory on-the-fly, without importing anything in the database. Any events captured from the acquisition system are automatically loaded from the importer. |
Line 57: | Line 85: |
{{attachment:FloydSubject.png}} | {{attachment:displayRaw_new.gif}} |
Line 59: | Line 87: |
Once Save is selected, a new subject (Floyd) will be created in the database. '''''__Import MRI (Optional)__'''''Users can now import the MRI if needed. Instructions on how to import the MRI can be found [[https://neuroimage.usc.edu/brainstorm/Tutorials/ImportAnatomy|here]] and just use the Floyd MRI folder as the Freesurfer/anatomy folder. However, the analysis described on later steps (besides a few visualization functions) does not require an anatomical MRI. '''''__Add an Acquisition system File__''''' Raw files can be imported by selecting the acquisition system used, and sequentially selecting the raw file. Just right click on the Subject (Floyd) and then click on ''Review raw file.'' {{attachment:reviewRaw.png}} A new window will pop-up that allows users to select the acquisition system and the raw file. Select EEG:Plexon (*.plx) as the acquisition system and navigate to the folder the ytu288c-01.plx raw file is saved. {{attachment:selectRaw_new.png||width="400"}} Once the procedure is complete, this will create a new folder and two new files in the database: ytu288c-01_converted which is the name of the raw file, and one channel file (''Plexon channels (33)'') and the ''Link to raw file''. These two files contain all the information from the header of the acquisition system. It is important to note that no data (actual recordings) have been imported in Brainstorm yet. {{attachment:importedRaw_new.png}} By double clicking on the Link to raw file, a viewer will open that allows the user to navigate through the recordings. This is a very easy way to inspect the recordings for artifacts or stimulation effects since only the selected part is loaded in memory on-the-fly, without importing anything in the database. Any events capured from the acquisition system are automatically loaded from the importer. {{attachment:displayRaw_new.png||width="700"}} |
=== Existing spike sorter results === |
Line 83: | Line 90: |
“Spikes Channel ChannelLabel”, where ChannelLabel is the Label of the electrode assigned by the acquisition system. If the acquisition system assigned the spikes’ waveforms into more than one cluster/neuron during this automatic clustering, the neuronal events would be (e.g. for an electrode that picked up spikes from 3 neurons): “Spikes Channel ChannelLabel |1|”, “Spikes Channel ChannelLabel |2|”, “Spikes Channel ChannelLabel |3|”. | “Spikes Channel ''ChannelLabel''”, where ChannelLabel is the Label of the electrode assigned by the acquisition system. If the acquisition system assigned the spikes’ waveforms into more than one cluster/neuron during this automatic clustering, the neuronal events would be (e.g. for an electrode that picked up spikes from 3 neurons): “Spikes Channel ChannelLabel |1|”, “Spikes Channel ChannelLabel |2|”, “Spikes Channel ChannelLabel |3|”. |
Line 89: | Line 96: |
'''''__Add the electrode positions file (MRI should have already been imported on a previous step)__''''' | == Import events == In this tutorial dataset, the stimulus presentation events were coded from a software that was not triggering events on the acquisition system, so they need to be manually imported. |
Line 91: | Line 99: |
A modified channel-file has been included in the downloaded datasets, that contains the positioning of the electrodes on the cortical surface. Users can edit their own file by following the equivalent procedure that is featured on [[https://neuroimage.usc.edu/brainstorm/Tutorials/ChannelFile?highlight=%28locations%29#Edit_the_channel_file|this link]]. | * Double click on the Link to raw file to open the recordings. * In the Record tab, select the menu: File > Add events from file * Set file format: CSV text file: label, time, duration. * Select the file: sample_ephys/ytu288c-01_events.csv * {{attachment:select_events_new.gif}} * It adds 9 new types of events at the end of the events list (Stim On 1-9) that correspond to the screen location of the presented stimulus: <<BR>><<BR>> {{attachment:imported_events_new.gif}} |
Line 93: | Line 106: |
In order to load the modified channel file, users should: | At this stage, users can start performing their analysis based on the experimental events. |
Line 95: | Line 108: |
1. Import Floyd_channel.mat file in Matlab's wokspace | <<EmbedContent("http://neuroimage.usc.edu/bst/get_prevnext.php?next=e-phys/SpikeSorting")>> |
Line 97: | Line 110: |
{{attachment:imported_channels_file.png||width="500"}} 2. Import the struct Floyd_Channels into the channels entry on the datatree (Right click on Plexon channels (33) icon -> File -> Import From Matlab) {{attachment:imported_channels_Brainstorm.png}} This procedure will be update the positioning of the electrodes. Users can double-click on the Plexon channels (33) icon to display the relative positioning on the cortical surface (It requires the MRI to be already imported). {{attachment:channels_cortex.png||width="700"}} '''''__Add additional events__''''' In case users need to input events from a separate file, this can be easily done by clicking on the events panel: File -> Add events from file… Specifically for the Tutorial dataset, the stimulus presentation events were coded from a software that was not triggering events on the acquisition system, so they need to be manually imported. Users should first double click on the Link to raw file (this activates the Record tab) and then the events can be added by selecting the file: events_ytu288c-01_converted.mat {{attachment:import_events.png}} {{attachment:select_events.png}} This procedure will add 9 new types of events at the end of the events list: {{attachment:imported_events.png}} ---------- At this stage, users can start performing their analysis. This tutorial has covered all of the options that users will need to fully take advantage of the invasive Electrophysiogy toolbox (importing datasets, adding the animal's MRI, adding events and channel locations). Users that want to analyze their datasets without adding MRI scans and/or channel locations can skip those steps. <<EmbedContent("http://neuroimage.usc.edu/bst/get_prevnext.php?next=/e-phys/SpikeSorting")>> <<EmbedContent(http://neuroimage.usc.edu/bst/get_feedback.php?e-phys/Introduction)>> |
<<EmbedContent(http://neuroimage.usc.edu/bst/get_feedback.php?e-phys/SpikeSorting)>> |
Brainstorm's Suite for Multi-unit Electrophysiology
Author: Konstantinos Nasiotis
Contents
Introduction
We feature a series of data analysis tools specifically dedicated to Invasive electrophysiology research (e-phys). We see this suite of expanded Brainstorm features as an opportunity for enabling a methodological continuum between (multi)cellular and systems level (with EEG and MEG) data analytics and facilitate the scientific dialogue and interactions between subdisciplines in the field.
Invasive electrophysiological recordings capture the spiking activity of individual or small groups of neurons. Since spiking events are transient phenomena (the typical duration of spikes is 1ms), the sampling rate of e-phys recording systems is typically much faster than for scalp EEG and MEG recordings. State-of-the-art acquisition systems can accommodate simultaneous recordings from hundreds of channels over several multi-electrode arrays positioned across the preparation, ultimately producing vast amounts of data.
We foresee that Brainstorm will contribute to the efficient data management and processing when there is a need for efficient, open and reproducible data management and utilization of large quantities of data. Users that have Matlab’s parallel processing toolbox, will greatly benefit from the utilization of its properties. Most functions of the electrophysiology toolbox have a checkbox where users can enable parallelization of the processes.
Additionally, it is highly recommended for users that need to analyze large files, to select a large number for memory utilization on any processes that allow users to adjust the memory used, since the speed of the processes (especially the spike sorting procedures that use demultiplexing of the raw signal) can be greatly improved by the extra memory used.
Note that the operations used here are not detailed, the goal of this tutorial is not to introduce Brainstorm to new users. For in-depth explanations of the interface and theoretical foundations, please refer to the introduction tutorials.
How to cite
Researchers publishing results obtained with this electrophysiology toolbox are kindly asked to cite:
Nasiotis K, Cousineau M, Tadel F, Peyrache A, Leahy RM, Pack CC, Baillet S
Integrated open-source software for multiscale electrophysiology
Scientific Data, Oct 2019- All the external toolboxes embedded in this pipeline as Brainstorm plugins. Links to the articles that the toolboxes correspond to are located in each section.
Tutorial dataset
Description
This tutorial uses a dataset collected by Nardin Nakhla in Dr. Christopher Pack’s lab, from a macaque monkey with a penetration chamber implanted in areas MT and MST. The recording probe consisted of 32 channels and 1 reference electrode.
The task for the animal was to maintain fixation on a target while a superflow stimulus (dots that rotate, expand or translate in a partially coherent mode) was presented in one of 9 possible visual locations (as shown in the figure below). The events from the stimulation system are saved along with pre-spike-sorted events.
Download the dataset
Go to the Download page of this website, and download the file: sample_ephys.zip
- Unzip it in a folder that is not in any of the Brainstorm folders (program folder or database folder)
Files
ytu288c-01.plx: Raw recordings from a Plexon acquisition system
ytu288c-01_events.csv: Events file, that labels the experimental conditions appropriately
floyd_t1.nii: T1-weighted MRI scan of the monkey's head
floyd_cortex.mesh: Cortex surface reconstructed from the MRI
Create protocol
Create a new protocol: File > New protocol.
Enter the protocol name: Tutorial_e-Phys.
Default anatomy: No, use individual anatomy.
Default channel file: No, use one channel file per acquisition run.
Right-click on the top protocol node > New subject.
Enter the monkey name: Floyd, and keep the other options unchanged.
Import anatomy (Optional)
Users can now import the anatomy of the monkey if needed. However, the pipeline described in this tutorial does not require an anatomical MRI, you may skip this section to save some time.
Right-click on the subject folder > Import MRI:
- Set the file format: All MRI files (subject space)
- Select the file: sample_ephys/floyd_t1.nii
Set approximately the NAS/RPA/LPA fiducials, as described here for humans. Save.
Right-click on the MRI > MRI segmentation > Generate head surface. Keep default options.
Right-click on the subject folder > Import surface:
- Set the file format: All surface files
- Select the file: floyd_cortex.mesh
- Apply the same transformation: NO
Import recordings
Go to Functional data side of the protocol.
Right-click on the Subject (Floyd) > Review raw file.
Set the file format: EEG:Plexon (*.plx;.pl2)
- Select the file: sample_ephys/ytu288c-01.plx
Once the procedure is complete, this will create a new folder (ytu288c-01) and two new files in the database: a channel file (Plexon channels (33)) and the Link to raw file. These two files contain all the information from the header of the acquisition system.
Importing of this file might last a few minutes. Plexon .plx files cannot be accessed efficiently. In order to avoid waiting times while scrolling through the file, the .plx files are first converted into .bst files (Brainstorm binary format). This conversion causes the initial delay, but improves the user experience when reviewing the file. This is not typically the case for files for other acquisition systems.
Double-click on the Link to raw file to open the recordings viewer. This is a very easy way to inspect the recordings for artifacts or stimulation effects since only the selected part is loaded in memory on-the-fly, without importing anything in the database. Any events captured from the acquisition system are automatically loaded from the importer.
Existing spike sorter results
It is important to note that some acquisition systems might have enabled their own automatic spike sorter. These events are automatically labeled with the convention that is used throughout the e-phys toolbox:
“Spikes Channel ChannelLabel”, where ChannelLabel is the Label of the electrode assigned by the acquisition system. If the acquisition system assigned the spikes’ waveforms into more than one cluster/neuron during this automatic clustering, the neuronal events would be (e.g. for an electrode that picked up spikes from 3 neurons): “Spikes Channel ChannelLabel |1|”, “Spikes Channel ChannelLabel |2|”, “Spikes Channel ChannelLabel |3|”.
For more information, users can visit this page.
The events are comprised of the signals that the stimulation system has sent (Stim On, Start, Stop etc.) and the pre-spike-sorted events that the Plexon acquisition system can perform (Spikes Channel AD01, Spike Channel AD02 etc.).
Import events
In this tutorial dataset, the stimulus presentation events were coded from a software that was not triggering events on the acquisition system, so they need to be manually imported.
- Double click on the Link to raw file to open the recordings.
In the Record tab, select the menu: File > Add events from file
- Set file format: CSV text file: label, time, duration.
- Select the file: sample_ephys/ytu288c-01_events.csv
It adds 9 new types of events at the end of the events list (Stim On 1-9) that correspond to the screen location of the presented stimulus:
At this stage, users can start performing their analysis based on the experimental events.