简体   繁体   中英

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. 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. From this, I have a map of the surface. surf(Map.X, Map.Y,Map.Z) outputs the 3D model. 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. 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. 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 . 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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