Marko Wilke wrote:
> Dear All,
> I admit I have not deeply searched the spm5 code but I wondered what the
> corrrect way would be to generate a fieldmap (vdm_...img) in spm5. I
> thought I can use the ones generated with the spm2-fieldmap toolbox but
> the coregistration fails completely... I think it is some kind of
> voxel/world coordinate thing as both images (the fieldmap and the mean
> epi to coregister to) display fine in spm5 but not within check-reg.
Hi Marko,
I know nothing about fieldmaps, but I'd guess that you're right that
there's a voxel-world problem, since the way the coordinate mapping is
stored has changed between spm2 and 5.
I think you want the reverse of what I suggested here:
http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind0610&L=SPM&P=R39228&I=-3
Hopefully the code below should convert the spm2 fieldmaps to work
with spm5.
Best,
Ged.
files = spm_select(inf, 'image');
for f = 1:size(files, 1);
file = deblank(files(f, :));
V = spm_vol(file);
img = spm_read_vols(V);
[pth fnm ext] = spm_fileparts(file);
matfile = fullfile(pth, [fnm '.mat']);
load(matfile);
V.mat = mat; % (or M for spm99)
spm_write_vol(V, img);
end
|