0001
0002
0003
0004
0005
0006 origin = avw_center(avw);
0007
0008 xo = origin.abs.mm(1);
0009 yo = origin.abs.mm(2);
0010 zo = origin.abs.mm(3);
0011
0012
0013 x = 0 + xo;
0014 y = 100 + yo;
0015 z = 0 + zo;
0016 r = sqrt( (x-xo).^2 + (y-yo).^2 + (z-zo).^2 );
0017 l = (x-xo)/r;
0018 m = (y-yo)/r;
0019 n = (z-zo)/r;
0020
0021
0022 POINTS = 250;
0023 PERCENT = 0.25;
0024 RMIN = 0;
0025 rmax = r + (r * PERCENT);
0026 radial_distances = linspace(RMIN,rmax,POINTS);
0027
0028 L = repmat(l,1,POINTS);
0029 M = repmat(m,1,POINTS);
0030 N = repmat(n,1,POINTS);
0031
0032 XI = (L .* radial_distances) + xo;
0033 YI = (M .* radial_distances) + yo;
0034 ZI = (N .* radial_distances) + zo;
0035
0036
0037
0038 VI = interp3(vol,YI,XI,ZI,'*nearest');
0039
0040
0041