Skip to content

Workshop PERFORM Week 2018

Thomas Vincent edited this page May 10, 2018 · 105 revisions

NIRSTORM is a Brainstorm plugin for fNIRS data analysis.

Outline:

Authors

  • Thomas Vincent, PERFORM Centre and Physics dpt., Concordia University, Montreal, Canada
    Centre EPIC, Institut de Cardiologie de Montréal, Montréal, Canada
  • Zhengchen Cai, PERFORM Centre and Physics dpt., Concordia University, Montreal, Canada
  • Alexis Machado, Multimodal Functional Imaging Lab., Biomedical Engineering Dpt, McGill University, Montreal, Canada
  • Louis Bherer, Centre EPIC, Institut de Cardiologie de Montréal, Montréal, Canada
  • Jean-Marc Lina, Electrical Engineering Dpt, Ecole de Technologie Supérieure, Montréal, Canada
  • Christophe Grova, PERFORM Centre and Physics dpt., Concordia University, Montreal, Canada

Requirements

  • Hardware: a basic recent laptop should be fine.
  • An internet connection. A dedicated wifi connection will be available on site for the participants of the workshop.
  • Operating system: linux, windows or Mac OS. Everything should work on all systems though we recommend to use linux since more tests have been done with it.
  • Disk space: the full installation with dependencies and sample data should take no more than 4Gb. Some space can be freed by cleaning the CPLEX dependency (saves ~3Gb).
  • Matlab: version > R2015b is recommended.
    The matlab Curve Fitting Toolbox is required to perform motion correction. If you don't have it, you may skip this step in the first tutorial. The provided data do not contain too much movement.
  • Before attending the workshop: Please complete the following Setup section .

Setup

Brainstorm

If Brainstorm is already installed, update to the latest version (Menu bar: Update > Update Brainstorm).

For a new installation, Brainstorm requires a user to be registered in order to download it. This allows their development team to track their usage. You can proceed with the registration at this page.

Then use the newly created account to download the latest version of brainstorm here. On this page under "Software", download the archive named like "brainstorm_180501.zip" (~60Mb).

Uncompress this archive to a folder of your choice on your local drive, eg your Documents folder. Then run matlab and change the current directory of matlab to the one where the archive was uncompressed. This can be done either via the folder selector or by a command (replace <current user> with your actual user name):

  • Windows: cd C:\Users\<current user>\Documents\
  • Mac OS: cd /Users/<current user>/Documents/
  • Linux: cd /home/<current user>/Documents/

Once in the correct brainstorm folder, type the command brainstorm and agree to the license.

For the first time it runs, brainstorm asks to specify a database folder. This will be the place where all the data imported by brainstorm will go. Create a folder named brainstorm_db in eg your Documents folder and specify it as your main brainstorm database. Then, the main brainstorm interface will be displayed.

Note: you can avoid having to change to the brainstorm directory every time. To do so, while brainstorm is running, go to the "Home" tab of matlab then "Set path". There click on "Save" and "Close". Now you're able to run brainstorm without changing to the installation directory every time.

No prior knowledge of brainstorm is mandatory for the current workshop session which should cover the basics. However, if one wishes to get familiar with brainstorm features, we refer to the brainstorm introduction page.

Important for mac users: If the right-click doesn't work anywhere in the Brainstorm interface and you cannot get to see the popup menus in the database explorer, try to change the configuration of your trackpad in the system preferences and enable left-click. Alternatively, connect a standard external mouse with two buttons. Some Apple pointing devices do not interact very well with Java/Matlab.

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 (last tutorial of this workshop).
For license concern, we cannot bundle the CPLEX library within nirstorm. One can purchase a free copy of CPLEX if they are students or academics. To do so, got to the IBM webstore and click on "register" at the top right. It will ask for your institutional information. Then from this page, get the version of CPLEX that corresponds to your status (student or faculty) and system configuration. Once installed, the location of the CPLEX matlab bindings that are needed for nirstorm depends on your system:

  • On windows: C:\Program Files\IBM\ILOG\CPLEX_Studio128\cplex\matlab\x64_win64
  • On Mac OS: Applications/CPLEX_Studio128/cplex/matlab/x86-64_osx
  • On linux (from the folder where you installed CPLEX studio): cplex_studio_128/cplex/matlab/x86-64_linux

