If you want to obtain such a metric from the deformations obtained via
segmentation, then maybe the following will help....
P = spm_select(Inf,'.*seg_inv_sn.mat$');
met = zeros(size(P,1),1);
for i=1:size(P,1),
t = load(deblank(P(i,:)));
V = t.VF;
d = V(1).dim(1:3);
d2 = size(t.Tr);
vx = sqrt(sum(V(1).mat(1:3,1:3).^2));
kx = (pi*((1:d2(1))'-1)/d(1)/vx(1)).^2;
ky = (pi*((1:d2(2))'-1)/d(2)/vx(2)).^2;
kz = (pi*((1:d2(3))'-1)/d(3)/vx(3)).^2;
Cwarp = (1*kron(kz.^2,kron(ky.^0,kx.^0)) +...
1*kron(kz.^0,kron(ky.^2,kx.^0)) +...
1*kron(kz.^0,kron(ky.^0,kx.^2)) +...
2*kron(kz.^1,kron(ky.^1,kx.^0)) +...
2*kron(kz.^1,kron(ky.^0,kx.^1)) +...
2*kron(kz.^0,kron(ky.^1,kx.^1)) );
Cwarp = Cwarp*t.flags.warpreg;
Cwarp = [Cwarp*vx(1)^4 ; Cwarp*vx(2)^4 ; Cwarp*vx(3)^4];
Cwarp = sparse(1:length(Cwarp), 1:length(Cwarp), Cwarp, ...
length(Cwarp), length(Cwarp));
v = t.Tr(:);
M = Cwarp;
met(i) = 0.5*v'*M*v;
end
figure
plot(met)
Note that this only gives measures for the nonlinear deformations, and does
not include the initial affine transform.
Best regards,
-John
On Wednesday 11 June 2008 14:06, Jason Steffener wrote:
> Hello all,
> I am wondering if some global measure of deformation can be calculated.
> I am interested in having some way to assess the amount of deformation that
> was needed to spatially normalize a subject's anatomical scan.
>
> thank you,
> Jason.
|