Dear Greggory,
> I have 13 subjects that I want to coregister using SPM then do a couple
> operations on using my own functions. I can automate it to do my functions,
> but is there a wrapper function that lets you coregister files without using
> the SPM GUI?
Try looking at spm_run_coreg_estimate.m (in the "config" folder) for
an example. You should be able to turn this into what you need:
x = spm_coreg(strvcat(job.ref), strvcat(job.source),job.eoptions);
M = inv(spm_matrix(x));
PO = strvcat(strvcat(job.source),strvcat(job.other));
MM = zeros(4,4,size(PO,1));
for j=1:size(PO,1),
MM(:,:,j) = spm_get_space(deblank(PO(j,:)));
end;
for j=1:size(PO,1),
spm_get_space(deblank(PO(j,:)), M*MM(:,:,j));
end;
Hope this helps!
Jonathan
--
Dr. Jonathan Peelle
Department of Neurology
University of Pennsylvania
3 West Gates
3400 Spruce Street
Philadelphia, PA 19104
USA
http://jonathanpeelle.net/
|