The most recent version of SPM8 that I have has these lines in spm_vol.m:
[V(counter+1:counter+size(v, 2),1).fname] = deal('');
[V(counter+1:counter+size(v, 2),1).mat] = deal([0 0 0 0]);
[V(counter+1:counter+size(v, 2),1).mat] = deal(eye(4));
[V(counter+1:counter+size(v, 2),1).mat] = deal([1 0 0]');
The fact that the left-hand sides in the second, third, and fourth lines are identical looks odd. This line from the same file in the most recent version of SPM2
V(size(P,1),1) = struct('fname','', 'dim', [0 0 0 0], 'mat',eye(4), 'pinfo', [1 0 0]');
shows that in fact the lines in SPM8 should read
[V(counter+1:counter+size(v, 2),1).fname] = deal('');
[V(counter+1:counter+size(v, 2),1).dim] = deal([0 0 0 0]);
[V(counter+1:counter+size(v, 2),1).mat] = deal(eye(4));
[V(counter+1:counter+size(v, 2),1).pinfo] = deal([1 0 0]');
(second and fourth lines are unchanged).
I see the bug in all versions of SPM5 and SPM8 in my possession.
It's not clear that the bug is of much consequence, since a few lines later these fields in V are reassigned, assuming they were assigned in
v = subfunc(P(i,:));
I haven't given thought to how likely it is that some of the fields were not assigned in v.
Best,
S
|