Automatic creation new subject and condition

Hello dear Francois,

Before applying ICA, I want to remove the bad segments, due to their adverse effects on ICA performance. I know that Brainstorm doesn’t allow any time jump in one subject folders (conditions). Hence, I want to remove the bad segments from my Raw data using my code in Preprocess>Run Matlab command and also I want to modify my event file contents and then save the results in a new subject and in a new condition folder in that new subject. I am able to remove bad segment and modify event file, but what I don’t know how to do that is automatically creation one subject and condition folder in it using Preprocess>Run Matlab command and also (after creation condition folder) saving modified data as raw file and saving corresponding modified event file in created condition?

I read the following link but it is only for matrix format data not raw one.
http://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Custom_processing.

I want to automatically do this job not by (*importing data base>save in matlab>reject bad segment and modify event file>save data and event file>create subject and condition>load data as row file).

Ok, I create the subject manually but at least I want to be able to create condition, save modified data and events in created subject and condition automatically and only by Preprocess>Run Matlab command.

How can I do that?

Thanks,
Talesh

Hello

If you are creating new files that are not simple math operations on the input recordings, you should write your own process (= plugin), not use the “Run matlab command” process.
See this tutorial: http://neuroimage.usc.edu/brainstorm/Tutorials/TutUserProcess

For a simple example that creates new subjects or folders, check the code of process_simulate_matrix.m.

This would have the advantage of being something that we could redistribute, if you think this is interesting for other users.

Cheers
Francois