Dear SPM experts:
My question is directed more to Dr. John Ashburner
For some reasons, I want to run spm_affsub3 for 9 parameters only
(3 linear shifting + 3 rotation + 3 scaling (in x, y, and z directions)).
I also want to run this program for 3 scaling only (all others fixed
at default values).
I added to two values to variable mode: '9param1' and '9param3'
('9param2' saved for something else). Would like to know if anything wrong
in my modification of your program (without asking for your permision
:-)):
%Here is the elseif block for '9param1'
elseif strcmp(mode,'9param1')
% 3rot +3 shift +3 scaling normalisation.
% Each F is mapped to one G, without scaling.
%-----------------------------------------------------------------------
np = prod(size(VG));
if np ~= prod(size(VF))
error('There should be the same number of object and template
images');
end
pdesc = [ones(12,np); eye(np)];
gorder = 1:np;
free = [ones(1,9) [0 0 0] zeros(1, np)]';
mean0 = [ornt ones(1,np)]';
icovar0 = zeros(length(mean0));
icovar0(1:9,1:9) = icovar(1:9,1:9); %it was 12?
ifun = 'spm_matrix(P(1:12))';
%here is the elseif blod for '9param3'
elseif strcmp(mode,'9param3')
% 3 scaling only normalisation.
% Each F is mapped to one G, without scaling.
%-----------------------------------------------------------------------
np = prod(size(VG));
if np ~= prod(size(VF))
error('There should be the same number of object and template
images');
end
pdesc = [ones(12,np); eye(np)];
gorder = 1:np;
free = [[0 0 0 0 0 0] ones(1,3) [0 0 0] zeros(1, np)]';
mean0 = [ornt ones(1,np)]';
icovar0 = zeros(length(mean0));
icovar0(7:9,7:9) = icovar(7:9,7:9); %
ifun = 'spm_matrix(P(1:12))';
Thanks for your help on this and on many others!
Kewei
|