Question regarding exporting files

Hi!

I have a problem regarding exporting some files.

I have 150 subjects, with 3 source files for each subject, thus having 450 source files.

Is there any way of exporting all these source files to Matlab/to external files at once? (i.e. using only a few clicks to export all files)

Now I'm clicking on each file and pressing "Export to file"/"Export to Matlab", but this is quite slow. If Brainstorm provides a faster way to do that it would be perfect.

Thank you in advance!

Hi Victor,

Here's one way to do this via a script: You could get the file path of all your source files of interest by dragging and dropping them in the Process1 tab, make sure to select "Process sources", and then right click on the list and choose "Copy list to clipboard". Then, create a script with this list of source files as input and simply make a loop that calls the Brainstorm function export_result() to export each source file.

Let me know if you need more help with this.

Martin

Thank yout very much Martin!

I need a few days to test it cause now i'm not in the lab. I will let you know if it works

Thank you again!!

Hi Victor,

There are many other solutions, but it depends more specifically on what you are expecting to do with these "exported" values.

All the information in the Brainstorm database is stored as Matlab .mat files, you can readily load them with the matlab function load(), or with the low-level reading function of Brainstorm (in_bst_*.m). The structures of the files are described in the sections "On the hard drive" at the end of various introduction tutorials.
To get the list of file names, you can proceed as described by Martin, or use the process "File > Select source files" at the beginning of your script.

If you are interested at only a subset of each of these files (eg. on single scout, or the average over a short time window), you can extract all the values of all the files and get the output concatenated in one single output file.

Have a look at the Scripting tutorial before trying to write your own scripts, you might find better ways of proceeding:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting