GithubHelp home page GithubHelp logo

nirstorm / nirstorm Goto Github PK

View Code? Open in Web Editor NEW
32.0 9.0 11.0 1.25 MB

Brainstorm plugin for fNIRS data analysis

License: GNU General Public License v3.0

MATLAB 98.38% C 1.34% Python 0.26% M 0.02%
brainstorm nirs neuroimaging

nirstorm's Introduction

NIRSTORM

NIRSTORM - a Brainstorm plugin for fNIRS data analysis.

Current features include:

  • classical within-subject analysis comprising motion correction, MBLL, and window-averaging.
  • statistical analysis using GLM
  • optimal montages that optimize the sensitivity to a given cortical region of interest
  • source reconstruction (cMEM, MNE)
  • precomputed fluence template based on Colin27

Main developers:

  • Edouard Delaire, PERFORM Centre and Physics dpt., Concordia University, Montreal, Canada
  • Thomas Vincent, EPIC Center, Montreal Heart Institute, Montreal, Canada
  • Zhengchen Cai, PERFORM Centre, and Physics dpt., Concordia University, Montreal, Canada
  • Robert Stojan, Sportpsychology, Chemnitz University of Technology, Germany
  • Alexis Machado, Multimodal Functional Imaging Lab., Biomedical Engineering Dpt, McGill University, Montreal, Canada

Collaborators:

  • Amanda Spilkin, PERFORM Centre and Physics dpt., Concordia University, Montreal, 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
  • Louis Bherer, EPIC Center, Montreal Heart Institute, Montreal, Canada

Usage

The primary documentation is available on the nirstorm GitHub project wiki.

Installation

Nirstorm is available in two forms: an open-source Matlab plugin for Brainstorm (Matlab license required) and is included in the Brainstorm standalone version (Java executable)

Matlab version can be installed using the Brainstorm plugin system : Nirs_installation

This required the Brainstorm version 3.210414 (14 April 2021) or higher. To use nirstorm with a previous version of Brainstorm, refer to this tutorial https://github.com/Nirstorm/nirstorm/wiki/Installation (Note: We recommend you to always use the latest version of Brainstorm)

A standalone version is directly included in Brainstorm standalone version. Follow Brainstorm tutorials for more information: https://neuroimage.usc.edu/brainstorm/Installation

nirstorm's People

Contributors

edouard2laire avatar ftadel avatar robertstojan avatar thomas-vincent avatar zhengchencai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nirstorm's Issues

nirstorm plugin installation bug

Hi,

I have the latest brainstorm installed on Matlab 2010b.

When I try to run the nst_install.m I get this error:

??? Undefined function or method 'strsplit' for input arguments of type 'char'.

Error in ==> install_package>read_manifest at 216
fns = cellfun(@(fn) strtrim(fn), strsplit(fileread(manifest_fn), '\n'), 'UniformOutput', false);

Error in ==> install_package>resolve_file_operations at 171
source_rfns = read_manifest(manifest_fn);

Error in ==> install_package at 67
[install_operations, uninstall_operations] = resolve_file_operations(package_name, source_dir, target_dir,
mode, extras);

Error in ==> nst_install at 66
install_package('nirstorm', 'bst_plugin', bst_process_folder, mode, extra, dry);

Thank you

Alex

5tissue_segmentation issues

Good afternoon Thomas/Zhengchen and Edouard,

Brainstorm recently integrated CAT segmentation, and FieldTrip segmentation, which I'm trying to use for the 5tissue segmentation needed in nirstorm for cortical reconstruction.

I have a few questions, I did see your previous post by Zhengchen with GuyRens, as well as your post by Edouard on the Brainstorm forum, which I also tried but still faces some issues.

I tried both CAT/Field Trip segmentation on the anatomical demo provided in the workshop (just to test it and see if the 5tissue segmentation is close to the one provided in the demo), and also to see if the Voronoi calculation is also similar.

As you can see from the screenshots here, its not exactly the same for both the 5 tissue segmentation and voronoi. However, the rest seems to work (head model computation, sensitivity extraction, fluence etc.)

