Info

This question is closed. Reopen it to edit or answer.

display Color scale of the difference from the model surface to the fitted sphere

1 view (last 30 days)
i am trying to display Color scale of the difference from the model surface to the fitted sphere. i have loaded a ply-format file "femur bone "and displayed its triangulated surface using gray colormap , and also an sphere with specific radius was created and displayed with different setting. i have saved the lowest distance from the from each vertex of the femur to the sphere. now im looking for using colormap for the femur vertex which have distance in the interval between [-0.2,0.2]. here is my code sofar:
[Tri,Pts] = ply_read('right_RL_femur.ply','tri'); [Pts1] =transpose(Pts(1,:)); [Pts2] =transpose(Pts(2,:)); [Pts3] =transpose(Pts(3,:)); [Tri1] =transpose(Tri(1,:)); [Tri2] =transpose(Tri(2,:)); [Tri3] =transpose(Tri(3,:)); Tri4 =[Tri1,Tri2,Tri3];
TS1= trisurf(Tri4,Pts1,Pts2,Pts3);
shading interp
light;
lighting phong;
colormap gray(256)
camproj('perspective');
axis square;
cameramenu
hold on
axis tight;
R=1.25;
quality=50;
[x1,y1,z1]=sphere(quality);
x1=R*x1;
y1=R*y1;
z1=R*z1;
hm=surf(x1,y1,z1);
set(hm,'FaceColor','none','EdgeColor','r');
hold on
[Difference_scale] = textread('Difference.txt','%f');% containing smallest difference for every vertex of the mesh to the surface of sphere.

Answers (1)

niloofar aghayan
niloofar aghayan on 23 Oct 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!