Dear SPM Experts,
I am a beginner of SPM. I am trying to apply DCM to my EEG data, and I would like to ask you about the batch script to convert EEG data files preprocessed by EEGLAB to SPM data files.
I understand that SPM data files must be independently divided to multiple data files corresponding to each experimental condition. My EEG data files of 31 participants include 6 event markers corresponding to 3 experimental conditions (2 event markers for 1 condition). I have thus made 93 EEG data files. I could convert each EEG data file to SPM data file on Batch Editor of SPM12. However, I cannot specify multiple EEG files on Batch Editor. I would like to avoid the manual repetitions of convert process. Can I write a batch script for conversion of multiple EEG data files? The description of m files are given below. I really appreciate any comments and suggestions. Thank you in advance.
---------------------------------------
% List of open inputs
nrun = X; % enter the number of runs here
jobfile = {'/Users/Warehouse/Document2/inference2018/forSPM/eeglab_convert_spm_job.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'EEG');
spm_jobman('run', jobs, inputs{:});
%-----------------------------------------------------------------------
% Job saved on 12-Jun-2018 22:34:56 by cfg_util (rev $Rev: 6942 $)
% spm SPM - SPM12 (7219)
% cfg_basicio BasicIO - Unknown
%-----------------------------------------------------------------------
matlabbatch{1}.spm.meeg.convert.dataset = {'/Users/Warehouse/Document2/inference2018/forSPM/control/Adachi_M_control.set'};
matlabbatch{1}.spm.meeg.convert.mode.epoched.usetrials = 1;
matlabbatch{1}.spm.meeg.convert.channels{1}.type = 'EEG';
matlabbatch{1}.spm.meeg.convert.outfile = 'adachi_m_control';
matlabbatch{1}.spm.meeg.convert.eventpadding = 0;
matlabbatch{1}.spm.meeg.convert.blocksize = 100;
matlabbatch{1}.spm.meeg.convert.checkboundary = 1;
matlabbatch{1}.spm.meeg.convert.saveorigheader = 1;
matlabbatch{1}.spm.meeg.convert.inputformat = 'autodetect';
——————
Sincerely,
******************************************
Shingo Tokimoto, Ph.D.
in Linguistics and Psychology
Department of Foreign Languages
Mejiro University
4-31-1, Naka-Ochiai, Shinjuku, Tokyo,
161-8539, Japan
[log in to unmask]
******************************************
|