Visualizing the Direction of Asymmetry using MATLAB


This is the MATLAB code I have, but the details and what specific packages you need are coming soon.


meancoordinates = xlsread('meancoordinates.xlsx');
meanColor = xlsread('meanColor.xlsx');
%meshColor = xlsread('meshcolor.xlsx');

%meshColor_m = meshColor(1:585911,:);
meanColor_m = meanColor./255;
%[V,F] = read_ply('mean_original_shape_surf_landmarksMesh_simplified.ply');

xOrig = meancoordinates(:,1);
yOrig = meancoordinates(:,2);
zOrig = meancoordinates(:,3);

xFlip = meancoordinates(:,4);
yFlip = meancoordinates(:,5);
zFlip = meancoordinates(:,6);

mag = 15;

xFmag = xFlip + (xOrig-xFlip)*mag;
yFmag = yFlip + (yOrig-yFlip)*mag;
zFmag = zFlip + (zOrig-zFlip)*mag;


hold on
% rotate3d on 
h = rotate3d;
h.RotateStyle = 'orbit';
h.Enable = 'on';

set(gca, 'ColorOrder', meanColor_m, 'NextPlot', 'replacechildren');

% %M2<-M2+(M2-M1)*mag
% x1 = V1F +(V1-V1F)*15;
% y1 = V2F +(V2-V2F)*15;
% z1 = V3F +(V3-V3F)*15;

%scatter3(xOrig,yOrig,zOrig,400,meanColor_m,'filled');
%scatter3(xOrig,yOrig,zOrig,100,meanColor_m,'filled');

x = [xOrig xFmag];
y = [yOrig yFmag];
z = [zOrig zFmag];
plot3(x',y',z','LineWidth',2)
%plot3(x',y',z','r','LineWidth',2)

% x=[meancoordinates(:,1) x1];
% y=[meancoordinates(:,2) y1];
% z=[meancoordinates(:,3) z1];
% plot3(x',y',z','r')

set(gca, 'color', [.5 .5 .5]);%grey
%set(gca, 'color', 'k')%black

light('Position',[0 -1 0],'Style','local');
light('Position',[0 0 -1],'Style','local');
light('Position',[0 1 0],'Style','local');

%options.face_vertex_color = V(:,2);
%options.face_vertex_color = 200;

plot_mesh(V,F);
shading('interp');
%colormap(jet(256));

axis equal


hold off

No comments:

Post a Comment