I would like to apply the transformation matrix obtained by these three SPM utilities:
- "Old" Segment: transformation_mat = <my_source_image>_seg_sn.mat
- New Segment: transformation_mat = <my_source_image>_seg8.mat
- spm_coreg: transformation_mat = Source_To_Target.mat
And use the Deformation script below for this purpose:
jobs{1}.util{1}.defs(1).fnames = {'/path/to/source.nii,1';};
jobs{1}.util{1}.defs(1).comp{1}.inv.comp{1}.sn2def.matname = {'/path/to/transformation_mat';};
jobs{1}.util{1}.defs(1).comp{1}.inv.space = {'/path/to/target.nii,1';};
However the script above only works with "Old" Segment matrix while with the two other matrices it throws the following error: "Item 'Parameter File', field 'val': Number of matching files (0) less than required (1)." I presumed this was because the matrices were not in the right format so i tried to use spm_prep2sn to convert them into the Parameter File SPM was complaining about. Unfortunately i got two different errors for "Old" Segment and spm_coreg when using spm_prep2sn:
- with "New" Segment:
Error using eye
Out of memory. Type HELP MEMORY for your options.
Error in spm_prep2sn>reparameterise (line 90)
AA = eye(pd)*0.01;
Error in spm_prep2sn (line 25)
[Affine,Tr] = reparameterise(Y1,Y2,Y3,VG(1),VF.mat,MT,max(d(1:3)+2,[8 8 8]));
- with spm_coreg:
Reference to non-existent field 'tpm'.
Error in spm_prep2sn (line 19)
VG = p.tpm;
So how to use the script above to be able to use the output transformation matrix of New Segment and spm_coreg?
|