Misc NIRS preprocessings
The processes described here cover special use cases of NIRS experiments and are not linked one another. This tutorial uses the data files "sample_nirs.zip" and "Colin27_4NIRS.zip".
Template Colin27_4NIRS
The Colin27 template has been refactored specifically for NIRS data processing. It includes high and low resolution meshes for the head and for mid, pial ("white"), gyral ("cortex") cortical surfaces. Each of these surfaces are associated with precomputed interpolators to project data defined in the MRI volume. It is useful to resort to this template when one does not have the MRI but still wants to do tomographic analyses such as the computation of an optimal montage wrt a VOI. For source reconstruction, precomputed fluence volumes corresponding to this template have been precomputed and are hosted on a publicly available server.
To enable this template, put the file "Colin27_4NIRS.zip" into the brainstorm home folder, under the subdirectory "defaults/anatomy".
Set a predefined montage
The optode coordinates may not be the correct ones in the raw .nirs data file. Indeed, when planning the acquisition, only the optode pairings and coordinates in an arbitrary referential are available. Ideally, the optode positions are digitized and the optode coordinates are imported along with data (see Tutorial finger tapping). However, if no digitization device is available or if the experimenter assumes that all channels of all subjects can be aligned in the same referential, one can work in the template space and set the montage to a predefined one.
The process "NIRS > Set predefined montage" sets a predefined montage stored in <bst_home>/defaults/nirstorm/montages/ as the channel definition of the given data. All optode pairings must be consistent between the given data and the predefined montage.
Write process to save montage as default. Make sure to reset process options.
Export to .nirs file
The process "NIRS > Export to .nirs (HOMer format)" exports the given data to a user-defined directory in the HOMer data format. The output filename is a concatenation of the condition and item labels (with spaces and special chars replaced by "_"). For example the item "Subject01 |- S01_Block_FO_LH_Run01 | Motion-corrected" will be exported to: S01_Block_FO_LH_Run01_Motion-corrected.nirs
Import events from CSV table
Stimulation events may not have been transmitted via TTL signals that get recorded in the AUX channels. In this case, synchronization between event timings has to be performed externally. For example, the experimenter can manually note the starting time of the stimulations. Temporal imprecision of around half a second is still acceptable since hemodynamic fluctuations are quite slow. A common and easy way to store stimulation events is to use the Coma Separated Value (CSV) Format. For example, it can be produced by saving events collected by psychtoobox via the csvwrite matlab function. Expyriment automatically saves event data as XPD files which are CSV files with an extra header.
The process "Events > Import from CSV table file" can import such tabular data which is assumed to be organized as follows:
- column headers have to be defined ie the first row must be strings
- one trial by row
- one column indicates the label of the event
- one column indicates the starting time of the event
- one optional column can indicate the ending time or the duration
Here is an example of such table CSV file:
event_label, onset, duration audio, 1.5, 5 audio, 11, 5 visual, 20, 3 visual, 25, 3
Column headers are (1srt row): "event_label", "onset", "duration". There are 4 event trials (ie 4 rows) and 2 event types: "visual" and "audio" which are stored in the first column. The second column, labelled "onset" gives the starting times of the event. The third column labelled "duration" gives their durations. Here the time unit is in second but one can use its own unit and specify it during the importation. Lastly, let's assume that the paradigm started at t=13 sec. after the beginning of the NIRS recording, ie the first event was "audio" at t=14.5 sec.
With a basic text editor (notepad, gedit...), copy and save this example in a file called "paradigm.csv". Assuming the data in "sample_nirs.zip" has been imported (see NIRS finger tapping tutorial), drag and drop the item "Subject01 |- S01_Block_FO_LH_Run01 |- Link to raw file" in the process panel. Select the process "Events > Import from CSV table file" and fill the options as in the following picture. Note that the time origin has an offset of 13 sec.
Click on "Run". The process shows a summary of the events to import and ask for a confirmation:
Click on "yes" to actually import the event. To review the imported events, open the time-series (right-click on the item, "NIRS > Display Time series"). Specify the page settings as: Start=10, Duration=40 to better view all the imported events.
The events are imported and added to the previously existing one (here "MOTOR" and "NIRS_mvt").
As they are dummy values, **remove the imported events from the data (Events > Delete groups)**.
Project optodes on the scalp
Projecting the optodes on the scalp mesh can be done in order to:
- fix small coordinate errors (eg slightly inaccurate registration)
- ensure that each optode is assigned to a vertex of the scalp mesh.
This is useful when using a head model comprising optical data computed at each vertex of the scalp mesh.
To review the optode positioning relative to the scalp mesh, right-click on "Subject01 |- S01_Block_FO_LH_Run01 |- NIRS-BRS channels (97)" then select "Display sensors > NIRS (scalp)". In the surface option of the scalp mesh, select "Edge". Zooming on the montage shows that optodes are not placed on vertices of the scalp mesh.
Drag and drop the item "Subject01 |- S01_Block_FO_LH_Run01 |- Link to raw file" in the process panel and select the process "NIRS > project optodes on head mesh" and run it. This creates a new condition folder "01_Block_FO_LH_Run01_head_proj" with the new channel definition.
As done previously, plot the projected montage. The optodes are now placed on vertices of the head.
ORIGINAL PROJECTED
It is important to note that the **channel distances have changed**. To avoid too much displacements and inaccuracies in subsequent processings, it is advised to use a quite fine scalp mesh with a regular triangulation (see remeshing tools of brainstorm).