Hi Nikolaos and Hedok
if you have once specified the "jobs-matfile" via the GUI you could use something like the following script to cycle over all subjects in a specified directry:
subjects = dir('./Orig/3D*.img');
for sub=1:size(subjects,1)
load segmentation.mat % this is the matfile specified via the GUI
jobs{1}.spatial{1}.preproc.data = {['D:\Arbeiten\Projects\Orig\' subjects(sub).name]};
spm_jobman('run',jobs)
end
Hope this helps
Simon
Hedok Lee <[log in to unmask]> schrieb am 09.02.06 15:40:01:
>
> Niks,
>
> I'm still new to SPM5 and this may not be the best solution, but what I
> did with my spatial processing was to edit the filenames in the "jobs"
> by another matlab script. After the editing, save the "jobs" then run
> it from a command prompt by typing spm_jobman('run','myjob.mat')
> http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind05&L=SPM&D=0&I=-3&P=454599
> This way, you don't have to click on "run" everytime.
>
> I'm also wondering if there is better way to do this.
>
> hope this helps
>
> Hedok
>
>
> Nikolaos Koutsouleris wrote:
>
> > Dear SPM5 users,
> >
> > I have a SPM5 segmentation job saved in a mat-File. I want to use this
> > job in a matlab script which uses a loop to iterate through a list of
> > input files. How can I change the "data parameter" in the
> > "jobs"-struct array according to the actual input filename of the loop ?
> >
> > Any help would be greatly appreciated!
> > Best Regards,
> >
> > Nikos
|