Hi,
I have made a batch for analysing fMRI images, and now I want to use it for many subjects. I have saved my batch with 'save batch & script' because I have been told that I could run it for all my subjects without having to click for every subject if I put it in a loop. I have constructed a loop around the skeleton code provided by matlab but I do not quite understand how to make it work.
This is the skeleton code:
% List of open inputs
% Realign: Estimate & Reslice: Session - cfg_files
% fMRI model specification: Directory - cfg_files
nrun = 1; % enter the number of runs here
jobfile = {'/home/mr/karlu264/model/design/test_job.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(2, nrun);
for crun = 1:nrun
inputs{1, crun} = MATLAB_CODE_TO_FILL_INPUT; % Realign: Estimate & Reslice: Session - cfg_files
inputs{2, crun} = MATLAB_CODE_TO_FILL_INPUT; % fMRI model specification: Directory - cfg_files
end
spm('defaults', 'FMRI');
spm_jobman('serial', jobs, '', inputs{:});
When I replace MATLAB_CODE_TO_FILL_INPUT with the path to the folder where I keep the files I want analysed I get the error message:
Item 'Session', field 'val': Value must be either empty, a cellstr or a cfg_dep object.
Item 'Directory', field 'val': Value must be either empty, a cellstr or a cfg_dep object.
And then it asks me to choose files for session and a folder for directory.
What should I replace MATLAB_CODE_TO_FILL_INPUT with to make it understand where it is supposed to get these files on its own?
Thank you!
/Karin
|