Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge tetra mesh with multiple elemID within enclosed surface #61

Closed
tmedani opened this issue Nov 3, 2021 · 2 comments
Closed

Merge tetra mesh with multiple elemID within enclosed surface #61

tmedani opened this issue Nov 3, 2021 · 2 comments

Comments

@tmedani
Copy link

tmedani commented Nov 3, 2021

Hi @fangq

I hope you are doing well,

We are pushing the modeling to include the shape of the electrode in the simulation (we will include it in Brainstorm soon).

My question is related to the possibility to merge a tetra mesh volume within a closed surface (in the brain volume).

We have the complete sEEG electrode model (lead with multiple contacts), as shown in this figure,
I was able to construct it thanks to iso2mesh, a great tool again.

image

We would like to integrate these electrodes together within the brain volume, a simple scenario is in this figure:

image

The model that I used in this figure is just with one tissue for the electrode, and surf2mesh works fine with the seed points,
however, it's not easy when we use the model in the first figure, with multiple sEEG contacts,

So, is there any option within iso2mesh/tetgen that allows generating this model?

Any recommendations/or scripts are welcome.

Thanks again for your precious help.

Best,
Takfarinas

@fangq
Copy link
Owner

fangq commented Nov 5, 2021

@tmedani, do you have to insert all interior nodes in the electrode tet mesh to the output mesh?

if not, you can use mergemesh (as long as the electrode does not intersect with the brain surface) or mergesurf to combine the electrode surface mesh (multi-compartment) with brain surface mesh. Then you can call surf2mesh with seed points to create a combined tetrahedral mesh.

alternatively, instead of using your tetrahedral electrode mesh, iso2mesh has a function called meshcylinders - a function I wrote specifically for Lead-DBS where iso2mesh was used to create electrode/brain meshes.

if you have to insert the electrode interior nodes from your existing mesh to the output, you could use meshrefine - you can refine a tet mesh created by brain surface only by inserting new nodes and surface triangles taken from the electrode mesh. the nodes/elements inside the electrode will be more than your original electrode mesh, but all nodes/triangles of the electrode should preserve in the output.

Lead-DBS supports many electrode shapes, you can find example meshing codes by searching s2m and surfboolean in the project, for example

https://github.com/netstim/leaddbs/blob/d2e0029317a9c0d88f5f821320470519ab486a31/templates/electrode_models/ea_genvol_sde_08.m
https://github.com/netstim/leaddbs/blob/d2e0029317a9c0d88f5f821320470519ab486a31/vatmodel/ea_mesh_electrode.m

@tmedani
Copy link
Author

tmedani commented Nov 8, 2021

Hi @fangq

That's helpful, meshcylinders is great, thanks

I went through the leadDBS code and data and found interesting models and scripts.

Thanks for your precious help.

Best

@tmedani tmedani closed this as completed Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants