These look like they are caused by tiny rounding errors. The following fix
should help. Edit spm_invdef_ui.m at around line 34, replacing:
[iy1,iy2,iy3] = spm_invdef(y1,y2,y3,VT.dim(1:3),inv(VT.mat),V(1).mat);
by:
M1 = V(1).mat;
M2 = inv(VT.mat);
M1(4,:) = [0 0 0 1];
M2(4,:) = [0 0 0 1];
[iy1,iy2,iy3] = spm_invdef(y1,y2,y3,VT.dim(1:3),M2,M1);
Best regards,
-John
> I get the error below when trying to invert some deformation fields. All
> other deformation images from the same set are OK.
>
> The V.mat(4,1:3) elements (from spm_vol.m) of the 'images to base inverses
> on' are non-zero, although very small (~1e-18). I assume this has something
> to do with it.
>
> I can write a modified spm_invdef_ui.m that will force those elements to be
> zero but is there a way to avoid this?
>
> Joel
> PS I also notice that the V.mat of some of the source images for
> (preprocessing) realignment has non-zero elements very close to zero - why
> is this?
>
> ERROR MESSAGE:
> --------------
>
> ??? No perspective projections allowed.
>
> Error in ==> /usr/local/spm2/toolbox/Deformations/spm_invdef.mexsol
> Error in ==> /usr/local/spm2/toolbox/Deformations/spm_invdef_ui.m (doit)
> On line 34 ==> [iy1,iy2,iy3] = spm_invdef(y1,y2,y3,VT.dim(1:3),inv
> (VT.mat),V(1).mat);
>
> Error in ==> /usr/local/spm2/toolbox/Deformations/spm_invdef_ui.m
> On line 18 ==> doit(Pi,PT(i,:));
>
>
> SPM2: spm_Deformations (v1.2) 16:41:31 - 19/04/2005
> ========================================================================
|