Note that the whole CPLEX studio package takes around 700 Mb to download and requires around 3 Gb of drive space for installation. However, if disk space is an issue, one can extract only the matlab bindings needed by nirstorm (less than 25 Mb). To do so, copy the content of the path specified above into eg your Documents folder. After that, you can uninstall CPLEX studio.

Finally, add the path to the CPLEX matlab bindings to the matlab path: go to the "Home" tab, click "Set path" (yellow folder icon) then click on "Add with subfolders" and select the folder of the CPLEX matlab bindings.

If you cannot get a working version of CPLEX, let us know during the workshop and we'll try to help you.

Nirstorm

Go to the release page of the project and download the latest version. Click on "Source code (zip)" in the Asset section.

Uncompress the archive in the folder of your choice, eg your Documents folder. Then change the matlab directory to the folder where you uncrompressed the archive, eg Documents/nirstorm-0.4. Make sure brainstorm is running and run the following command in the matlab prompt:

nst_install('copy');

This will install all nirstorm processes into brainstorm.

Download data sets and check installation

All data required for this session are regrouped in an archive of ~500 Mb. The total disk space required after data download and installation is ~900Mb. The size is quite large because of optical data which are required for the computation of optimal montages.

Download Nirstorm_workshop_PERFORM_2018.zip and uncompress it to eg your Document folder. You should obtain a sub-folder named Nirstorm_workshop_PERFORM_2018. It contains:

  • a motor sample data set (for the channel-space analysis tutorial)
  • a visual sample data set (for the cortical reconstruction tutorial)
  • a modified version of the Colin27 template (for the optimal montage tutorial)
  • optical data specific to the Colin27 template (for the optimal montage tutorial)

Once data is extracted, you may delete the archive.

A dedicated process will take care of checking downloads, installing template data and performing some configuration checks.
In the main panel of brainstorm, click on "Run" in the lower left corner. Then click on the small wheel at the top left of the window that popped up.

process selection

Select "NIRS > Workshop PERFORM 2018". This will display the following panel:

Workshop setup

Under "Path to the downloaded and uncrompressed archive", select the folder Nirstorm_workshop_PERFORM_2018 that you obtained from the downloaded archive.

Warning: the unzipping tool you used (especially under windows) may have created an extra directory level like Nirstorm_workshop_PERFORM_2018\Nirstorm_workshop_PERFORM_2018. Make sure to select the deepest folder.

Click on "Run". The process will:

  • Create the procotol nirstorm_perform_2018 where all tutorials will be executed
  • check data files
  • install the Colin27 template specific to nirstorm
  • install fluence data

At the end, a process report is displayed. If everything went fine, it looks like:

Workshop setup report

Tutorials

Here is a cheat sheet on the main brainstorm features that will be used during the tutorials:

Workshop setup report

Channel-space analysis: extraction of the motor response

Tapping result

Follow the tutorial on basic NIRS data analysis in the channel space. This link points directly to the data importation section and skips the first parts. You don't need to follow the setup sections of this tutorial since all details should have been covered previously in the current wiki page.

Important: you will find the data set required required for this tutorial in the downloaded sample data folder: Nirstorm_workshop_PERFORM_2018/channel_space_analysis/sample_nirs.

Note: if you don't have the matlab Curve Fitting Toolbox, skip the motion correction step.

Cortical reconstruction using cMEM

This tutorial illustrates how to perform NIRS reconstruction: estimate NIRS signals in the cortical layer that were at the origin of the signals measured in the channel-space on the scalp.

