Hi everyone,
I need to compute sources from some EEG task data. To that purpose, I am computing noise covariance matrices from resting state data. Task and resting state data are organized in separate folders. As such, I am not able to make brainstorm use the noise covariance to compute sources from the task data. What could be a workaround to this? Possible alternative solutions I thought of:
- must necessarily include task and resting data in the same folder.
- I should copy/move the noise covariance matrix from the resting to the task folder; how to do that via script? The
copycond
parameter of process_noisecov
is not a good solution as I'd need to select a specific folder to move the matrix to.
- Any way to indicate the path to the noise covariance matrix when computing sources?
Thank you in advance,
Ramtin
Hi Ramtin,
See the script below to copy the computed noise covariance to a specific folder.
Best,
Raymundo
% Input files
sFile = 'Subject01/@rawS01_Noise_20131218_02_600Hz_notch/data_0raw_S01_Noise_20131218_02_600Hz_notch.mat';
% Process: Compute covariance (noise or data)
sFile = bst_process('CallProcess', 'process_noisecov', sFile, [], ...
'baseline', [], ...
'datatimewindow', [], ...
'sensortypes', 'MEG, EEG, SEEG, ECOG', ...
'target', 1, ... % Noise covariance (covariance over baseline time window)
'dcoffset', 1, ... % Block by block, to avoid effects of slow shifts in data
'identity', 0, ...
'copycond', 0, ...
'copysubj', 0, ...
'copymatch', 0, ...
'replacefile', 1); % Replace
% Get iStudySource for Study folder where noise covariance was computed
iStudySource = sFile.iStudy;
% Get iStudyTarget for target Study folder
subjectNameTarget = 'Subject01';
studyNameTarget = 'S01_AEF_20131218_01_600Hz_notch';
[~, iStudyTarget] = bst_get('Study', bst_fullfile(subjectNameTarget, studyNameTarget, 'brainstormstudy.mat'));
% Copy to specify iStudyTarget
isDataCov = 0; % 0, copy noise covariance matrix
ReplaceFile = 1; % 1, replace existing file in target Study. See import_noisecov.m for other options
db_set_noisecov(iStudySource, iStudyTarget, isDataCov, ReplaceFile);
2 Likes