I also noticed as you did Edouard that the order of the segmentation classes from CAT/Fieldtrip is not the same as Zhengchen mentioned in another post. Does the following steps in nirmtorm takes into account these specific order or as long as you have a 5tissue segmentation file in Brainstorm its ok ?

original 5tissue segmentation provided in the 2018 workshop
image

recalculated 5tissues segmentation with CAT
image

recalculated 5tissues segmentation with FieldTrip
image

original voronoi provided in the 2018 workshop
image

recalculated veronoi
image

Thank you in advance

Which function projects optodes onto head surface?

Hello!

I would like to see the code of the function that projects the optode positions (from digitizer data) onto the head surface of my subject specific MRI. Could you tell me which function in nirstorm is responsible for this? I would like to understand how exactly this works.

Thanks and kind regards
Franzi

Check for negative values in process_nst_mbll.m is done on NIRS and AUX data

if any(any(sDataIn.F(sDataIn.ChannelFlag~=-1, :) < 0))
msg = 'Good channels contains negative values. Consider running NISTORM -> Set bad channels';
bst_error(msg, '[Hb] quantification', 0);
return;
end

The check for negative values is done on all data, including AUX. This is an issue when AUX channels contain negative values. Check should probably occur after NIRS data is separated from AUX data:

% Separate NIRS channels from others (NIRS_AUX etc.)
[fnirs, fchannel_def, nirs_other, channel_def_other] = ...
filter_data_by_channel_type(good_nirs, good_channel_def, 'NIRS');

GLMs on the different level

Hi,

I was wondering whether someone could help me with getting started on performing GLM's on fnirs data as I have little experience with neuroimaging in general.

I already noticed that there is a tutorial on this, although it is still in progress.
https://github.com/Nirstorm/nirstorm/wiki/%5BWIP%5D-GLM

Also, I found a training a few months back at the developers' university. I was wondering whether there are slides of the GLM's which could be shared?
https://www.concordia.ca/research/perform/research/events/nirstorm-training-20200129.html

In sum, the questions I have is:
Could someone briefly explain me how to get started on the different GLM's that are accessible in the Nirstorm menu of the pipeline editor?

Many thanks in advance

Guy

CAT12 segmentation order

Hi Edouard,

We spoke last time about the little option in nirstorm for the 5 tissues, I see that in the latest release you have added the option of choosing between the nirstorm format (1) skin 2) skull 3) csf 4) gm 5)wm or the standardized format.

However I see that for the standardized option we have 1 for WM and 2 for GM, while SPM/CAT segmentation give you 1 for GM and 2 for WM.

I also checked the added lines from Francois which also confirms 1 for GM or 2 for WM ??

If possible to double check.

Thanks
Capture

Scale of the sensitivity model

Dear developers,

I have been using the sensitivity modelling for deciding on my fNIRS montages during experiments. However, I came up an issue that makes me wonder whether I am appropriately interpreting the model.

When plotting the sensitivity model (summed sensitivities or separate for channels), the scaling factor (the color plotting on top of the brain) is a dimensionless number (no units).

I noticed that the scale is entirely different than the one used in AtlasViewer, which is also dimensionless.

As can be seen in the first figure, AtlasViewer uses a 'standard-scale' ranging from 0 to -2. In this specific example I plotted the sensitivity of the channel comprising of source 10 and detector 5

image

As can be seen in the following figures related to Nirstorm. There are some substantial differences.

The first figure shows the montage
image

If I plot the sensitivity model for the channel comprising of source 10 and detector 5, I get the following visuals when I use colormap > sources > maximum local. The scale can be seen in the bottom right

image

If I want to get a similar surface area in nirstorm (as in atlasviewer). I get this result. The scaling factor is arbitrarily chosen to get the same surface. Again the scale can be seen in the bottom right.

image.

As can be seen in both nirstorm figures. the scale is completely different than the one of atlasviewer. I was wondering where this difference originates from and if there is a way for myself to verify that the scaling factor across both softwares is roughly similar.

Best wishes and many thanks in advance

Guy

Cortical Reconstruccion Tutorial

Hi, I am new with nirstorm as well Brainstorm.
I am trying to follow the cortical reconstruction tutoria. However I can't download the sample_nirs_reconstruction.zip .

Is it not avaliable anymore?