Presentation of the experiment

  • One subject, one run of 17 minutes acquired with a sampling rate of 5Hz
  • Visual checkerboard task: 13 blocks of 20 seconds each, with rest period of 15 to 25 seconds
  • 2 sources and 10 detectors
  • 2 wavelengths: 685nm and 830nm
  • 3T MRI anatomy processed by FreeSurfer 5.3.0 and SPM12

Setup

A complete data set with already pre-processed signals was downloaded in the sample data.

  • To load this data into brainstorm, from the menu of the Brainstorm main panel:

    File > Load protocol > Import subject from zip and select the downloaded protocol file: Nirstorm_workshop_PERFORM_2018/cortical_reconstruction/protocol_nirs_reconstruction.zip

    This will create the subject "Subject_Reconstruction" in the current protocol.

Anatomy

Switch to the "anatomy" view of the protocol. The anatomy data of subject Subject_Reconstruction mainly consists of:

  • MRI: 3T MRI image of the subject
  • Segmentation_5tissues: anatomical segmentation performed by FreeSurfer 5.3.0 and SPM12 tissues types contains scalp (labeled as 1), skull (labeled as 2), CSF (labeled as 3), gray matter (labeled as 4) and white matter (labeled as 5). In general, one could use segmentations calculated by other software. Note that the segmentation file was imported into Brainstorm as an MRI file, please make sure the label values are correct by double clicking on the segmentation file and reviewing using the tool MRIViewer of Brainstorm.
  • Voronoi interpolator for MRI onto mid: interpolators to project volumic data onto the cortical mid surface. It will be used to compute NIRS sensitivity on the cortex from volumic fluence data in the MRI space. It has been computed using the nirstorm process "Compute Voronoi volume-to-cortex interpolator".
  • scalp: scalp mesh calculated and remeshed by Brainstorm. To reduce the NIRS montage registration error, it is always better to remesh the head mesh so that two projected optodes do not end up on vertices that are too close.
  • mid: mid-surface calculated by FreeSurfer 5.3.0 which is in the middle of the pial and white surface. This is a resampled version of the original file provided by freesurfer, with a lower number of voxels to reduce the computation burden of the reconstruction. The NIRS signal spatial resolution is quite coarse anyway so we don't need many vertices. 25000 vertices is a fine recommendation for the reconstruction algorithm considered here.
    Besides, note that the quality of this mesh is critical since it will the support of the reconstruction. Some mesh inconsistencies (crossing edges, non-manifolds, zero-length edges...) can occur during segmentation and have to been avoided or fixed.

The anatomy view should look like:

Anatomy view

Verify that the default MRI, head mesh and cortical surface are the same as in this snapshot

Pre-processed functional data

The provided functional data is already preprocessed. Preprocessings were similar to the previous tutorial on channel-space analysis, except for the Modified Beer-Lambert Law (MBLL). The MBLL was here applied only partially without taking into account for the light path length correction. Indeed the cortical reconstruction process will take care of it, by explicitly modeling the light path through the head layers.

Anatomy view

The functional view of the protocol consists of:

  • VisualTask_BlockDesign: contains the raw acquisition data.
    Note: The "Link to raw file" will not be available (broken link error). Indeed, this data is not meant to be stored in the brainstorm data base and so it points to the original file on our machine.

  • VisualTask_BlockDesign_head_proj: contains raw data that has been projected onto the scalp mesh ("NIRS > Project montage to head mesh").

    Due to digitization and segmentation errors, optode positions may not match the scalp mesh. To fix this issue, they were projected to their nearest vertex on the scalp mesh.
    VisualTask_BlockDesign_head_proj: contains pre-processed data:

    • NIRS-BRS channels (48): NIRS channel file
    • NIRS data: imported raw NIRS data
    • NIRS data | IIP-filtered(0.005-0.5Hz): band-pass filtered raw data in between 0.005 and 0.5 Hz. This process should have removed any low frequency drift.
    • NIRS dOD: delta optical density (obtained by normalizing raw data and applying log)
    • NIRS dOD | low(0.1Hz): low-pass (0.1Hz high cut-off) filtered dOD to remove cardiac and respiratory artifacts
    • Visual (13 files): 13 block trials exported from NIRS dOD | low(0.1Hz) with a window size of -10 seconds to 40 seconds. These are peri-stimuli signal chunks.
    • AvgStderr Visual (13): block-average of visual trials (13 files), with standard error. This pre-processed signal will be the input of the reconstruction.
