Hi Greggory
the easiest way is as follow
1. prepare one subject using the batch interface and save the batch
2. write a script where you loop through subjects updating the batch
(load your batch and all operations are in matlabbatch{i}.operation_to_do)
3. execute using the command output_list =
spm_jobman('run_nogui',matlabbatch);
now if you want to do some stuff using your own function you can split
the batch into say 2 parts and do something like
load batch 1
for subject =1:13
cd (dir{s})
update matlabbatch [usually there is not much to update except
directory and files because you can create dependencies]
output_list1{s} = spm_jobman('run_nogui',matlabbatch);
load output images ([P,filter]=spm_select(Inf,'.*\.img$','Select
Images '); V = spm_vol(P); Images = spm_read_vols(V);)
run my function
cd(previous_dir); load batch2; cd(dir{s})
update matlabbatch with your new images
output_list2{s} = spm_jobman('run_nogui',matlabbatch);
cd(previous_dir)
end
Hope this helps
Cyril
> Hey all,
>
> 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?
>
> Thanks!
> Greggory
>
>
>
> --
> Greggory Rothmeier
> Optoelectronics Laboratory
> Department of Physics and Astronomy
> Georgia State University
> 29 Peachtree Center Ave.
> Science Annex 400 Atlanta, GA 30303
> (404) 413-6042
> (770) 656-1671
--
Dr Cyril Pernet,
Academic Fellow
BRIC fMRI Manager
Brain Research Imaging Center
Division of Clinical Neurosciences
University of Edinburgh
Western General Hospital
Crewe Road
Edinburgh
EH4 2XU
Scotland, UK
[log in to unmask]
tel: +44(0)1315373661
http://www.sbirc.ed.ac.uk/cyril
http://www.sinapse.ac.uk/
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
|