fmri activation map

Hello Edouard,

In the last workshop, a fmri activation map was included in the data section of the cortical reconstruction demo.

From what I know brainstorm does not handle fMRI data, but it can be important as a comparison with fnirs data specially for reconsturction.

Did you import it after analyzing it in freesurfer (and using the import freesurfer folder option), I would be interested in doing the same if possible, currently I'm using SPM to analyse our fmri data.

Thank you

Alex

Computing GLM

Hello;
This ticket is here to track our implementation of the GLM in nirstorm. So we are going to implement the computation of the design matrix; then we are going to implement the GLM using AR(1) model

Head model computation

Hello @thomas-vincent,

I have a problem when computing the separations between sources and detectors.

In an assignment  A(:) = B, the number of elements in A and B must be the same.
Error in process_nst_separations>Compute (line 138) separations(ipair) = euc_dist(montage_info.src_pos(src_idx, :), ...

Error in process_nst_import_head_model>Run (line 302)
separations_by_pairs = process_nst_separations('Compute', ChannelMat.Channel, pair_sd_idx);

This is due to the fact that in our case :

montage_info.src_ids = [1,2,3] 
montage_info.det_ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17]

But in order to indicate the channel S3D17, pair_ids will contains [ 3 16] instead of [3 17]
so det_idx = montage_info.det_ids == pair_ids(ipair, 2); won't work.

I really think e988cfd (revert in 4525ff7) is a good fix for that issue.

Best,
Edouard

Issue with Import from Database - epoch time and baseline

Hello,

I am attempting to perform block averaging on [HbO][HbR] data and have encountered an issue with the display panel when attempting to perform block averaging.

When I select an event and try tp set an epoch time of -10 to 55s, the value resets from 0 to 100s as soon as I press on something else in the panel. The same occurs for Time Range in "Remove DC offset", which by default returns to 0 to 100ms.

There is no error message that appears upon launching the averaging. Matlab Command window will simply show "BST. Block too small, ignoring".

Please let me know how to fix this error with the gui.

Thanks,
Amanda

Computing optimal montage

Hello,

when I go through a tutorial on Optimal montage computation I run into error:

** Error: [process_nst_OM_from_cortex] NIRS > Compute optimal montage from cortex
** Line 416: Unrecognized function or variable 'ivoi'.
**
** Call stack:
** >process_nst_OM_from_head.m>compute_optimal_montage at 416
** >process_nst_OM_from_head.m>Compute at 271
** >process_nst_OM_from_head.m at 34
** >process_nst_OM_from_cortex.m>Run at 58
** >process_nst_OM_from_cortex.m at 23
** >bst_process.m>Run at 229
** >bst_process.m at 36
** >panel_process1.m>RunProcess at 151
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 760
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 293

I tried installing an earlier version of brainstorm and an earlier version of nirstorm, but that didn't help. Does anyone know how to solve the issue? I am using Matlab R2019b, Windows.

Kind regards,
Liza

Project channels on cortex

Hello,

I am trying to coregister fNIRS and subject specific MRI data. What I need are MNI coordinates of the channels projected on the cortex in order to compare fNIRS and fMRI data.

Is that somehow possible?

Thank you and kind regards.

Brainstorm compilation issue

COMPILE> MCC returned an error:
Error while determining required deployable files. Compilation terminated. Details:
Error using parseFile (line 13)
MATLAB code 'C:\Users\franc\.brainstorm\plugins\nirstorm\nirstorm-master\test\BstHelperTest.m' contains the following syntax error(s):
 Line 60 column 18 : The current use of 'test_run_proc_duplicate_outputs' is inconsistent with its previous use or definition (line 25).

Can you please check what this is about?
For the moment, I just removed the test folder before compiling.

motion correction error with new brainstorm version

Hello Thomas,

When trying to run the motion correction, I get the following error:
Error: [process_nst_motion_correction] NIRS > Motion correction
** Line 98: Reference to non-existent field 'samples'.
**
** Call stack:
** >process_nst_motion_correction.m>Run at 98
** >process_nst_motion_correction.m at 23
** >bst_process.m>Run at 196
** >bst_process.m at 36
** >panel_process1.m>RunProcess at 151
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 759
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 292

