SCIInstitute / map3d

Other
3 stars 3 forks source link

how to use "landmark" get a particular electrode or lead location? #44

Open zhifeiji-han opened 3 years ago

zhifeiji-han commented 3 years ago

I want to use map3d to add electrode points and make triangles to the 771 tank geometry.

I learned from the software manual that landmark can do it, but I don't know how to implement it?

zhifeiji-han commented 3 years ago

image

zhifeiji-han commented 3 years ago

@dcwhite

dcwhite commented 3 years ago

@jessdtate

zhifeiji-han commented 3 years ago

I want to import files into map3d. How to generate pts, fac, geom, lmarks files?

zhifeiji-han commented 3 years ago

@dcwhite
It's been two weeks and there's no answer. Is there something wrong with the website, or is it inappropriate to ask questions?

dcwhite commented 3 years ago

This is the right place, but I am not the maintainer of this repo. You could try @bryanworthen or @rsmacleod, or users @bzenger or @jab0707 (just going by who is the most active on the issue list).

bryanworthen commented 3 years ago

Hi there. Thank you for using map3d, and I apologize for the delay.

Your question can mean a few different things. If I answer the wrong question, please feel free to let me know. 1) You can add points and triangles to the tank 771 geometry, or 2) You can create landmark files to be a set of visual cues.

A little more detail: 1) The tank 771-geometry is specified as a .pts file and a .fac file. These are plain text files and each row in the .pts file represents the x,y,z coordinates of an "electrode point". Each row in the .fac file specifies 3 points that form a triangle. This is specified in a little more detail in section 6.1.1 and 6.1.2 of the User Manual

2) Landmarks don't really add electrode points, but add visual cues. See section 6.5. Landmark files are also plain text, but they are a bit more complicated than the .fac and .pts. You could create a landmark file to display points on or around any of the points in the surface in the tank 771 geometry file. As an example, you could launch map3d with the daltorso and dalepi geometries (from the torso directory), along with the delepi-def.lmark file. It will show an artery along the heart's surface.

25feb97_sock.lmarks shows an example of an artery-style landmark as well as single-point landmarks.


In either case, map3d does not currently support adding nodes to a geometry from within the software. The points must be added to the files in question. It does support editing a node's position once it is in map3d by moving it around (See 8.2.3 for Picking controls, Picking ->Edit Node Mode or Edit Landmark Point Mode; 8.2.2 for keyboard controls once in the edit mode).

Let me know if this didn't quite give you what you need, or it I can answer any more questions.

zhifeiji-han commented 3 years ago

Thank you for your reply! I didn't make my question clear. I'll retell it. I want to get a file similar to tank_leads_192.fac, which is a picture of 192 leads. I want to make 64 leads, which are located in the chest area. How do I need to create this file? image

bryanworthen commented 3 years ago

Okay. Thanks for clarifying.

map3d is not (really) a 3D modeler (Short of the ability to "edit" nodes that I mentioned above). Therefore, the only real ways to do this are to understand the .pts and .fac file formats, or to supply the same information in a matlab file.

When you tell map3d to load a .fac file, it will automatically read the .pts file with the same prefix. So in this case, map3d is reading tank_leads_192.fac and tank_leads_192.pts

Diving into tank_leads_192.pts, we can see that there are 192 lines, one line for each node, each line containing 3 points, (x,y,z) for a vertex.

Diving into tank_leads_192.fac, we see a set of rows, with three numbers in it. Those three numbers represent three vertices that form one triangle, and the set of those triangles compose the surface. In this case, there are 352 triangles composing the surface. Each number in the file represents the vertex that corresponds to that row number in the .pts file.

For instance, line 1 of the .fac file says: 155 156 167

This means one triangle for the three vertices specified by lines 155, 156, and 167: image

and then 351 other triangles specified by similar means.

So: you would then need to have a file, say node64.pts, that has the 64 points in question, and a corresponding node64.fac that defines how the triangles connect them.

(This format is similar to the Wavefront obj file format that some 3D renderers can export. Instead of having it all in one file, there are two.)

See section 6.1 of the user manual.

You can also get the same data into a matlab file. See section 6.1.3 of the user manual.

As always, let me know any questions you have.

bryanworthen commented 3 years ago

Oh, if your question is specifically about how to get 64 nodes into the chest area of tank_leads_192, then you would need to know which points to use as a frame of reference. Some ways to know which node inside of map3d corresponds to which point in the .fac file are:

zhifeiji-han commented 3 years ago

Thank you for your reply! I understand your explanation.