hi - I'm trying to create a batched normalization procedure in spm
using rick henson's recently posted code as a starting point. However,
I've run into a problem in the normalization step. Here is my
adaptation of his code:
> Vt=spm_vol(sn_template);
>
> % use mean image to determine params
> Vm=spm_vol(sprintf('%s/bold/%03d/mean%s-%03d-0001.img',...
> cwd,bolddirs(1),base_filestem,bolddirs(1)));
>
> matname = [spm_str_manip(Vm.fname,'sd') '_sn.mat'];
>
> params = spm_normalise(Vt,Vm,matname,'','',...
> defaults.normalise.estimate);
>
> % msk =
> spm_write_sn(Vm,params,defaults.normalise.write,'mask');
>
> fprintf('writing normalised mean...\n');
> spm_write_sn(Vm,params,defaults.normalise.write); % write nmean
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % Write normalised
>
> fprintf('writing normalised images...\n');
> for ses=1:nses
> for i=1:length(V{ses}),
> VO(i) = spm_write_sn(V{ses}(i),params,
> defaults.normalise.write);
> fprintf('Sess %d Image %d: %s\n',ses,i,VO(i).fname);
> end;
> end;
the only main difference between rick's code and mine is that mine
doesn't use the mask option. The problem that I've run into is that,
whereas the mean is properly written to wmean.img, the individual files
are not properly written out. when I look at V{ses}(i) it contains the
proper (full) filename, but when it look at VO(i).fname it contains
"normalised.img" for each image. what's more, there are no files
called "normalised.img" created.
thanks for any help you can provide.
cheers
russ
---
Russell A. Poldrack, Ph.d.
Assistant Professor
UCLA Department of Psychology
Franz Hall, Box 951563
Los Angeles, CA 90095-1563
phone: 310-794-1224
fax: 310-206-5895
email: [log in to unmask]
web: www.poldracklab.org
|