Extenal Call bst_connectivity

Hi experts,
Thank you, Francois, for your fast and effective reply every time.
I am trying external call bst_connectivity but seems there is no 'Compute' option as some other function.
Therefore, is that possible to call bst_connectivity external? And what is the format of FilesA and FilesB?

bst_connectivity is called from the connectivity processes.

If you want examples on how to use it:

  • set the current Matlab folder to the brainstorm3 folder,
  • use the "Find files" tool in Matlab (Ctrl+Shift+F) with the option "Include subfolders" selected
  • search for files containing "bst_connectivity"
  • you should find about 30 processes (process_granger1, process_cohere1, etc...)
  • double-click on the found items to jump to the code.

Other option: use the pipeline editor to generate scripts calling the process you need (instead of bst_connectivity directly):
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Starting_a_new_script

Thank you Francois.
Yes, I found these processes by vscode search. And your pipeline editor is awesome to generate pipeline.
Now the situation is when I got an inverse result (voxels*time) from other toolboxes and want to try all connectivity method you provide here(sorry, the reason is that I am too lazy to reproduce:sweat_smile:).
I don't know how to pass this to these processes or the backend bst_connectivity.
Or I can just replace the ImagingKernel or ImageGridAmp in result file?
Thank you.:rofl:

You won't be able to call bst_connectivity easily. This function takes as inputs files available in the database. If you don't have your source signals in the database, you'd have to read the code of bst_connectivity.m and try to understand what are the subfunctions that are called.

Creating a file in the brainstorm database and then replacing only the ImagingKernel or ImageGridAmp matrix is probably easier:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Custom_processing
https://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation#On_the_hard_drive