Dear Luis,
> In my quest for an SPM batch file, I have edited " spm_fmri_spm_ui.m " so that it saves the arguments that go into the call to spm_spm.m . i.e:
>
You may run into the problem that spm passes the spm_spm routine a
matrix of memory mapped volumes contained in the V vectors. These contain
the addresses of the images files in memory, which must be reset by mapping
the images afresh.
You could try a script like the following. This assumes that you have
saved all the variables in the workspace during your last analysis,
by putting the line:
save WS
in the spm_fmri_spm_ui.m file, just before the call to spm_spm.m.
I haven't tested this myself, so please check the results!
Cheers,
Matthew
% script for repeated SPM anaylyses
global UFp
% Load workspace
load WS
% Store scalefactors in file identifiers
storeV = V;
%-Get file identifiers
%--------------------------------------
V = zeros(12,q);
for i = 1:q
V(:,i) = spm_map(P(i,:));
end
% Rescale them
V(7, :) = storeV(7, :);
% run analysis
% for fMRI
spm_spm(V,H,C,B,G,CONTRAST,ORIGIN,GX,HCBGnames,P,SIGMA,RT);
% for PET
% spm_spm(V,H,C,B,G,CONTRAST,ORIGIN,THRESH*GX,HCBGnames,P,0,[])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|