I also tried with a demo file from the workshop same issue

Don't really know what is causing this issue

Thank you

Clarification on nirs processing

Hi,

I open this issue so we can discuss the point raised by PR #115; especially when remove superficial noise using short-distance-channel.

As I understand, the main pipeline currently is something like :

  1. Import data
  2. Motion correction
  3. Detect bad channels
  4. MBLL or doD removing SSR
  5. IIR filtering
  6. Block average or GLM
  7. MEM or MNE (if computed dOD in 4) [done before 6 if GLM]

So if I understand it well, we should separate the superficial noise regression from the dOD computation and the pipeline would become :

In the case of block averaging :

  1. Import data
    2.a Detect bad channels
    2.b Motion correction
  2. Compute dOD
    4.a Regress out signal from short-distance channels (or external measurement such as accelerometers )
    4.b IIR filtering
  3. MBLL or step 7.
  4. Block average or GLM
  5. MEM or MNE (if skipped step 5)

With the exception that in case of GLM, you have to skype step 4.a and regress those signals out during GLM.

  1. Questions:

a. should we do motion correction after dOD computation? The advantage is that we don't have to worry about negative value induced by the process and remove the offset introduced in 2d34b50 that was making us worry during the mini-course presentation.

b. Line 499 in the computation of MBLL it is written, about the extinction coefficient, "%TODO: use same values as Alexis". Do you have any information concerning this TODO?

  1. Changes :
    Therefore here is the change we have to make :
    1/ we can remove MBLL_SRR and dOD_SRR
    2/ Add a process to regress out signal from the short-distance channel (can be change latter to also regress out signal from the accelerometer)
    3/ Change MBLL so it akes dOD as input.

Am I correct?

Best regards,
Edouard

cplex error

Hello Edouard,

I've been receiving an error for the CPLEX calculation of the optimal montage since I made the update to the new version of nirstorm.

I tried using the optimal montage tutorial and I get the same error.

I use CPLEX 12.8 (which use to work before), but according to the error I might need 12.3 ?

I tried also with the latest version of CPLEX, but no luck. As for 12.3 it is no longer available for download on the IBM website.

Any help on your free time would be appreciate it

Thanks

Capture1

Capture2

'Review' on nirstorm

Dear developers,

I have been exploring nirstorm for quite some time now. Last Friday, I presented the toolbox at the journal club of our research group and I want to provide you with the general opinion of our group as constructive feedback. Although we are unsure whether we will continue with nirstorm, I hope this feedback can help you regardless of it.

Pros:

  1. The GUI is intuitive and provides very efficient pipeline editing.
  2. The visualizations might be the best so far. We are unaware if other fNIRS toolboxes can do cortical reconstruction ('solving the inverse problem')
  3. your optimal montage design is an incredible useful tool for research groups like ours which are interested in topography

Cons:

  1. Data processing seem to be limited. Even though detrending and bandpass filters are possible, the field is slowly moving towards more complex techniques such as ICA or PCA.
  2. The toolbox can sometimes feel counter-intuitive . For instance, it possible to see the montage on top of the head (although it is not possible to show the brain below the montage/channels). Another example: It is not possible to select channels of interest and only presenting them on the brain (akin to showing the sensitivity model for specific channels)

It is possible that some of the cons I mention are caused by (a) me having missed some things or (b) the relatively young age of the toolbox. Regardless of this, I hope this feedback can be useful for this wonderful project. Please let me know if you have any questions.

Best wishes

Guy

Issue with segmentation

Dear community,

I'm trying to compute the fluency model relying on default anatomicals.
In a recent study, we collected data by placing optodes following the 10-20 system which uses the ICBM-152 template for optode positioning.

However, I am stuck on the problem that I do not have the fMRI segmentation. See error in image
compute_fluence_issue.

In addition, when I try to calculate this segmentation in the anatomy screen using cat12:
right-click MRI: ICBM152 > cat12 MRI segmentation, I get the following error:

cat12_issue

Does anyone know how to solve this issue of not getting the segmentation for the default anatomicals (such as Collin, ICBM-152))?

Many thanks in advance

Guy Rens

Improve file organization

Hello,