Functional plots

Forward problem

The NIRS reconstruction process relies on the so-called forward problem which models light propagation within the head. It consists in generating the sensitivity matrix that maps the absorption changes along the cortical region to optical density changes measured by each channel (Boas et al., 2002). Akin to EEG, this is called here the head model and is already provided in the given data set (this is the item NIRS head model).

Note that Nirstorm offers head model computation by a calling a photon propagation simulation software: MCXlab. For additional details, please refer to this optional tutorial.

The visualize the current head model, first let's look at summed sensitivities which provide an overall cortical sensitivity of the NIRS montage. Double-click on Summed sensitivies WL1.

To go into more details, the head model can be explored channel-wise. Double click on Sensitivites - WL1 and Sensitivites - WL2. We used a trick to store pair information in the temporal axis. The two first digits of the time value correspond to the detector index and the remaining digits to the source index. So time=101 corresponds to S1D1. With the same logic, time=210 is used for S2D10. Note that some time indexes do not correspond to any source-detector pair and the sensitivity map is then empty at these positions. The following .gif figure shows the summed sensitivity profile of the montage (top) and the sensitivity map of each channel (bottom).

Functional plots

Inverse problem

Reconstruction amounts to an inverse problem which consists in inverting the forward model to reconstruct the cortical changes of hemodynamic activity within the brain from scalp measurements (Arridge, 2011). The inverse problem is ill-posed and has an infinite number of solutions. To obtain a unique solution, regularized reconstruction algorithm are needed. In this tutorial, the Maximum Entropy on the Mean (MEM) will be used.

The MEM framework was first proposed by (Amblard et al., 2004) and then applied and evaluated in Electroencephalography (EEG) and Magnetoencephalography (MEG) studies to solve inverse problem for source localization (Grova et al., 2006; Chowdhury et al., 2013). Please refer to this tutorial for more details on MEM. This method has been adapted to NIRS reconstruction and implemented in nirstorm. Note that performing MEM requires the BEst – Brain Entropy in space and time package which is included in the Nirstorm package, as a fork.

To run the NIRS reconstruction using cMEM:

  • Drag and drop AvgStderr Visual (13) into the process field
  • Click "Run". In the process menu, select NIRS > Source reconstruction - cMEM.
cMEM parameters

The parameters of this process are:

  • Depth weighting factor for MNE: 0.5
  • Depth weighting factor for MEM: 0.3
    These factors take into account that NIRS measurement have larger sensitivity in the superficial layer and are used to correct for signal sources that may be deeper. MNE stands for "Minimum Norm Estimation" and corresponds to a basic non-regularized reconstruction algorithm whose solution is used as a starting point for MEM.
  • Set neighborhood order automatically: checked
    This will automatically define the clustering parameter (neighborhood order) in MEM. Otherwise please make sure to set one in the MEM options panel during the next step.

Clicking on "Run" opens another parameter panel:

