简体   繁体   English

Matlab PLY表面网格上的测地线

[英]Geodesic on Matlab PLY Surface Mesh

I have a CT scan for an heart and I am designing a device that rests on top of it. 我进行了心脏的CT扫描,并且正在设计一种基于心脏的设备。 As such, getting the right lengths for certain attributes is important. 因此,为某些属性获取正确的长度很重要。 The CT scan was segmented in MeshLab and my advisor gave me code that uses PLY_IO to read the ply file exported from MeshLab. CT扫描在MeshLab中进行了细分,我的顾问为我提供了使用PLY_IO读取从MeshLab导出的层文件的代码。 From this, I have a map of the surface. 由此,我获得了表面图。 surf(Map.X, Map.Y,Map.Z) outputs the 3D model. surf(Map.X,Map.Y,Map.Z)输出3D模型。 Now, what I would ideally want is to be able to select points graphically via the figure window and have Matlab either tell me what the points are or allow me to draw a geodesic line to determine its length. 现在,我理想中希望的是能够通过图形窗口以图形方式选择点,并让Matlab告诉我这些点是什么,或者让我画一条测地线来确定其长度。 Question : Does anyone have any idea of how I could do this in a simple way? 问题 :是否有人对我如何以简单的方式执行此操作有任何想法?

Ultimately, just drawing on the figure might be ok too if I can just get it in the right orientation. 最终,只要我能以正确的方向画图,也可以画图。 Ideally, though, I would select the start and end point and then Matlab would graphically show a geodesic on the surface that I can later find the length of. 不过,理想情况下,我将选择起点和终点,然后Matlab将以图形方式在表面上显示测地线,以后可以找到其长度。 I'm willing to do some programming for this, but hopefully there's something out there you guys might already know about. 我愿意为此做一些编程,但是希望你们那里可能已经知道一些事情。

One way to interactively extract points on a surface is to use datacursormode . 交互式提取曲面上的点的一种方法是使用datacursormode Here's a simple example of how to get two points: 这是一个简单的例子,说明如何获得两点:

surf(peaks);
dcm_obj = datacursormode(gcf);
set(dcm_obj,'DisplayStyle','datatip',...
    'SnapToDataVertex','off','Enable','on')
disp('Select first point then press any key')
pause                           
c_info{1} = getCursorInfo(dcm_obj);
disp('Select second point then press any key')
pause                           
c_info{2} = getCursorInfo(dcm_obj);

Note that if you (or the user) changes mode (eg by clicking the rotate button) in order to select the point, you will have to switch back to datacursor mode to move the datacursor again: 请注意,如果您(或用户)更改了模式(例如通过单击“旋转”按钮)以选择点,则必须切换回数据光标模式以再次移动数据光标:

在此处输入图片说明

You should now have c_info{1}.position and c_info{2}.position which are two points on the surface. 现在,您应该在表面上有两个点c_info{1}.positionc_info{2}.position Calculating the geodesic is another matter - have a look on the File Exchange, see if there's anything around already that will do the job for the type of data you have already. 计算测地线是另一回事-看一下File Exchange,看看周围是否有任何东西可以完成您已经拥有的数据类型的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM