我正在模拟我读过的一篇论文。他们已经可视化3D结构膝关节MRI的张量,如下图所示: Visualization of structure tensor
我上网很多,但我找不到适当的回答。我已经计算了3D结构Tensor的特征值和特征向量如下:
function [mu3,mu2,mu1,v3x,v3y,v3z,v2x,v2y,v2z,v1x,v1y,v1z]=EigenVectors3DTensor(G1x.^2, G1x.*G1y, G1x.*G1z, G1y.^2, G1y.*G1z, G1z.^2)
% first derivative of each voxel in three directions (x,y,z) have been saved and vectorized in G1x, G1y and G1z, respectively.
Dxx=G1x.^2
v1x=zeros(size(Dxx),'single');
v1y=zeros(size(Dxx),'single');
v1z=zeros(size(Dxx),'single');
v2x=zeros(size(Dxx),'single');
v2y=zeros(size(Dxx),'single');
v2z=zeros(size(Dxx),'single');
v3x=zeros(size(Dxx),'single');
v3y=zeros(size(Dxx),'single');
v3z=zeros(size(Dxx),'single');
mu1=zeros(size(Dxx),'single');
mu2=zeros(size(Dxx),'single');
mu3=zeros(size(Dxx),'single');
rho=1.1; %sigma out
for i=1:numel(Dxx)
Jxx = imgaussian(Dxx(i),rho,4*rho);
Jxy = imgaussian(Dxy(i),rho,4*rho);
Jxz = imgaussian(Dxz(i),rho,4*rho);
Jyy = imgaussian(Dyy(i),rho,4*rho);
Jyz = imgaussian(Dyz(i),rho,4*rho);
Jzz = imgaussian(Dzz(i),rho,4*rho);
M=[Jxx Jxy Jxz; Jxy Jyy Jyz; Jxz Jyz Jzz];
[v,d]=eig(M);
v=v';
ev1=d(1,1); ev2=d(2,2); ev3=d(3,3);
ev1a=abs(ev1); ev2a=abs(ev2); ev3a=abs(ev3);
if((ev1a>=ev2a)&&(ev1a>ev3a))
d=ev3; dt=ev3a; dat=v(3,:);
ev3=ev1; v(3,:)=v(1,:);
ev1=d; ev1a=dt; v(1,:)=dat;
elseif((ev2a>=ev1a)&&(ev2a>ev3a))
d=ev3; dt=ev3a; dat=v(3,:);
ev3=ev1; v(3,:)=v(2,:);
ev2=d; ev2a=dt; v(2,:)=dat;
end
if(ev1a>ev2a)
d=ev2; dat=v(2,:);
ev2=ev1; v(2,:)=v(1,:);
ev1=d; v(1,:)=dat;
end
mu1(i)=ev1; mu2(i)=ev2; mu3(i)=ev3;
v1x(i)=v(1,1); v1y(i)=v(1,2); v1z(i)=v(1,3);
v2x(i)=v(2,1); v2y(i)=v(2,2); v2z(i)=v(2,3);
v3x(i)=v(3,1); v3y(i)=v(3,2); v3z(i)=v(3,3);
end
我有两个主要问题:
1)结构张量的特征值和特征向量的计算是否正确?
2)如何可视化扫描结构张量(2D图像堆栈)?
如果有人帮助我,我将非常感激。