cMEM parameters
  • Select cMEM in the MEM options panel. Keep most of the parameters by default and set the other parameters as:
  • Data definition > Time window: 0-35s which means only the data within 0 to 35 seconds will be reconstructed
  • Data definition > Baseline > within data checked, with Window: -5 to -0s which defines the baseline window that will be used to calculate the noise covariance matrix.
  • Clustering > Neighborhood order: If Set neighborhood order automatically is not checked in the previous step, please give a number such as 8 for NIRS reconstruction. This neighborhood order defines the region growing based clustering in MEM framework. Please refer to this tutorial for details. If Set neighborhood order automatically is checked in the previous step, this number will not be considered during MEM computation.

Click "Ok". After less than 10 minutes, the reconstruction should be finished.

Unfold AvgStderrL Visual(13) to show the MEM reconstruction results. To review the reconstructed maps, double click on the files cMEM sources - HbO and cMEM sources - HbR.
To show the reconstructed time courses of HbO/HbR, one need to define a region where to extract these time courses.
Switch to the "scout" tab in the view control panel. Then click on the scout "Visual". Under "time-series options" at the bottom, use "Values: Relative". Then in the "Scout" drop-down menu at the top of the tab, select Set function to "All". Finally, click on the wave icon to display the time courses.

cMEM scout panel

By repeating the same process for both HbO and HbR, results should look like:

cMEM results

Nirstom also includes classical depth weighted Minimum Norm Estimate (MNE) to perform reconstitution. Please refer to this optional tutorial for details.

Optimal montage

This process is part of the experiment planning, taking place before the acquisition, where the experimenter wants to define where to place the optode on the scalp. Usually, a NIRS montage has a limited coverage over the head and hence optodes are placed specifically on top of a predefined target cortical region of interest (ROI). However, due to the non-trivial light propagation across head tissues as well as the complex cortical topology, the optode placement cannot be optimally based solely on a pure geometrical criterion.

Here, the computation of the optimal NIRS montage consists here of finding the set of optode coordinates whose sensitivity to a predefined region of interest is maximized (Machado et al., 2014; Pellegrino et al., 2016).

To achieve this, this process requires:

  • an antomical MRI,
  • pre-computed fluence data,
  • a target ROI, either on the cortex or on the scalp.

For ease of configuration, the current tutorial relies on the Colin27 template adapted to NIRS (included in the workshop sample data). Indeed, fluence maps have already been pre-computed for this anatomy so that one can directly run the optimal montage process without going through the forward model computation. However, the most accurate results are obtained when using the subject-specific MRI. The current procedure can be straightforwardly transposed to any MRI.

Note that fluence data available in the downloaded sample data cover only the region of interest considered here. It amounts to around 1/10th of the head and data takes ~500Mb. In order not to have to download the whole head data (~6 Gb), nirstorm provides an on-demand fluence download system (specifically for the Colin27 template). It will download only the fluence data required to cover the considered region, if they are not already available on the local drive (in BRAINSTORM_USER_DIR/defaults/nirstorm/fluence/MRI__Colin27_4NIRS).

Setup

  • Create a new subject, called "Subject_OM"
  • Go to the anatomy view, right-click on Subject_OM and select "Use template > Colin27_4NIRS"
Data view

ROI definition

For ease of reproducibility, the ROI definition is atlas-based. To define the scout which represents this region of interest on which the sensitivity of the montage will be optimized, follow these steps:

  • Open the mid cortical mesh by double-clicking on it in the anatomical view of Subject_OM
  • Select the scout panel and use the drop-down menu to show the Destrieux atlas
  • Select the scout defining the bottom of the frontopolar gyrus, labeled "RPF G_and_S_transv_frontopol".
  • Click on "Scout > export to matlab" and name it "scout_frontal"
  • Use the drop-down menu to show "User scouts"
  • Click on "Scout > Import" from matlab and select "scout_frontal"
  • Click on "Scout > Rename" and set the scout name to "scout_OM"

This ROI scout should end-up in the user-specific atlas "User scouts".

OM scout

Compute the optimal montage

The optimal montage works by searching for the best possible layout of optode pairings withing a given region on the head mesh (search space). Each vertex in this region is a candidate holder on which an optode (source or detector) can be placed. A montage is the best if it maximizes the optical sensitivity over a pre-defined cortical region of interest.

