0001 function txt=SurfStatDataCursorP(empt,event_obj) 0002 pos=get(event_obj,'Position'); 0003 h=get(event_obj,'Target'); 0004 v=get(h,'Vertices'); 0005 x=get(h,'FaceVertexCData'); 0006 id1=min(find(v(:,1)==pos(1)&v(:,2)==pos(2)&v(:,3)==pos(3))); 0007 tag=get(get(h,'Parent'),'Tag'); 0008 [s,a,id0]=strread(tag,'%s %d %d'); 0009 id=id1+id0 0010 c=get(get(h,'parent'),'CLim'); 0011 thresh=c(2)/255; 0012 tt=x(id1)/thresh; 0013 rtt=round(tt); 0014 if rtt==128 | rtt==0 0015 p=NaN; 0016 elseif rtt>=129 0017 p=(255-tt)/126*thresh; 0018 else 0019 p=(127-tt)/126*thresh; 0020 end 0021 txt = {['x: ',num2str(pos(1))],... 0022 ['y: ',num2str(pos(2))],... 0023 ['z: ',num2str(pos(3))],... 0024 ['id: ',num2str(id)],... 0025 ['P: ',num2str(p)]}; 0026 return 0027 end 0028