Dear spmers:
I have data of hundreds of subjects, so I have to use pure scripts.
For my question, take an example for one single step of job, say, normalize. I first do it with spm8 batch editor, and save via "Save Batch and Script". It gives two files, one normalize_job.m file, which contains setups for normalization and is quite easy to understand. My confusion is for another file, normalize.m, as attached below. It is said to be be a template file, but without specific information about how to fill out it. I do check the manual, mailing list, but without a straightforward answer.
Here the aim is to do a normalization, which has been done by batch editor (run and get result), it's thus specific to this task of this subject. What I need are the specific scripts, just change like the name and directory, and apply to other steps and other subjects. (do single step, and repeat. Now I don't get single step, how to repeat?)
As below, it's the template. Should "nrun =X" be "nrun=1"? In "inputs = cell(0, nrun)", should change 0 to 1? Should I delete the for loop if I don't need loop here? In "spm_jobman('serial', jobs, '', inputs{:})", what's serial? Should I fill out "inputs{:}"?
For this single normalize step of this subject, every thing is ready in normalize_job.m file. I can realize the usefulness of the template file, but I want a specific straightforward way to get the single step done. How should I fill out the below template? Or may be just one or two commands?
In addition, it's better for all the scripts in one file (otherwise there will be hundreds of scripts). Is there a way to put the normalize_job.m and normalize.m file in one file? And is it just to type the file name to run the scripts?
---------------------
% List of open inputs
nrun = X; % enter the number of runs here
jobfile = {'C:\data\normalize_04_job.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'FMRI');
spm_jobman('serial', jobs, '', inputs{:});
----------------------
bests
Xiang
|