NIRSTORM: a Brainstorm extension dedicated to functional Near Infrared Spectroscopy (fNIRS) data analysis, advanced 3D reconstructions, and optimal probe design. Authors: Édouard Delaire, Lea Larreur, Dr. Christophe Grova This tutorial aims to introduce NIRSTORM. NISTORM is a plug-in dedicated to the analysis of functional near-infrared spectroscopy (fNIRS) data inside the Brainstorm software. This tutorial covers three main features of the NIRSTORM package: (1) Data importation and preprocessing, (2) Data analysis at the channel level, and (3) Data analysis on the cortex after 3D reconstruction. This tutorial assumes that you are already familiar with the Brainstorm environment. If this is not the case, we recommend following Brainstorm tutorials 1 to 23. Introduction The acquisition protocol and the general workflow presented in this tutorial from fNIRS optimal montage design to 3D reconstruction is described in further detail in Cai et al, 2021. * We are considering fNIRS data acquired on one healthy subject, featuring one run of 19 minutes acquired with a sampling rate of 10Hz on a CW fNIRS Brainsight device (Rogue-Research Inc., Montreal, Canada)
- Finger tapping task of the left hand: 20 blocks of 10 seconds of finger tapping task each, with a rest period of 30 to 60 seconds.
- Personalized optimal montage targeting the wight motor knob, featuring 3 dual wavelength sources, 15 detectors, and 1 proximity detector.
- 2 wavelengths: 685nm and 830nm
3T high-resolution anatomical MRI data processed using FreeSurfer 5.3.0. (https://surfer.nmr.mgh.harvard.edu)
Img:Img1 Using the Brainstorm plug-in system, download the following plugins : * NIRS > NIRSTORM : the core of NIRSTORM package
NIRS > MCXLAB-cl : a plugin for the estimation of the fNIRS forward model using Monte Carlo simulations of infrared light photons in the anatomical head model
Inverse > Brainentropy: our package dedicated to solving the fNIRS reconstruction inverse problem using the Maximum Entropy on the Mean framework
The total disk space required after data download and installation is ~1.3Go. The size is quite large because of the optical data that are required for the computation of the forward model. The dataset can be downloaded from: https://osf.io/md54y/?view_only=0d8ad17d1e1449b5ad36864eeb3424ed . License: This tutorial dataset (fNIRS and MRI data) remains proprietary of the MultiFunkIm Laboratory of Dr Grova, at Concordia School of Health, Concordia University, Montreal. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is prohibited without written consent from our group. For questions please contact Dr. Christophe Grova: christophe.grova@concordia.ca The data are organized using the following scheme according to BIDS standards: Img:Img2 * Start Brainstorm (Matlab scripts or stand-alone version)
Select the menu File > Create new protocol. Name it "TutorialNIRS" and select the options:
"No, use individual anatomy",
"No, use one channel file per acquisition run (MEG/EEG)".
In terms of sensor configuration, fNIRS is similar to EEG and the placement of optodes may be subject-specific. Also, the channel definition will change during data processing, this is the reason why you should always use one channel file per acquisition run, even if the optode placement remains the same.
Following tutorials 1-2, import the subject anatomy segmented using freesurfer using the following fiducials coordinate in MRI coordinate: * Switch to the "anatomy" view of the protocol.
Right-click on the TutorialNIRS folder > New subject > sub-01
- Leave the default options you set for the protocol
Right-click on the subject node > Import anatomy folder:
- Set the file format: "Freesurfer + volumes atlases"
Select the folder: nirstorm_tutorial_2024/derivatives/FreeSurfer/sub-01
- Number of vertices of the cortex surface: 15000 (default value)
- Answer "yes" when asked to apply the transformation.
Set the 3 required fiducial points, indicated below in (x,y,z) MRI coordinates. You can right-click on the MRI viewer > Edit fiducial positions > MRI coordinates, and copy-paste the following coordinates in the corresponding fields. Click [Save] when done.
Nas : [ 131, 213, 117 ] Lpa : [ 51, 116, 80 ] Rpa : [ 208, 117, 86 ] Ac : [ 131, 128, 130 ] Pc : [ 129, 103, 124 ] Ih : [ 133, 135, 176 ] * Once the anatomy is imported, make sure that the surface "mid_15002V" is selected (green). If it is not, right-click on it and select "set as default cortex". This will define the cortical surface on which fNIRS 3D reconstructions will be estimated.
- Resample the head mask to get a uniform mesh on the head. For that, right-click on the head mask and select remesh, then 10242 vertices. This allows us to get a uniform mesh on the head.
Your database should look like this: Img:Img3 Note that the elements that appear in green correspond to those used for later computations. It is important that the new head mask (remeshed) and the mid-surface (mid_15002V) are selected and appear green in your database. Additionally, we defined the hand-knob on the mid-surface. Open the mid surface, and use Atlas > Add scouts to Atlas and select the FreeSurfer annotation:
NIRSTORM-data/derivatives/segmentation/sub-01/scout_hand.annot The Brainsight acquisition software produced the functional fNIRS data used in this tutorial and is available in the data subfolder of the fNIRS sample folder(nirstorm_tutorial_2024/sub-01/nirs). The data were exported according to the BIDS format: See https://bids-specification.readthedocs.io/en/stable/modality-specific-files/near-infrared-spectroscopy.html for a description of each file. To import this dataset in Brainstorm: * Go to the "functional data" view of the protocol.
· Right-click on Subject01 > Review raw fileo Select file type NIRS: SNIRF (.snirf) * Select file nirstorm_tutorial_2024/sub-01/nirs/sub-01_task-tapping_run-01.snirf
Img:Img4
In the same way as in the tutorial "Channel file / MEG-MRI coregistration", the registration between the MRI and the fNIRS is first based on the identification of three anatomical reference points identified in the MRI data and digitized together with the location of all sensors: the Nasion, Left and Right ears. First, a rigid registration matrix (3 rotations, 3 translations) is estimated by aligning these three fiducials. Registration should then be refined either using additional head points (e.g. sensor locations or full digitalization of the head shape of the participant) or eventually using manual adjustment. We recommend using additional headpoints to refine the spatial registration.1. The initial registration is based on the three fiducial points that define the Subject Coordinate System (SCS): nasion (NAS), left ear (LPA), right ear (RPA). The visual identification of these three anatomicallandmarks on the anatomical MRI has been completed using the MRI viewer in the previous section. 1. Once sensors or the cap have been installed on the head of the participant, these same three fiducial points have also been digitized on the head of the participant before fNIRS acquisition, together with the location of all other sensors (fNIRS sources, detectors, and eventually EEG electrodes), once sensors have been installed. We recommend using a tracking system to digitize the position of the 3 anatomical landmarks and sensor locations using a 3D tracking device (e.g. Polhemus or Brainsight neuronavigation system considered here). The positions of these points are saved in the fNIRS datasets (see fiducials.txt).
- When the fNIRS recordings are loaded into the Brainstorm database, they are aligned on the anatomical MRI data using these anatomical landmark points: the NAS/LPA/RPA points digitized with Brainsight are matched with the ones we placed in the MRI Viewer.
To review the accuracy of fNIRS/MRI coregistration: · Right-click on NIRS-BRS sensors (97) > Display sensors > NIRS (pairs). This will display sources as red spheres and detectors as green spheres. Source/detector pairings are displayed as blue cylindrical lines. · Right-click on NIRS-BRS sensors (97) > Display sensors > NIRS (scalp). This will display sources as red spheres and detectors as green spheres · To check the coregistration, Right-click on NIRS-BRS sensors (97) > MRI registration > check. For more information about the coregistration accuracy and how to refine the coregistration, please consult "Channel file / MEG-MRI coregistration" Select "sub-01 |- sub-01_task-tapping_run-01 |- Link to raw file -> NIRS -> Display time series". It will open a new figure with superimposed time courses of all fNIRS channels. Img:Img5 If coloring is not visible, then right-click on the figure the select "Montage > NIRS Overlay". Indeed, brainstorm uses a dynamical montage, called NIRS Overlay, to regroup and color-code fNIRS time series depending on their wavelength (red: 830nm, green:686nm). Therefore, when clicking to select one curve for one wavelength, NIRSTORM will also select the other wavelength for the same pair. In this dataset, the events are directly encoded in the .snirf file and automatically imported by Brainstorm. In case your events are not encoded in your nirs file, you can import them manually (either from a specific channel, or external file). For more information, please consult https://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers The events describing the task are currently extended events (having onset + duration).To facilitate trial averaging latter, it is recommended that you duplicate the events linked to your task and convert them to simple events using the start of each trial. Therefore, for this tutorial, duplicate the event 'tapping', convert it to simple, and rename it tapping/start. This section introduces the process of estimating the hemodynamic response to a finger-tapping task at the channel level. This figure illustrates the full pipeline proposed in this tutorial, which will be described in further detail next. Img:Img6 Pre-processing functions can be applied to fNIRS data files by adding the "Link to raw" file to the processing box or dragging and dropping it onto the box. Once it is in place, click on the "Run" button to execute the process. At this stage, both Brainstorm and NIRSTORM specific processes (present under the nirs submenu), can be applied without any distinction to the nirs files. · NIRS > Pre-process > Detect Bad channels Img:Img7 The Detect Bad Channels process aims at labeling each channel as good or bad based on a set of criteria: • Negative value: Channel with negative values • Scalp coupling index (SCI): SCI reflects the signal's correlation for each wavelength within the cardiac band (add ref). Power reflects the % of the power of the signal within the cardiac band. This process removes channels featuring Low SCI or low power within the cardiac band.• Coefficient of variation (CV): reflects the dispersion of data points around the mean, defined as …. This process removes channels featuring high CV.• Saturating channels: Detect and remove channels showing saturation (how is this done) • Source-Detector separation: This process removes the channels outside the acceptable source-detector distance range. By default, if a wavelength of a channel is considered as bad, then the entire channel, i.e. signals from both wavelengths, is discarded. To not automatically label as bad the other wavelength, then select “keep unpaired channel”. Additionally, the process proposes to either keep or remove auxiliary channels (non nirs channel). Keep the auxiliary channels if your nirs system also recorded some peripherical measurement (heart rate, respiration …). In our case, there is no information in the auxiliary channel so we can discard them. · Raw to delta OD Img:Img8 This function converts the light intensity to variations of optical density. • Process: nirs > dOD and MBLL > Raw to delta OD• Description: Convert the fNIRS data from raw to delta OD Channels with negative values must have been removed (see bad channel detection section), before applying this log transformation. Parameter: Baseline window to estimate the baseline intensity • Motion correction Img:Img8b • Process: nirs > pre-process > motion correction• Input: Raw data, delta OD, or delta Hb• Description: Apply a motion correction algorithm to the data. Two algorithms are implemented: (1) Spline correction (2) Temporal derivative distribution repair (TDDR)
Spline correction: After selecting motion visually on the fNIRS signal viewer, spline interpolation is used to smooth the signal during motion.
Parameter: Movement event name: Name used to visually identify the motion Smoothing parameter: Value between 0 and 1 controlling the level of smoothness desired during the motion Temporal derivative distribution repair: automatic motion correction algorithm that relies on the assumption that motion will introduce outliers in the temporal derivative of the optical density. In this tutorial, we will be using Temporal derivative distribution repair. Band-pass filterImg:Img8 • Process: pre-process > band-pass filter• Input: delta OD, or delta Hb• Description: Apply a finite impulse response (FIR) filter to the data. If you want to use an infinite impulse response filter (IIR), use the process from NIRS > pre-process > band-pass filter• Parameters: • Sensor type: apply the FIR only to selected channels (useful if storing additional data in the auxiliary channels such as accelerometer, blood pressure …)• Lower-cutoff / Upper-Cutoff: Cuttoff frequencies for the filter • Transition band: Error margin for the filter before/after the cutoff. Warning: it is important to specify this parameter for fNIRS data. Use the View filter response button to ensure that the design filter corresponds to what you desire. • Stopband attenuation: Gain of the filter outside of the transition band. We recommend using 40 dB.• Filter version: Version of the brainstorm implementation of the filter (We recommend to use the 2019 version)For more information about the filtering, see tutorial 3. Note: we recommend always checking that the filter used corresponds to your expectation using the ‘View filter response button” Img:Img9 Regressing out superficial noise Img:Img10 • NIRS > Pre-process > Remove superficial noise' This process consists of regressing out superficial noise using the mean of all the channel identified as short-separation channels, following the methodology proposed in Delaire et al, 2024 Parameters: • Method to select short-channel: (1) based on Name: manually specify the name of the short-channels (eg. S1D17, S2D17…) (2) based on Source-Detector distance: use the Source-Detector distance to detect short-separation channels. • (if 1) Superficial channels: list of short separation channels• (if 2) Separation threshold: maximum Source-Detector distance to be considered as short-channel • Baseline: Segment of the baseline signal that is considered to calibrate the superficial noise removal procedure. Select a window relatively free of motion. This is mainly useful for long-duration recordings, or when a part of your signal is heavily corrupted with motion. The objective is to analyze the response produced by the motor paradigm. The following section presents how to analyze an fNIRS-elicited hemodynamic response by averaging single trials, therefore it corresponds to tutorials 15 and 16, presenting how to analyze a bioelectrical evoked response using EEG/MEG. We recommend the reader to consult those two tutorials for further details. To estimate the hemodynamic response produced by the motor paradigm, we will extract epoch data locked on the motor paradigm starting 10s before the task and ending 30s after the beginning of the paradigm. Use the import in database tool with the following parameters. Img:Img11 The Epoch time should range from -10s to 30s (i.e. -10,000 ms to 30,000 ms). This means that we will extract data segments 10 seconds before the stimulation event to check for signal stability, and 30 seconds after stimulation to observe the return to baseline of the hemodynamic response.Remove DC offset will: * Compute the average of each channel over the baseline (pre-stimulus interval: [-10 000, 0]ms) If you are expecting a response to start before the time 0; make sure to set the pre-stimulus interval accordingly to not contains the start of the response. Add a little description and where do we define those thresholds ? Authors: Édouard Delaire, Lea Larreur, Dr. Christophe Grova This tutorial aims to introduce NIRSTORM. NISTORM is a plug-in dedicated to the analysis of functional near-infrared spectroscopy (fNIRS) data inside the Brainstorm software. This tutorial covers three main features of the NIRSTORM package: (1) Data importation and preprocessing (2) Data analysis at the channel level (3) Data analysis on the cortex after 3D reconstruction. This tutorial assumes that you are already familiar with the Brainstorm environment. If this is not the case, we recommend following Brainstorm tutorials 1 to 23. Contents NIRSTORM: a Brainstorm extension dedicated to functional Near Infrared Spectroscopy (fNIRS) data analysis, advanced 3D reconstructions, and optimal probe design.