Here, to avoid the explicit definition of the head region (search space), we will use the process "Compute optimal from cortex" which constructs the head scout by projecting the target cortical scout onto the head mesh. Alternatively, note that the head scout could be given explicitly while using the process "Compute optimal from head".

Without using any data, click on RUN (bottom left of the main brainstorm panel). Select the process "NIRS > Compute optimal montage from cortex". Here are the process parameters to fill in, along with some explanation about them:

OM parameters
  • Extent of cortex-to-scalp projection: 3 cm
    This is the maximum distance used to project the cortical scout onto the head mesh to create the head scout (search space). More precisely, a head vertex will be part of the projected head scout if it is at most 3 cm away from the closest vertex in the cortical scout.
    Make sure to use an extent of 3 cm since this value has to be consistent with the installed fluence files.

  • Cortical scout (target ROI): Subject1 > User scouts > scout_OM
    It defines the target ROI on which the sensitivity is optimized.
    The selector is experimental. It may not reflect the actual list of scouts. There may also be an error regarding scout selection during the execution of the process. To solve this, quit the process, and try to: 1) Reset process options (see snapshot below) 2) Enter panel_process_select('ParseProcessFolder',1) in the matlab prompt, 3) restart brainstorm (if the two above did not work).

    reset process options

    TODO PR for brainstorm menu item to reload processes (shortcut to panel_process_select('ParseProcessFolder',1)

    Then restart the process again.

  • Output condition name: Optimal_Montage_frontal
    The name of the condition (output functional folder) which will contain the computed montage.

  • Wavelength (nm): 685
    The wavelength of the fluence to load and which will be used to compute the optical sensitivity to the target cortical ROI. Note that optimal montages vary only very slightly across wavelengths. Hence we don't need to use the two actual wavelengths used during acquisitions. This saves some computation time!

  • Fluence Data Source (URL or path): leave default value
    Fluence data have already been installed during setup so there is no need to specify a data source here.

  • Number of sources: 4
    Maximal number of sources in the optimal montage. The actual number in the resulting montage may be lower.

  • Number of detectors: 8
    Maximal number of detectors in the optimal montage. The actual number in the resulting montage may be lower.

  • Number of adjacent: 2
    Minimal number of detectors that must be seen by any given source.

  • Range of optodes distance: 20 - 40 mm
    Minimal and maximal distance between two optodes (source or detector). This applies to source-source, detector-dectector and source-detector distances.

Process execution

The optimal montage computations comprises the following steps with their typical execution time in brackets:

  • Mesh and anatomy loading [< 10 sec]

  • Loading of fluence files [< 1 min]

    Fluence files will be first searched for in the folder .brainstorm/default/nirstorm/fluence. If not available, they will be requested from the resource specified previously (online here).

  • Computation of the weight table (summed sensitivities) [< 3 min]

    For every candidate pair, the sensitivity is computed by summation of the normalized fluence products over the cortical target ROI. This is done only for pairs fulfilling the distance constraints.

  • Linear mixed integer optimization using CPLEX [~ 5 min]

    This is the main optimization procedure. It explores the search space and iteratively optimizes the combination of optode pairings while guaranteeing model constraints.

  • Output saving [< 5 sec]

Results

Switch to the functional tab of Subject_OM.

Under the newly created folder "Optimal_Montage_frontal", double click on "NIRS-BRS channels (19)". This will display the optimal montage along with some scalp regions. Ignore these regions for now.

In the view control panel, switch the "Surface" tab, click on the "+" icon in the top right and select "cortex". This will show the cortical mesh with the target frontopolar ROI for which the montage was optimized:

OM result on frontopolar ROI

In order to use the optode coordinates in a neuronavigation, they can be exported as a CSV file. Right-click on "NIRS-BRS channels (19)", select "File > Export to File" then for "Files of Type:" select "NIRS: Brainsight (*.txt)". Go to the folder Documents\Nirstorm_workshop_PERFORM_2018 and enter filename "optimal_montage_frontal.txt".

Here is the content of the exported coordinate file, whose format can directly be used with the Brainsight neuronavigation system:

# Version: 5
# Coordinate system: NIftI-Aligned
# Created by: Brainstorm (nirstorm plugin)
# units: millimetres, degrees, milliseconds, and microvolts
# Encoding: UTF-8
# Notes: Each column is delimited by a tab. Each value within a column is delimited by a semicolon.
# Sample Name	Index	Loc. X	Loc. Y	Loc. Z	Offset
S1	1	61.801026	53.794879	20.827570	0.0
S2	2	58.614179	65.147586	-12.996690	0.0
S3	3	18.340509	84.492701	3.992621	0.0
S4	4	0.721182	85.338992	16.268421	0.0
D1	5	52.653816	67.712105	8.169515	0.0
D2	6	36.819009	72.131463	32.357219	0.0
D3	7	35.263908	77.335821	12.195818	0.0
D4	8	30.828533	79.924480	-26.315089	0.0
D5	9	43.354290	77.996386	-9.680977	0.0
D6	10	8.060217	87.471897	-13.272658	0.0
D7	11	-17.384161	84.440003	4.209488	0.0
D8	12	14.779627	78.451950	37.003541	0.0

To go further

Here is an example of optimal montage with a larger region: the right precentral gyrus.

Cortical scout

cortical scout cortical scout

Optional - Forward problem

Fluences data reflecting light propagation from any head vertex can be estimated by Monte Carlo simulations using MCXlab developed by (Fang and Boas, 2009). Sensitivity values in each voxel of each channel are then computed by multiplication of fluence rate distributions using the adjoint method according to the Rytov approximation as described in (Boas et al., 2002). Nirstorm can call MCXlab and compute fluences corresponding to a set of vertices on the head mesh. To do so, one has to set the MCXlab folder path in matlab and has a dedicated graphics card since MCXlabl is running by parallel computation using GPU. See the MCXlab documentation for more details.

Drag and drop "AvgStderr Visual (13)" into the process field and press "Run". In the process menu, select "NIRS > Compute fluences for optodes by MCXlab". Enter the fluences output path as set the parameters as the following snapshot.

MCXlab process

All these parameters are described in details on MCXLAB wiki page.

  • The important ones are cfg.gpuid defining the GPU to use for calculation and cfg.nphoton which assigns the number of photons whose trajectories will simulated by Monte Carlo.
  • If you have multiple GPUs, it is always better to use the one that is not working for displaying purpose.
  • Swep GPU allows users to switch between GPUs to avoid too high temperature.
  • To reduce the output file size, one could check the "Set threshold for fluences" and specify the threshold value.

Once you hit the "Run" button, Nirstorm will call MCXlab and calculate all the fluences and save them in the assigned folder. The next step is to calculate the head model - the sensitivity of each channel using fluences.

  • Drag and drop "AvgStderr Visual (13)" into the process field and press "Run". In the process menu, select "NIRS > Compute head model from fluence".
head model process
  • Copy and paste the fluence file path used previoulsy into the Fluence Data Source.
  • Checkbox "Mask sensitivity projection in gray matter" allows to constrain sensitivity values to the gray matter to the cortex surface.
  • "Smooth the surface based sensitivity map" will spatially smooth the sensitivity according to the FWHM value.

After running this process, a NIRS head model file called "NIRS head model from fluence" will be showed in the functional folder. Note that in Nirstorm, volumic sensitivity values were interpolated onto the cortical surface using the Voronoi based method proposed by (Grova et al., 2006). This volume to surface interpolation method has the ability to preserve sulco-gyral morphology.

To visualize the sensitivity or head model on the cortical space, one need to first extract the sensitivity data as functional data mapped onto the cortical mesh.

To do so, drag and drop "AvgStderr Visual (13)" into the process field and press "Run". In the process menu, select "NIRS > Extract sensitivity surfaces from head model". The sensitivity profile of each wavelength of the whole montage will be listed as "Summed sensitivites -WL1" and "Summed sensitivites -WL1". Users are also able to check the channel wised sensitivity map. Double click "Sensitivites - WL1" and "Sensitivites - WL2" and enter the number for instance "101" in the "Time panel" to show the sensitivity map of S1D1. With the same logic, 210 will be used for S2D10.

Optional - MNE

Minimum norm estimation (MNE) is one of the most widely used reconstruction method in NIRS tomography. It minimizes the l2-norm of the reconstruction error along with Tikhonov regularization (Boas et al., 2004).

Drag and drop "AvgStderr Visual (13)" into the process field and press "Run". In the process menu, select "NIRS > Source reconstruction - wMNE".

All the parameter definitions have the same meanning as in the MEM panel. Compute noise covariance of the baseline MNE will compute the noise covariance matrix according to the baseline window defined below. Otherwise, the identity matrix will be used to model the noise covariance.

MNE params

Note that standard L-Curve method (Hansen, 2000) was applied to optimize the regularization parameter in MNE model. This actually needs to solve the MNE equation several times to find the optimized regularization parameter. That's why it will take around 8 minutes to finish. Two L-Curves will be plotted right after the calculation. Reconstruction results will be listed under "AvgStderr Visual (13)". Reconstructed time course can be plotted by using the scout function as mentioned in MEM section.

MNE L-curves MNE results

References

Boas D, Culver J, Stott J, Dunn A. Three dimensional Monte Carlo code for photon migration through complex heterogeneous media including the adult human head. Opt Express. 2002 Feb 11;10(3):159-70 pubmed

Boas D.A., Dale A.M., Franceschini M.A. Diffuse optical imaging of brain activation: approaches to optimizing image sensitivity, resolution, and accuracy. NeuroImage. 2004. Academic Press. pp. S275-S288 pubmed

Hansen C. and O’Leary DP., The Use of the L-Curve in the Regularization of Discrete Ill-Posed Problems. SIAM J. Sci. Comput., 14(6), 1487–1503 SIAM

Arridge SR, Methods in diffuse optical imaging. Philos Trans A Math Phys Eng Sci. 2011 Nov 28;369(1955):4558-76 pubmed

Amblard C,, Lapalme E. and Jean-Marc Lina JM, Biomagnetic source detection by maximum entropy and graphical models. IEEE Trans Biomed Eng. 2004 Mar;51(3):427-42 pubmed

Grova, C. and Makni, S. and Flandin, G. and Ciuciu, P. and Gotman, J. and Poline, JB. Anatomically informed interpolation of fMRI data on the cortical surface Neuroimage. 2006 Jul 15;31(4):1475-86. Epub 2006 May 2. pubmed

Chowdhury RA, Lina JM, Kobayashi E, Grova C., MEG source localization of spatially extended generators of epileptic activity: comparing entropic and hierarchical bayesian approaches. PLoS One. 2013;8(2):e55969. doi: 10.1371/journal.pone.0055969. Epub 2013 Feb 13. pubmed

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 Feb;19(2):026010 pubmed

Pellegrino G, Machado A, von Ellenrieder N, Watanabe S, Hall JA, Lina JM, Kobayashi E, Grova C., Hemodynamic Response to Interictal Epileptiform Discharges Addressed by Personalized EEG-fNIRS Recordings Front Neurosci. 2016 Mar 22;10:102. pubmed

Fang Q. and Boas DA., Monte Carlo simulation of photon migration in 3D turbid media accelerated by graphics processing units, Opt. Express 17, 20178-20190 (2009) pubmed

Clone this wiki locally