NIRSTORM: Optimizing fNIRS montage
Author: NIRSTORM team
This tutorial explains how to use Optimal Montage in NIRSTORM optimizing the fNIRS montage sensitivity to target specific regions of interest along the cortical surface.
Citation
If you are using the optimal montage within NIRSTORM, please cite the following articles:
- NIRSTORM:
- Delaire, Édouard, et al. “NIRSTORM: a Brainstorm extension dedicated to functional Near Infrared Spectroscopy (fNIRS) data analysis, advanced 3D reconstructions, and optimal probe design.” bioRxiv (2024): 2024-09. (Neurophotonics, under revision)
- Optimal montage:
- Machado, Alexis, et al. "Optimal optode montage on electroencephalography/functional near-infrared spectroscopy caps dedicated to study epileptic discharges." Journal of biomedical optics 19.2 (2014): 026010-026010.
- Machado, Alexis, et al. "Optimal positioning of optodes on the scalp for personalized functional near-infrared spectroscopy investigations." Journal of neuroscience methods 309 (2018): 91-108.’
- Fluence estimation:
- Fang Q, Boas DA. Monte Carlo Simulation of Photon Migration in 3D Turbid Media Accelerated by Graphics Processing Units. Opt Express. 2009;17(22):20178. doi:10.1364/oe.17.020178
Contents
- Introduction
- Estimation of the fnirs optimal montage for one selected region
- Computing an optimal montage for multiple regions
- Creating an optimal montage for EEG-FNIRS
- Creating an optimal montage for using a fNIRS cap
-
Personalized optimal montage
- Importing the subject anatomy
- Definition of FluenceRegion and FluenceExclude
- Estimating the subject tissue segmentation
- Estimating the Voronoi volume-to-cortex interpolator
- Projecting a volume onto the cortical surface
- Estimating the fluences for every vertex in the search space using MCXlab
- Computing the optimal montage
- Reference
Introduction
Setup
- NIRSTORM:
- Using the Brainstorm plug-in system, download the following plugins:
Plugin>fNIRS > NIRSTORM > install (download the core of NIRSTORM package)
- CPLEX:
- CPLEX is a set of tools to perform functional optimization edited by IBM. It is used here to solve the integer programming problem during the optimal montage computation. For license concerns, we cannot bundle the CPLEX library within NIRSTORM.
- Students or academics can download a free copy of CPLEX.
- To download CPLEX:
Visit http://ibm.biz/CPLEXonAI and create an account using your institutional email
- Once logged in, scroll down and click on “software” and then select “ILOG CPLEX Optimization Studio”. Click “download”. A new page will open
- In the search options, select text, and write: "IBM ILOG CPLEX Optimization Studio V12.10 Multiplatform Multilingual eAssembly"
Download "IBM ILOG CPLEX Optimization Studio V12.10 for X Multiplatform Multilingual". Replace X with your operating system (e.g. Windows, Linux, MacOs)
Installation of CPlEX
For macOS, install CPLEX using the download installer. For Linux/Windows, unzip the downloaded file in your Documents folder.
Finally, add the path to the CPLEX Matlab folder to the Matlab path:
- In MATLAB, go to the "Home" tab
- Click "Set path" (yellow folder icon)
- Click on "Add with subfolders" and select the folder of the CPLEX Matlab bindings. (For example: "/Applications/CPLEX_Studio1210/cplex/matlab/x86-64_osx")
Note: In Mac, this folder is in your application folder.
Note: If you use a Mac with the Apple Silicon chip (M1 or newer), we recommend using a version of Matlab older than 2023b. This tutorial was tested on Matlab 2021b.
Theoretical introduction to the concept of fNIRS optimal montage
The optimal montage consists of finding the position of the fNIRS optodes on the skin, specifically, pairs of light sources and detectors that will maximize the light sensitivity of the created montage to a predefined targeted region of interest (ROI) on the cortex while respecting a set of user-defined constraints. The region of interest can be defined manually using a priori knowledge, for instance using an anatomical atlas, or using a localization obtained from other modalities (e.g. MEG or EEG source, fMRI response).
To launch the optimal montage tool the user will need to provide the following data:
Anatomical information about the subject to simulate the propagation of the infrared light (also known as fluences) into a realistic head model and estimate the montage sensitivity along the cortex. For the template Colin27 considered in this tutorial, the Fluences have been pre-computed and are automatically downloaded if needed
The targeted region of interest on the cortex: This is a set of vertices on the cortex indicating the region that you want to target when installing fNIRS sensors.
The optode’s possible locations on the skin: this is the set of vertices on the cortex that can be considered for the placement of the optodes. When using a cap, one can use the predefined possible positions on the cap or any set of vertices along the skin surface.
A set of spatial constraints: Several geometrical or functional constraints can be considered to optimize the fNIRS montage, including notably, the number of sources and detectors, the range of distances between two optodes, and the minimum source-detector distance. We also allow the user to specify an ‘Adjacency constraint’ which is the minimum of channels formed by each source, therefore a higher adjacency number will ensure more spatial overlap between fNIRS sensors, which is required for 3D reconstruction.
First of all, to estimate an fNIRS optimal montage targeting a specific region of interest, one needs to estimate the light propagation pattern for every possible optodes location. Those light propagation patterns, also called fluences, can be estimated using MCXlab. MCXlab1 works by simulating the propagation of millions of photons based on the subject tissue segmentation. The fluences have been pre-computed for the template Colin27 (Consult section on “Personalized optimal montage” to see how to compute the fluences). Then, for every pair of sources and detectors within our search space (e.g. skin vertices, predefined positions on a cap), the sensitivity of the created channel to the underlying region of interest is estimated and stored in a matrix called the ‘weight table’.
Then the optimal montage is found by solving a mixed linear integer problem given specific functional constraints. The optimization problem is formulated as a mixed linear integer programming problem under functional constraints, which is solved in NIRSTORM using IBM ILOG CPLEX Optimization toolbox [2]
For more mathematical details about optimal montage, consult references [3–5]
Preamble
- Start Brainstorm (Matlab scripts or stand-alone version)
Select the menu File > Create new protocol.
Name it "TutorialOptimalMontage" and select the options:
- "No, use individual anatomy",
- "No, use one channel file per acquisition run (MEG/EEG)".
- Switch to the "anatomy" view of the protocol.
Right-click on the TutorialOptimalMontage folder > New subject > Subject01
Right-click on Subject01> Use template > MNI > Download: Colin24_4NIRS_2024
In this tutorial, we are going to design an fNIRS optimal montage targeting a specific ROI, using Colin27 template as our underlying model of the subject anatomy. The exact same procedure can be applied to a subject’s specific MRI in case you would need to define an optimal montage specifically for every subject[6]. For that, refer to the section ‘(advanced) Personalized optimal montage’.
Estimation of the fnirs optimal montage for one selected region
Defining the target region along the cortical surface
To create the target ROI along the cortex used for optimal montage, NIRSTORM relies on the Brainstorm concept of scouts. In Brainstorm jargon, a scout represents a region of interest (ROI) in the available cortex. To learn more on how to create a scout, please consult: https://neuroimage.usc.edu/brainstorm/Tutorials/Scouts
The targeted ROI or scout can be manually drawn along the cortical surface, estimated from the analysis of another modality (e.g. EEG or MEG source), or defined using an anatomical atlas. If your preprocessing of anatomical MRI data was done using Freesurfer, you will have access to several anatomical Atlas in Brainstorm (for instance Destrieux, Desikan-Killiany) The ‘user scouts’ atlas corresponds to the user-defined regions of interests.
In this tutorial, we propose to target a right fronto-polar region denoted G_and_S_transv_frontpol R from the Destrieux atlas.
Computation of the fNIRS optimal montage
Click on run, and then open the process: nirs > sources > compute optimal montage. Set the subject name to ‘Subject01’ and click on Edit.
The following panel to enter the option for optimal montage then appears :
- From the left panel:
- Choose the appropriate atlas to define the targeted ROI: ‘Desitrieux’ (in case you would like to use a manually defined ROI, you should select ‘user scouts’) then select the targeted region ‘G_and_S_transv_frontpol R’
- Keep the search space as default, and keep the extent of scalp projection to 4cm. This will use all the vertices of the skin surface within a radius of 4 cm around the ROI.
- From the right panel:
- Define your montage constraints. In this tutorial, we will keep the default values: 3 sources, 7 detectors, and 7 adjacency numbers, to generate a locally dense montage. For the adjacency number, we recommend the user to estimate and compute montage for different adjacency numbers and evaluate each montage based on the sensitivity, coverage of the ROI, and practicality of the montage setup.
- Specify the path to the fluences, and wavelength used. If you are using Colin27 template, keep the parameter as default to download the precomputed fluences.
- Specify an output condition name. This is the name that will appear in your brainstorm database. We recommend to name it ‘OM_{target_region}_{source}S_{detector}D_{adjacency}A. For example here: OM_ G_and_S_transv_frontpol_R_7S_7D_7A. This will allow you to keep your database organized, especially if you are trying several combinations of several parameters for the optimal montage.
- (Optional) Specify a folder path to save the weight table.
Once the optimization is done, you will see a report about the optimal montage appearing in Matlab terminal:
This shows, for each channel, the source-detector distance and the weight, which is the sensitivity of the channel to the ROI. You should make sure that the weights are reasonable (e.g., there should not be a channel with a weight order of magnitudes larger than the other weights).
Investigating the light-sensitivity of the resulting montage
This section can be considered to check the spatial properties of any fNIRS montage, whether optimal or not.
Visual inspection
The first step is to visually check the proposed montage. To do so, in your database, you should now have a folder containing the montage:
Inside the folder, two files are present:
NIRS-BRS channels (21): This contains the information about the montage
Separations: this file contains for each channel, the distance between the source and the detector. The main purpose of this file is to allow you to execute processes on the montage (estimate forward model, extract sensitivity …).
You can inspect the estimated optimal montage by double-clicking on NIRS-BRS channels. This will open a window showing you the nirs montage (source in red, detector in green). The search space used for the optimal montage appears as a new scout in the ‘User Scouts’ panel and is called ‘From G_and_S_transv_frontpol_R (4cm)’. (In general, ‘From ROI ( 4 cm)’ where ROI is the name of the targeted region on the cortex).
FluencesRegion and FluenceExclude are two scouts containing information about the possible optodes locations on the head. FluenceRegion indicates all the positions for which we can place optodes and for which we pre-computed the fluences. FluenceExclude contains all the regions for which it is impossible to put optodes (Region near the eye or the ear). FluenceExclude is used internally to avoid the montage overlap with the eyes or ears of the subject.
For visualization purposes, you can then add the cortex from the surface menu and see the relation between the montage and the underlying targeted ROI.
Quantitative inspection
To allow detailed quantitative analysis of our optimal montage, we first need to estimate the fNIRS forward model from the fluences. To do so, drag and drop the separation file into the file to the process box, then select the process nirs > source > compute head model from fluence.
For the fluence data source, use ‘https://neuroimage.usc.edu/resources/nst_data/fluence/’. This will use the pre-computed fluences for Colin27 head model. Keep the other parameters as default.
You can then extract the sensitivity of the montage to the cortex using the following process: Nirs > source > Extract sensitivity from head model.
This will generate the following files:
- Summed sensitivity – WL 1
- Sensitivity – WL 1
- Overlap WL 1 (sensitivity)
- Overlap WL 1 (#overlaps)
- Summed sensitivity – WL 1
Summed sensitivity – WL map
This map reports the overall sensitivity of the montage (sum of all the channels). The map is in decibels (dB). A value of 0 represents the maximum sensitivity. A value of -1 indicates 10% of the maximum sensitivity, and a value of -2 indicates 1% of the maximum sensitivity. To use a linear scale, use the option ‘Linear’ when exporting the sensitivity maps.
For better visualization purposes, we recommend the following settings (can be obtained by right-clicking on the map)
The next maps are spatiotemporal maps, meaning that we encoded some information in the time vector. To navigate those maps, you will need to adjust the selected time from the Brainstorm panel.
It might also be useful when exploring those maps to visualize the quantity of interest inside specific regions. For that, you can select a scout and use the button ‘Display scouts time series’. You can modify the function applied to each scout to either display the mean over the vertex or all the vertices (one line per vertex). Doing so can be helpful to change the displayed time point on the map.
Sensitivity – WL 1 map
This map reports the light sensitivity of each individual channel, i.e. This is a spatiotemporal map, for which the channel configuration information is encoded along the time vector. So to access the light sensitivity corresponding to the channel SXDY, one needs to visualize the map at the time sample 100*X + Y. Therefore, the sensitivity map of the channel S3D9 is encoded at t = 309s and S2D10 is time t = 210s.
This figure illustrates the light sensitivity map for time 201 (S2D1). The time course shows the average sensitivity inside the target region for each channel. Non-zero values show the existing channels.
NIRSTORM also exports two measures of the spatial overlap between channels within the montage: two channels are considered to be overlapping spatially for a specific vertex if they are both sensitive to that specific channel after thresholding the corresponding sensitivity maps.
Overlap WL 1 (sensitivity) map
Overlap WL 1 (sensitivity) map is setting the threshold to the expected minimum number Nc of channels sensitive to a region, NIRSTORM reports, for each vertex, the minimum sensitivity achieved by the Nc most sensitive channel. The threshold Nc is encoded as time in the map.
The left map shows the minimum sensitivity achieved for each vertex by at least 8 channels ( t = 8s). The right plot shows the corresponding ‘time course’ where each line corresponds to a vertex of the ROI. The y-axis corresponds to the minimum sensitivity achieved by that vertex for a specific number of overlapping channels indicated in the x-axis. The higher the threshold on the number of overlapping channels (larger time t), the lower the expected minimum sensitivity to a vertex is.
Overlap WL 1 (overlap) map
Overlap WL 1 (overlap) map is setting the minimum sensitivity of each vertex and reporting how many channels are sensitive to that specific vertex with at least the specified sensitivity. The sensitivity threshold is again specified in the time vector.
The left image shows for each vertex, how many channels have at least a sensitivity of -1.1db to that vertex. The right image shows the average number of overlapping channels in the ROI when we make the threshold vary. A larger threshold on the sensitivity leads to fewer overlapping channels in the ROI. We usually use a threshold of -1 dB, keeping all the vertices with a sensitivity larger than 10 % of the maximum sensitivity.
Exporting the montage coordinate
To export the montage, right-click on ‘NIRS-BRS channel’, then File, then export to file.
You will then be able to export the optodes coordinate in multiple spaces (subject space, or MNI space) and multiple formats. For more information about the coordinate system, consult: https://neuroimage.usc.edu/brainstorm/CoordinateSystems
These coordinates can then be reported or imported into a neuronavigation system to guide the installation of the optodes on your subject or for the preparation of your cap.
For example, exporting the coordinate using the ‘NIRS: BIDS optrodes.tsv, MNI space mm (*.tsv)’ will generate the following file:
Computing an optimal montage for multiple regions
The optimal montage is working one region at a time. If your study involves measuring fNIRS over multiple regions, you need to compute the optimal montage for each region separately. The different montages can then be merged before computing the sensitivity of the resulting montage and exporting the optodes coordinates.
Computing optimal montage for each region
The first step consists in estimating the optimal montage for each region separately. Repeating the previous step, we can for instance compute an optimal montage for the region From G_and_S_transv_frontpol_L, which is the contralateral region to the previously investigated region. Using the same parameter (changing the output name to OM_ G_and_S_transv_frontpol_L_7S_7D_7A).
We obtain the following results :
Merging montages
The next step is to merge the different montages. This is notably useful for detecting conflict between optodes, since launching the optimal montage several times, some optodes might be located too close to each other in the merged montage. NIRSTORM will generate a warning if the distance between two optodes is less than 1.5cm.
To merge montages, drag and drop the ‘Separations’ files to the file to process box, and select the process NIRS > sources > Merge Montage
This will generate a new folder in the brainstorm database called 'OM_G_and_S_transv_frontpol_R_7S_7D_7A_merge2' that can be renamed to 'OM_G_and_S_transv_frontpol_LR_7S_7D_7A'.
Since our two ROIs were very close to each other, the following warning can be seen in the terminal:
Detector - Detector conflicts : Detector 12 and Detector 5 - 7 are conflicting Detector 13 and Detector 1 - 7 are conflicting
This warning indicates a conflict between detector 12 and detectors 5 and 7, and between detectors 13 and detectors 1 and 7.
If we open the montage, we can indeed see that detector 12 is very close to detectors 7 and 5, and also that detector 13 is close to detectors 1 and 7. The following figure shows a zoom on the merged montage, zoomed on the specific detector showing conflict.
In case of ‘conflict’ between multiple optodes, several options exist to solve them:
- One solution could be to identify the matching detector and to ‘fuse them’. For example, detectors 12 and 7 can be merged and considered as a unique detector located between D12 and D7.
- The second solution would be to recompute the second optimal montage with a modified search space to avoid conflict with the first ROI (see next section).
- The last solution would be to merge the target ROI on the cortex and recompute one unique optimal montage targeting both ROI at once.
If no conflict arises, you can then compute the same metrics as before and export the coordinates of the montage.
Modifying the search space
So far, we have let the optimal montage choose the search space for the optodes positions. By default, we are considering any vertex of the skin surface at a maximum distance of 4 cm around the ROI as a possible optode position for our optimal montage. In the previous illustration for the merged montage, one solution is to restrict the search space for the second ROI to avoid conflict with the previous montage.
To do so, open the fNIRS montage, and create manually a scout on the head covering all the optodes of the right montage and call it ‘Exclude’ (the name is not important) :
Note that the definition is approximative but should cover most of the left montage, including a boundary of around 1.5 cm around each optode. You can then duplicate the original left search region called ‘From cortical G_and_S_transv_frontopol L(4 cm)’ and rename it region ‘ROI G_and_S_transv_frontopol L (custom)’ (again the exact name is not important).
You can then remove the ‘exclude’ region from this region by using the difference tool in Brainstorm. To do so, just select the scouts ‘exclude’ and ‘ROI G_and_S_transv_frontopol L (custom)’ and then Scout > Difference.
Use ‘ROI G_and_S_transv_frontopol L (custom)’ - ‘exclude’ which in this case is A – B.
We can now see the new search region, not including vertex near the previous montage:
We can now re-estimate the optimal montage using this new search space. To do so, uncheck ‘Use default search space’ and select ‘ROI G_and_S_transv_frontopol L (custom) - exclude’ for the search space. Also, we recommend you to update the name to the output condition.
We will then obtain the following montages and light sensitivity maps. The 2nd line shows the average sensitivity within the left and right ROI. We observe that the light sensitivity in this case is higher for the right ROI (-0.6 dB) in comparison to the left ROI (-0.9 dB).
Note that we are creating here a small asymmetry between left and right ROI as the right ROI was able to use the entire search space when the left ROI will be constrained to not overlap with the montage for the right ROI, leading to a slightly sub-optimal montage causing the difference in light sensitivity.
Creating an optimal montage for EEG-FNIRS
Loading EEG position
In your brainstorm database, create a new folder called EEG. You can then import the position from your EEG device by right clicking on the folder and use ‘ Use Default EEG cap, then Colin27, then select the appropriate cap’.
In our case, we will be using the cap ‘BrainProducts EasyCap 64’.
We can visualize the cap:
The first step to improve visualization is to project the electrodes on the scalp. To do so, right click on the EEG channels, then MRI registration, then EDIT. Then from the GUI use ‘Project electrodes on surface’
The cap now looks like this:
We then need to convert the position of the electrodes to scout on the head mesh. For that, right-click on the montage and use ‘Convert to scout’. And enter the radius around each electrode used to create the scout. In this case, we want to create an exclusion zone of 1 cm around each electrode, so we will enter 10 mm. Note that this would need to be adapted depending on the size of your EEG electrodes, NIRS optodes, and installation technique, as you want to find a good tradeoff between having a good co-localization of the EEG and fNIRS (lower radius) and making the installation feasible (larger radius).
A scout has been created on the scalp surface called ‘Scout from BrainProducts EasyCap (64) ( 10 mm)’. Rename that scout to ‘ExcludeEEG’. All the red regions correspond to the vertex we want to exclude from the search space for the NIRS optimal montage.
Modifying the search space
We can overlay this exclusion zone with our previous search space ‘ for the right region: From cortical G_and_S_transv_frontopol R(4 cm).
To modify the search space, we can take the difference between A: From cortical G_and_S_transv_frontopol R(4 cm). and B: ExcludeEEG by doing A – B.
We will then use the new created scout ‘From cortical G_and_S_transv_frontopol R(4 cm) - ExcludeEEG ‘ as search space:
We can see that we effectively removed the EEG positions from the NIRS search space.
Computing the optimal montage
We can now recompute the NIRS montage. To use the custom search space, uncheck ‘Use default search space’ and select ‘From cortical G_and_S_transv_frontopol R(4 cm) - ExcludeEEG’. Also, give a new name to the output condition.
We can see that the new montage is avoiding the EEG electrodes while still keeping a similar sensitivity pattern:
Note that since each map is normalized by its maximum value, we cannot directly compare the exact value between the two sensitivity maps. To do that comparison, re-export the sensitivity map using a linear scale :
We can see that, in this case, removing the EEG from the search space didn’t impact the capacity of the optimal montage to find a montage targeting the ROI.
We can investigate the difference in sensitivity by examining the difference between the two sensitivity maps (old – new)
The map shows values where the new montage has a higher sensitivity in blue and in red where the previous montage had a higher sensitivity. We can see that the new montage has a slightly higher sensitivity outside the ROI but is similar inside the ROI. The right plot shows the difference in sensitivity for each vertex inside the ROI. Some vertices have higher sensitivity before (value larger than 0), and some have a higher sensitivity in the new montage (value less than 0).
Creating an optimal montage for using a fNIRS cap
In this section, we are going to use a cap with pre-defined positions on the head for the possible location for the fNIRS optodes. The main difference with the previous section is that we are going to constrain the search space to only consider those pre-defined locations.
In this section, we are going to target the right supramarginal gyrus (supramarginal R in the Desikan-Killianly atlas)
Loading the cap
In your brainstorm database, create a new folder called ‘cap’.
You can then import the position from your cap by right clicking on the folder and use ‘ Use Default EEG cap, then Colin27, then select the appropriate cap’.
In our case, we will be using the cap ‘BrainProducts ActiCap 128’.
The first step to improve visualization is to project the electrodes on the scalp. To do so, right click on the EEG channels, then MRI registration, then EDIT. Then from the GUI use ‘Project electrodes on surface’
The cap looks like this:
We now need to convert each sensor into a position on the scalp that we will use as search space for the optimal montage.
For that, right-click on the montage and use ‘Convert to scout’. And enter the radius around each electrode used to create the scout. In this case, we want to use the closest vertex on the skin to be used in the search space, so we will enter 0 mm for the radius.
If we open the head mesh, we can see that a new scout has been created called ‘Scout from BrainProducts ActiCap (130) ( 0 mm)’ containing all the possible locations for the optodes on the head. Rename the scout ‘cap_nirs’
Computing the optimal montage
Finding good parameters for the number of source/detectors and adjacency can be more difficult on a cap than with a regular optimal montage. However, the weight table is independent of those parameters. It is therefore easy and fast to test multiple configurations so one can then decide on the optimal montage.
Here is an example of multiple montages for 3 sources, and either 4, 5, or 6 detectors and 3 adjacency. Each figure shows the montage along with the summed sensitivity map on a linear scale. It is important to select linear for the scale when exporting the sensitivity map to be able to compare the sensitivity between montages. (Note that the colorbar is also the same in every figure)
Here are two configurations using 4 sources, and respectively 5 or 6 detectors.
Finally, here is a montage with 6 sources and 6 detectors:
Personalized optimal montage
In this section, we are going to investigate how to compute all the elements of the optimal montage from scratch by recreating the montage used in the main NIRSTORM tutorial ( https://neuroimage.usc.edu/brainstorm/Tutorials/NIRSTORM) targeting the ‘hand knob’ in the motor cortex. This section is useful if you wish to – compute a montage specific for each individual participating in your study, or if you want to use another template than Colin27 to model your target population (useful if you are targeting infants).
The main steps required to prepare the estimation of the optimal montage are the following:
- Importing the subject anatomy
- Estimating / Importing the subject tissue segmentation
- Estimating the Volume to cortex interpolation function (also known as Voronoi)
- Estimating the fluences for every vertex in the search space using MCXlab
For this section, download the dataset from: https://osf.io/md54y/?view_only=0d8ad17d1e1449b5ad36864eeb3424ed .
More information about the data can be found here: https://neuroimage.usc.edu/brainstorm/Tutorials/NIRSTORM
Importing the subject anatomy
The first step when computing the optimal montage is to import the segmented anatomy of the subject. This can be obtained through various software such as Cat12 or Freesurfer. For more information about the supported software in Brainstorm, consult the MRI segmentation tutorial: https://neuroimage.usc.edu/brainstorm/Tutorials#Advanced_tutorials
The main information required are:
- The subject MRI
- The head mask: Mesh representing the scalp surface.
- The cortical surface: Mesh representing the cortical surface. Ideally, we want to use the central (or mid) surfaces. The central surfaces are meshes halfway between the grey-white interface and the external pial surface (grey-CSF interface).
In this tutorial, the MRI was segmented using FreeSurfer.
- Start by creating a new subject.
- Switch to the "anatomy" view of 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 ]
- 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. This step is important as it will define the position used for the search space and we want the position inside the search space to be distributed in a uniform manner along the skin surface.
Your database should look like this:
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_tutorial_2024/derivatives/segmentation/sub-01/scout_hand.annot
Definition of FluenceRegion and FluenceExclude
In NIRSTORM, two scouts defined on the head surface play a particular role when computing fluences: FluenceRegion and FluenceExclude. FluencesRegion and FluenceExclude are two scouts containing information about the possible optodes locations on the head. FluenceRegion indicates all the positions for which we can place optodes and for which we pre-computed the fluences. FluenceExclude contains all the regions for which it is impossible to put optodes (Region near the eye or the ear). FluenceExclude is used internally to avoid the montage overlap with the eyes or ears of the subject. To define them, open the skin mesh and define two new scouts ‘FluenceRegion’ and ‘FluenceExclude’.
For FluenceRegion, add a first vertex at the approximate position where Cz would be (midpoint between the two ears) then expand the scout until it covers most of the head.
For FluenceExclude, start a new scout at the center of each region you will want to exclude (e.g. One region per eye, and one region per ear). If you see any artifact from the segmentation on the head, include them too in FluenceExclude. You can then merge all the subregions and rename the scout FluenceExclude. For this particular subject, we want the region to look like the following image: (FluenceRegion is in green, and FluenceExclude is in red).
Estimating the subject tissue segmentation
To estimate the propagation of infrared light inside the head, we need to compute a volumetric segmentation of the head into 5 tissue segmentation (skin, CSF, grey matter, white matter). This can be done using SPM or Cat12.
SPM12 can also be used to segment the MRI into 5 tissues: Right-click on the T1 MRI and use MRI segmentation > SPM12. If you have a T2 image, brainstorm will ask you if you want to use the T2 to refine the MRI segmentation: Answer ‘yes’. The output is a tissue segmentation called ‘tissues_segment’
- Rename the segmentation to ‘segmentation_5tissues’. The name is important for the following processes.
For the tutorial, we are going to import a pre-computed segmentation of the MRI using a combination of SPM12 and FreeSurfer.
For this tutorial, we are providing a pre-computed 5 tissue segmentation. To import this pre-computed segmentation,
Right-click on the subject node > Import MRI
- Set the file format: Volume atlas (subject space)
- Select the file nirstorm_tutorial_2024/derivatives/segmentation/sub-01/segmentation_5tissues.nii using Volume atlas (subject space) for the file format
- Answer ‘Ignore’ to the question ‘How to register the new volume with the reference image’ (The segmentation is already co-registered with the reference image)
- Answer ‘no’ to the question ‘Reslice Volume’. We do not need to reslice the segmentation.
You can then visualize the segmentation on top of the subject MRI:
Estimating the Voronoi volume-to-cortex interpolator
Voronoi interpolator is a function that allows us to project any volume to the cortical surface. Such projection is achieved using a Voronoi projection: each voxel is associated with a Voronoi cell describing the interpolation kernel for a specific vertex of the cortical surface, resulting in an anatomically informed interpolation scheme based on Voronoi diagrams [7]. The resulting volume-to-surface interpolation scheme is therefore informed by the underlying anatomical sulco-gyral geometry (See Grova et al. 2006 [7] for more information).
To compute the Voronoi interpolator:
- click on run, without any file in the process box
Under NIRS > Sources, select Compute Voronoi volume-to-cortex interpolator. Then select the subject and use the Grey matter masking option.
If you did not estimate the segmentation or forgot to rename it ‘segmentation_5tissues’, the following warning will appear. Delete the estimated Voronoi interpolator (‘Voronoi interpolator for MRI T1 onto mid_15002V’), ensure you imported and named properly the segmentation, and then run again the Voronoi estimation.
Projecting a volume onto the cortical surface
As explained before, Voronoi interpolator can be used to project any volume on the cortical surface. In our case, we mainly use it to project the fluence on the cortex, but it can be used to project any volume of interest to the cortex. One classic example would be to project fMRI statistical map on the cortex.
To project a volume on the cortex using the Voronoi interpolator, select ‘NIRS > source > Project Volume to Surface’. Then select the subject name, enter a name for the folder in which the volume will be saved in your brainstorm database, select the volume to project on the cortical surface, and finally select the function to apply on each Voronoi cell. This function will be applied to each Voronoi cell to obtain the value for the associated vertex on the cortex.
Note: The volume needs to be co-registered with the imported T1 in your brainstorm database. The two volumes also need to have the same dimensions.
Estimating the fluences for every vertex in the search space using MCXlab
We then need to estimate the fluences for every vertex in the search space defined here as all the vertex with a 4 cm radius around the hand knob. For that, we will be using the plugin MCXlab integrated in Brainstorm. If your computer has a GPU supporting CUDA, load ‘mxclab-cuda’, otherwise, load the plugin ‘mcxlab-cl’.
For performance reasons, we recommend using ‘mcxlab-cuda’ along with a good GPU as this step is computationally intensive. Consult http://mcx.space/gpubench/ for a benchmark of different GPUs.
Then use ‘NIRS > source > compute fluence’. Select the subject name, and click on Edit.
The following panel will appear:
In that panel, you need to:
- Select the target ROI on the cortex. Here ‘hand’.
Specify the extent of the scalp projection (radius to get the search space on the skin). Here we will keep 4cm. If you defined ‘FluenceRegion’ and ‘FluenceExclude’ on the head mesh, then a message will indicate that they are detected and will be used.
- Specify the wavelength used for the optimal montage. Keep 685 nm
- Specify the GPU used by checking the correct boxes.
- Specify the number of photons used for each vertex. Since this is computationally intensive, we recommend using 10 or 20 million photons.
- Then, specify a folder to store the fluences. This folder will be used when estimating the optimal montage.
Note: This process can take several hours, even using a good GPU.
Computing the optimal montage
Finally, you can then estimate the optimal montage as explained in the previous section.
- Ensure that you are using the same extent for the scalp projection as for the fluence
- Ensure that the fluence data source corresponds to the folder specified during the fluence estimation
- Ensure that the wavelength is the same as during the fluence estimation.
Reference
- Fang Q, Boas DA. Monte Carlo Simulation of Photon Migration in 3D Turbid Media Accelerated by Graphics Processing Units. Opt Express. 2009;17(22):20178. doi:10.1364/oe.17.020178
- Land AH, Doig AG. An Automatic Method of Solving Discrete Programming Problems. Econometrica. 1960;28(3). doi:10.2307/1910129
- Delaire É, Vincent T, Cai Z, et al. NIRSTORM: a Brainstorm extension dedicated to functional Near Infrared Spectroscopy (fNIRS) data analysis, advanced 3D reconstructions, and optimal probe design. bioRxiv. Published online 2024. doi:10.1101/2024.09.05.611463
- Machado A, Marcotte O, Lina JM, Kobayashi E, Grova C. Optimal optode montage on electroencephalography/functional near-infrared spectroscopy caps dedicated to study epileptic discharges. J Biomed Opt. 2014;19(2):026010. doi:10.1117/1.jbo.19.2.026010
- Machado A, Cai Z, Pellegrino G, et al. Optimal positioning of optodes on the scalp for personalized functional near-infrared spectroscopy investigations. J Neurosci Methods. 2018;309:91-108. doi:10.1016/j.jneumeth.2018.08.006
- Cai Z, Uji M, Aydin Ü, et al. Evaluation of a personalized functional near infra-red optical tomography workflow using maximum entropy on the mean. Hum Brain Mapp. 2021;42(15):4823-4843. doi:10.1002/hbm.25566
- Grova C, Makni S, Flandin G, Ciuciu P, Gotman J, Poline JB. Anatomically informed interpolation of fMRI data on the cortical surface. Neuroimage. 2006;31(4):1475-1486. doi:10.1016/j.neuroimage.2006.02.049