Currently, we have 78 files in the bst_plugin folder which make it difficult to find a specific process.

So, i suggest we adopt the same folder convention as brainstorm :
bst_process/
|-- core/ contains the main process ( bst_call,bst_process,nst_run_bst_proc and bst_error)
|-- IO/ all the input/output process (nst_request_files, nst_get_bst_func_files, nst_save_figure, import_event...)
|-- math/ for all the mathematical computation ( knn-research, voronoi diagram)
|-- misc/ contains all the utility process ( nst_filter_table, nst_get_local_user_dir, ...)
|-- preprocessing/ contains all the pre-processing process (detect bad channels, filtering, Hb computation)
|-- GLM/ all the GLM process
|-- inverse/ and Forward/ for the inverse and forward computation

What do you think of this organization ?
if it's ok for you, I make a draft of what the folder will look likes using this organization.

Best regards,
Edouard

More Generic API for GLM

Hi @thomas-vincent

This discussion is related to the last lab meeting we had with the NIRSTORM team and #117.

Context:

  • We want a process to enhance the linear detrending that offer brainstorm by also removing the slow frequency (eg instead of using a high-pass filler)
  • As you explained in #115 , we want a process to remove physiological fluctuation coming from superficial layer
  • We want, in the GLM, to be able to add easily new regressor such as the short-separation channel (what you added in #115)

Those 3 points are all related to GLM. In the first two we say Y=XB + e and we want to return e, therefore removing the effect of the regressor in X. In the first case X contains DCT, in the second X contains the value of the SSC. The thirds case, is also similar but we want B.

Problem:

As you have seen, adding a new regressor in X is not easy and therefore your addition in #115 is really hard to maintain and to understand for exemple if we were to add new regressor such as accelerometer data.

What I suggest:

Having a small structure called model that contains our GLM, and a set of function that will interact with it to do what we want : - add regressor, fit the data, display the design matrix...

The structure:

  • X : design matrix (time*n_regressor)
  • reg_names: 1* n_regressor cell containing the regressors name.
  • n_roi : Number of regressor of interest. (present in the first column of X)
  • ntime : number of time point
  • fs : signal frequency

API:

  • model=initialize_model(ntime,fs)
    return an empty structure

  • model = add_regressors(Model, Regressor_type, params)
    Add regressors to the design matrix. Call one of the following function depending on the regressor type (eg "event", "channel", "constant", "DCT"). Can be extended easily to have more regressor type.
    model = add_regressors(Model, "event", Events, basis_choice, hrf_duration)
    model = add_regressors(Model, "channel", channel_names, [convolve_with_hrf=0, basis_choice, hrf_duration]) Note: if convolve_with_hrf=1, then convolute the regressor with HRF like for event based regressor. Typically if the channel is AUX that contain the paradigm of the experiment
    model = add_regressors(Model, "constant") Add a regressor that just contains 1.
    model = add_regressors(Model, "DCT", frequences, names)

  • display_model(model)
    Display the model

  • [B, proj_X] = model_fit_B(model, y, method='SVD')
    Return the B, and the corresponding projector base on the method. Method is either 'SVD' or 'pinv' In case of pinv, proj_X = ( X^{T}X)^{-1} X^{T}

  • [B, covB, dfe, residuals, mse_residuals] = model_fit(model, y, [method='precoloring', fitoptions])
    Call the corresponding method to fit the model depending on the chosen method. ( pre-coloring by default)

  • model = model_apply_IIR_filter(model, filter_type, low, high)
    Apply the IIR filter on the regressor of interest (eg the n_roi first column of X)

Its quite easy to do, as all the material exist. but can really simplify the code for case 1, and 2 :
1/

model=initialize_model(ntime,fs) 
model= add_regressors(model, "DCT",  freq, freq_name);
B=model_fit_B(model, y);
y= y - X*B;   

2/

model=initialize_model(ntime,fs) 
model= add_regressors(model, "channel", superfical_chann);
B=model_fit_B(model, y);
y= y - X*B;   

Don't hesitate if you have comment :)
Best regards,
Edouard

NIRSTORM process('GetDescription') calls are terribly slow

Parsing the NIRSTORM process folder does some super slow I/O operations.
It takes most of the total parsing time and doubles the initial Brainstorm startup time (~1.5s for each process_nst_*.m vs. ~0.01s for all the other Brainstorm processes).
As mentioned before, the functions GetDescription should not do anything but returning a flat structure: no subfunction calls allowed.
Please fix ASAP.

profile on;
panel_process_select('ParseProcessFolder', 1);
profile viewer;

image

Thanks!

[Brainstorm] Handeling demographics data

Hi.

Today there is no structure in brainstorm that can handle demographic data such as sex or age. As we might need it to perform group analysis I think it could be a good idea to discuss our need here before submitting the idea to brainstorm.

So i thought we could add a a new structure in the subject structure to handle those data. For example :

[sSubject,iSubject]=bst_get('Subject', 'S01')
age= sSubject.demographics.age;

Moreover, having access to demographics data could be usefull to process the MBLL.
Best,
Edouard

Scout selection for optical montage error

Hi Thomas,

I've encountered another issue regarding the selection of cortical scout for the optimal montage.

I tried resetting the process option, running the panel_process command and restarting brainstorm, but I still have an empty list in the cortical scout selection.

I'm using the latest version of nirstorm on braintstorm from May 2019

Thank you in advance

Alex

importing .nirs file probe array

Hello,
I apologize if this is listed in the wrong section. I am exploring nirstorm and have been a heavy user of both Homer2 and NIRSToolbox (AnalyzIR). The probe array for my .nirs data seems to cause a distortion when I bring it into nirstorm. I get the following error:

CHANNEL_TESSELATE> WARNING: Some sensors are not in the Faces list: 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
BST> Not enough digitized head points to perform automatic registration.

I have x,y,z coordinates for each of the optodes. But is there any way I can edit the .nirs file so that I can overlay the probe onto the subject-specific anatomy?
Any help would be greatly appreciated.
Thank you for your time in advance,

Ryota

Voronoi and head model error in workshop 2020

Good afternoon Thomas/Zhengchen and Edouard,

I recently trying testing again nirstorm and have a few issues/questions.

First, when trying to calculate Voronoi and head model in the cortical reconstruction demo provided in the workshop 2020, I face 2 errors.

These errors are not present in the demo from the 2018 workshop (ONLY in the demo provided in 2020). I dug a bit and realized that in the 2018 demo we have the 5 tissues segmentation, but not in the 2020 workshop (present but when you view it there is nothing.

If you could please confirm if that might explain why I get this error in the demo from 2020 but not 2018.

Also, while I was able to calculate the voronoi and head model in the 2018 demo, the size of the voronoi and head model were quite different from the one present originally in the demo. I was still able to extract the sensitivities and perform a simple cortical reconstruction, but again is it normal to have different sizes despite the same data (visual task provided in the demo)? I included in a zip file the old and new voronoi and head model

subjectimage_T1_tess_cortex_mid_high_25000V_voronoi_ORIGINAL / 1.5 MB
subjectimage_T1_tess_cortex_mid_high_25000V_voronoi_RECALCULATED / 1.2 MB
headmodel_nirs_mcx_fluence_ORIGINAL / 7 MB
headmodel_nirs_mcx_fluence_RECALCULATED / 0.2 MB

Size_diff.zip

Thanks again

Voronoi error

image

Head model error

image

5tissue segmentation from the 2018 workshop
image

5tissue segmentation from the 2020 workshop
image

voronoi from the 2018 workshop / ORIGINAL
image

voronoi recalculated from the 2018 demo / RECALCULATED
image

Thank you again all in advance

Improve template

The current template Colin27_4NIRS contains high resolution cortical surfaces (eg mid_highres).
Each one has more than 300 000 vertices which seems useless since we're dealing with large anatomical uncertainty anyway by using the template instead of the subject MRI.

Besides, having low resolution cortical surfaces would be profitable to perform fast surface-based data processing.

In short, let's:

  • get rid of the highres surfaces
  • add low res surfaces (5000 vertices)

Compute Fluences Error

Hi Thomas,

I am recently getting an error when trying to compute fluences from optodes. I thought maybe it was related to my mcx, I also tried it on the nirstorm workshop back in 2018 and I get the same error. If you could please help.

** Error: [process_nst_ComputeFluencesforOptodes] NIRS > Compute fluences for optodes by MCXlab
** Line 307: Undefined function 'surfacenorm' for input arguments of type 'double'.

Thank you in advance

Alexandra T.

Reading .nirs file created by nirslab

Hello.

I've try to import .nirs file produced by nirslab. The importation process does't work because the structure doesn't have any 'ml' field.
The list of of source-detector channels is written in nirs.SD.MeasList;

The code bellow create the ml field if it doesn't already exist :
$ if ~isfield(nirs, 'ml')
nirs.ml=nirs.SD.MeasList;
end $

MBLL using Light path length correction

Hi.

I have an error when computing MBLL using Light path length correction :

** Error: [process_nst_mbll] NIRS > MBLL - OD to delta [HbO], [HbR] & [HbT]
** Line 387: ./
** Matrix dimensions must agree.

In order to have the same dimension line 387 should be :
delta_od_fixed = delta_od ./ repmat(ppf', 1, nb_samples); instead of delta_od_fixed = delta_od ./ repmat(ppf, 1, nb_samples);

Best,
Edouard

Scaling issue and normalisation

Hi.

We have face an issue this morning with Mélanie, often the visualisation of our data on the 3D-optodes doesn't work well as we don't have access to the scaling map : it's often set to 'invalid scale'

I think this is due to the fact that we currently use the 'meg colour map' when displaying our data which are in mmol.L-1. So I've made this PR( brainstorm-tools/brainstorm3#105 ) to brainstorm to add a nirs colour map It seems to work well in local ( it mainly set the fFactor to the correct factor according to the DisplayUnits) .

we can use with the following code when saving a data. :

    Out_DataMat.ColormapType = 'nirs';
    Out_DataMat.DisplayUnits = 'mmol.l-1';

The second part of this issue concern units and normalisation in general ; Melanie suggested me that we add an option in the MBLL to express concentration as a % variation of the baseline. We could add an option to either output concentration or % of variation. ( Apparently working with % of variation is very common in fMRI studies ) and could lead to a better interpretation of our data

Best,
Edouard

Protocol creation in Brainstorm

Hello @thomas-vincent ,

I have a weird bug since yesterday. I can't create protocol in brainstorm anymore,
I 've tried to reinstall brainstorm and it was working well until I reinstall nirstorm.

Did you already had this issue ? Here is the error that I get when creating a new protocol :

`Warning: Default subject cannot be reached for this protocol.

In db_links (line 66)
In db_links (line 38)
In db_load_studies (line 166)
In db_reload_database (line 77)
In db_load_protocol (line 78)
In gui_brainstorm>SetCurrentProtocol (line 1030)
In gui_brainstorm (line 33)
In gui_edit_protocol/updateProtocolModificiations (line 180)
Warning: Default subject cannot be reached for this protocol.
In db_links (line 66)
In db_links (line 38)
In db_reload_database (line 80)
In db_load_protocol (line 78)
In gui_brainstorm>SetCurrentProtocol (line 1030)
In gui_brainstorm (line 33)
In gui_edit_protocol/updateProtocolModificiations (line 180)
Struct contents reference from a non-struct array object.

Error in db_set_template (line 40)
targetDir = bst_fullfile(ProtocolInfo.SUBJECTS, bst_fileparts(sSubject.FileName));

Error in gui_edit_protocol/updateProtocolModificiations (line 190)
db_set_template(0, sTemplate(1), 0);`

Rename functions already defined in Matlab

I strongly advise you do not distribute any function that have the same name as a Matlab function.
This can create bugs that are very difficult to debug in other toolboxes that rely on these functions. I lose a lot of time because of this, we have a few of these every month on the Brainstorm forum.

I'd recommend your rename strjoin, strsplit, webread and websave by adding a nst_ prefix.

Cat12 segmentation 5 tissue values

Hello Edouard,

I recently updated brainstorm and cat12 to the latest version and having some issues with the voronoi calculation.

The 5tissues segmentation obtained from CAT12 seems "not compatible".

The values on the legend go from 0 to 250 which I don't understand why, even if each segmentation is correct (here CSF = 3).

I tried using an old version of the 5tissues segmentation and it works (legend goes from 0 to 5, which is what I expect). Do you have any idea why this is happening?

Thank you in advance
Capture

Compute fluences for optodes by MCXlab missing

Hello Vincent,

I've been trying to use NIRSTORM since the last training to analyze some visual data. Since I'm not to familiar with MCXlab, I would like to use the option in nirstorm to compute fluences. However, I can't seem to find this function/option.

Could you please help

Thank you

Alexandra Terroci

Error: Compute Voronoi volume-to-cortex interpolator

Dear developers,

(https://github.com/Nirstorm/nirstorm/wiki/Cortical-reconstruction-with-MNE-and-MEM)
When following the cortical reconstruction tutorial and using its data set I have the following problem.

I am going through all the steps of the tutorial and I want to perform the step 'compute Voronoi volume-to-cortex interpolator'.
The steps I undertake are: Go to anatomical view > click run in the pipeline editor/command window > nirs > compute Voronoi volume-to-cortex interpolator.

When I run these steps when only nirstorm directory is added to the path (not its subfolders), I get the following error:
image

When I run these steps when nirstorm directory and its subfolders are added to the path I get a similar error:

image

Last, I can find dg_voronoi files in both the directory

'Documents\GitHub\nirstorm\bst_plugin\math' as well as in the .brainstorm folder.
Because of this, I was thinking that this issue might be coming from nirstorm rather than brainstorm?

Does anyone know how to solve this?

Many thanks in advance

Guy

glm for different task duration

Hello Edouard,

Hope you are doing well, I have a question about the GLM (1st level) option in nirstorm.

I currently have 3 conditions, each with a different length (e.g grasping left 20s, grasping right 30s, and grasping both 25s, and resting 20s before each grasping).

I know that in the tutorial you have on the wiki you only have 1 condition plus rest, that is why you have "GraspingRight, Rest" in the design matrix.

Does your GLM allow for different conditions with different duration and if so, how should I add in in the design matrix (e.g GraspingRight, Rest; GraspingLeft, Rest; GraspingBoth, Rest) or just (GraspingRight, GraspingLeft, GraspingBoth, Rest)? and same question for the contrast vector (+GraspingRight, -Rest; +GraspingLeft, -Rest; +GraspingBoth, -Rest).

Thank you in advance

Alex

installation fails

I try to install nirstorm on a windows machine. Brainstorm has been already installed. I get the error below. Do you know what could be the problem?

nst_install('copy')
Warning: "brainentropy" already exists in target directory. It will be backuped to
"_backuped_by_brainentropy_nst_fork_brainentropy"
In install_package>resolve_file_operations (line 192)
In install_package (line 75)
In nst_install (line 70)
Installing brainentropy--nst_fork to C:\Users\fd301.brainstorm...
Warning: Escaped character '\U' is not valid. See 'doc sprintf' for supported special characters.
In install_package>execute_file_operations (line 247)
In install_package (line 77)
In nst_install (line 70)
Error using install_package>execute_file_operations (line 247)
Target C:

Error in install_package (line 77)
execute_file_operations(install_operations, dry);

Error in nst_install (line 70)
install_package('brainentropy', 'best_fork', bst_folder, mode, {}, dry);

NIRSTORM Mini Course 2020

Hi, I am new with nirstorm.
I am trying to follow the NIRSTORM Mini Course 2020. However I can't download the Nirstorm_workshop_PERFORM_2020.zip .
Is it not avaliable anymore? I look forward to your favourable reply.

Merging two files from left and right hemisphere of the type cMEM sources - HbO | avg(5.000s,20.000s)

Hello,

I am working with recordings that are obtained on left and right hemispheres and have run cMEM on each side and then taken time averaged a window of 5s to 20s to obtain a reconstruction of the time average response during that window. I would like to have the right and left map together in one figure. After looking at several function in Brainstorm, I cannot find any function to merge them, and when I export to Matlab and join them in a 1x2 struct and try to reimport, the file in not supported by Brainstorm.
Is there a specific function to do so or must my maps remain separate if all the processes have been run separately on left and right hemispheres?

Thank you,
Amanda

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.