Dear all,
I am new to fMRI analyses using coding for SPM preprocessing.
I have been rewriting a batch script file.
But, I do not find how I can reword the img file names in the following example I got from the batch file to the next scripts.
Ultimately, I want to succeed in loop processing.
I understand this is quite basic question, but I'd be glad if someone could give me a clue.
matlabbatch{1}.spm.spatial.realign.estwrite.data = {
{
'H:\fMRIdata\sub1\a001.img,1'
'H:\fMRIdata\sub1\a002.img,1'
'H:\fMRIdata\sub1\a003.img,1'
}
}';
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.quality = 0.9;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.sep = 4;
clear all
basedir = 'H:\fMRIdata\sub1';
file = spm_select('List',basedir, '^a.*\.img$');
File = strcat(basedir,'\', files,',1')
Files =cellstr(File)
matlabbatch{1}.spm.spatial.realign.estwrite.data = {
{
Files
}
}';
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.quality = 0.9;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.sep = 4;
Thanks
Luis
|