Hi Vy,
> Is there a way to generate the *seg_sn.mat file using spm_segment in
> a script?
Yes there is :) You can call the respective functions from the command
line, and thus, also in a script. Note that you do not want to use
spm_segment as that is the old-old segmentation (if new segment is new,
unified segmentation is already old and spm_segment is older still :)
Say that ana is your anatomical (with nm being its name) and opts_seg
are the options you specified, something like
% segment dataset
results = spm_preproc(ana, opts_seg);
% process generated spatial normalization parameters
[po,pin] = spm_prep2sn(results);
% save parameters (forward)
VG = po.VG;
VF = po.VF;
Tr = po.Tr;
Affine = po.Affine;
flags = po.flags;
fnam = fullfile(p,[nm '_seg_sn.mat']);
save(fnam,'-V6','VG','VF','Tr','Affine','flags');
% save parameters (inverse)
VG = pin.VG;
VF = pin.VF;
Tr = pin.Tr;
Affine = pin.Affine;
flags = pin.flags;
fnam = fullfile(p,[nm '_seg_inv_sn.mat']);
save(fnam,'-V6','VG','VF','Tr','Affine','flags');
... should work. You will still have to write out your results using
spm_preproc_write, but for the parameters themselves, that should work.
Hope this helps,
Marko
--
=====================================================================
Marko Wilke (Dr.med./M.D.)
[log in to unmask]
Universitäts-Kinderklinik University Children's Hospital
Abt. III (Neuropädiatrie) Dept. III (Pediatric neurology)
Hoppe-Seyler-Str. 1, D - 72076 Tübingen
Tel.: (+49) 07071 29-83416 Fax: (+49) 07071 29-5473
=====================================================================
|