Dear all,
I am currently working on a project that involves processing a large number of samples using Brainstorm's time-frequency analysis. For each sample, after the time-frequency processing, I need to export the results for five different frequency ranges (delta / 2-4 Hz / mean, theta / 5-7 Hz / mean, alpha / 8-12 Hz / mean, beta / 15-29 Hz / mean, gamma1 / 30-59 Hz / mean).
The problem I am facing is that I have to manually export each .mat file for each frequency range through the GUI. Specifically, the process I follow is:
Files to process: time-freq - run - export - export to files - export - select frequency range(click through each file and frequency manually)
Given the large number of files I am dealing with, the manual processing for each file and frequency range becomes extremely time-consuming and impractical.
I have attempted to include commands in the export script (for instance, freqRange = [8, 12]; % Alpha frequency range), but this method has not yielded the desired results.
sFiles = {};
RawFiles = {};
% Attempt to define frequency range in the script
freqRange = [8, 12]; % Alpha frequency range
% Further commands to process and export
% Start a new report
bst_report('Start', sFiles);
% Process: Export to file: Timefreq
sFiles = bst_process('CallProcess', 'process_export_file', sFiles, [], ...
'exporttimefreq', {RawFiles{1}, 'ASCII-CSV-HDR'});
% Save and display report
ReportFile = bst_report('Save', sFiles);
bst_report('Open', ReportFile);
Unfortunately, my attempts have not been successful. Therefore, I am reaching out to see if anyone in the community has any suggestions or knows of an alternative method to simplify this process. Ideally, I am looking for a way to batch select the frequency ranges and export the files, rather than having to click through each file and frequency manually.
Any help or advice you could offer would be greatly appreciated. Thank you for your time and assistance.
Thanks a lot,
Yangyang