Skip to content

[WIP] NIRX Probe Setup Importation

RobertStojan edited this page Oct 11, 2018 · 3 revisions

Importing probe information from NIRX probe.Info file into Nirstorm

If you are using a NIRX device for data acquisition, you will be not able to import your utilized probe setup into brainstorm automatically. Note that the probe information is not necessarily needed for fNIRS data analysis with nirstorm. However, if you want to visualize your data effectively with brainstorm supported head templates you need to import your probe information manually. Therefore, you just need to follow this guide, where we explain how to do so step by step.

If you need to convert your data into .nirs first, please follow this link: http://homer-fnirs.org/faq/#nirx2nirs.

For NIRS measurements, the probe information is stored separately off the .nirs file as you will see in your subject folders. In the .nirs file, wrong coordinates are stored that do not representate the true source and detector positions. However, brainstorm will integrate those coordinates, which is why you end up with a non fitting probe information - head model. To import your actual probe information into NIRStorm just follow these steps.

Please note that this guide is only provisional. We will provide more suitable and easier options to integrate probe setups for NIRX users in due time.

Step 1 Load respective files into matlab

Load an exemplary probe.info file of your experiment of one of your subjects into matlab. The probe.info file should be similar for each participant, if you dont changed the channel setup during your study using two differnt channel set ups. Otherwise you need to do these steps for each setup individually. Simply open matlab and enter the following lines, while adopting you directory path respectively.

probe = load('C:\Users\Username\Experiments\Example\subject01\subject01_probeInfo.mat');

Similarly load the .nirs file of that subject into matlab while adopting the directory path.

nirs = load('C:\Users\Username\Experiments\Example\subject01\subject01_001.nirs', '-mat');

Step 2 Get source and detector coordinates, simply run the following commands in matlab

Coords_S = probe.probeInfo.probes.coords_s3 /100; Coords_D = probe.probeInfo.probes.coords_d3 / 100;

The coordinates are divided by 100 to scale from m in cm that is supported by Brainstorm

Step 3 Replace coordinates and create new .nirs file

Now we are replacing the wrong coordinates in the .nirs file by their actual positions. Again, simply run the following commands.

nirs.SD.SrcPos = Coords_S; nirs.SD.DetPos = Coords_D;

Now we create a new .nirs file of your subject, where only the Coordinates have been replaced. All other files remain similar. Note that some variables are not integrates as they are just not needed in brainstorm. Simply run the following command, where 'subject.nirs' should be replaced by your subject file name (e.g. 'subject01').

save('subject.nirs', '-mat', 'nirs.SD', 'nirs.t', 'nirs.d', 'nirs.s', 'nirs.aux')

Step 4 Load your subject into Brainstorm subject folder and import your data file (see previous tutorials)

After you have loaded you subject data, you will see a NIRS BRS-channels file. Richt-click on it > Display Sensors > NIRS (pairs). You will see your probe setup nearby the actual template but still a little bit messed up. Therfore you have to readjust your model on the head template manually. Right-click on NIRS-BRS channels again > MRI Registration > Edit. This Step will need quite a bit of time to adjust your model properly. In the upper pannel you can choose between linear or rotational around the x, y, or z axis. If you have sufficiently adjusted the probes to the headmodel you can click on "OK" in the upper right of the pannel.

Step 5 Replace Probe infos for all other subjects

You can do this either with a matlab script or organization program of you choise (such as melt), or manually. This step requires you to manipulate the brainstorm_db folder, which is highly unrecommended. Please make sure that you are aware of that and be attentive of the changes you will make. The probe information you want to access is stored here: brainstorm_db > "Name of your created project" > data > "subject name" > raw"subject name" > channel.nirsbrs.mat

Simply copy that file and replace it for replace it for every other subject with that one you modified. In brainstorm you will now have the appropriate head model for similarly for all participants. Furthermore, if you make further changes (probably only in the first or "main" subject head model), brainstorm will ask you, if you want to transfer these changes to all other participants.

However, as we said, this process is not recommended and is only provisional. Feel free to contact us if needed and ask about the current state of progress.