[FieldTrip] Decimating high-resolution STLs for use in Fieldtrip

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon Jan 29 09:08:27 CET 2024


Hi Guillermo,

Boundary element methods require the boundary meshes to be closed surfaces. Matlab’s reducepatch does not deliver those. You’d need to decimate the mesh such that the topology is conserved. Packages like caret (old school) or its newer version HCP-workbench achieve this (at least for cortical meshes) by retessellating the meshes after projecting them onto a sphere. Some similar strategy could be used for other boundaries, such as a inner skull or scalp surfaces. As you may have seen in the online documentation, fieldtrip provides various ways to create arbitrary number-of-vertices meshes from binary segmentations. If you have strong arguments to bypass that functionality, then you may want to have a look at the code in fieldtrip/bin/ft_postfreesurferscript.sh, which operates on Freesurfer meshes as input (but require HCP-workbench software, for which this list does not provide a forum for discussion, and which operates on cortical meshes only).

Good luck,
Jan-Mathijs


On 26 Jan 2024, at 22:35, Nunez Ponasso, Guillermo via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear FieldTrip community,

My name is Guillermo Nunez Ponasso, and I am a post-doc working at Prof. Sergey Makaroff's lab at the Worcester Polytechnic Institute.

Recently, I have been getting familiar with FieldTrip, trying to create forward simulations using a volume conduction model with the 'bemcp' method.

Instead of starting from MRI images, I would like to use high-resolution STL meshes from FreeSurfer, or SPM-CAT. For this, I used the ft_read_headshape function, together with ft_prepare_headmodel, to create a headmodel from the STL meshes. This model is created successfully using the high-res meshes directly (except for a warning sign that the matrix may be nonsingular, which I presume is due to an issue with the meshes). However after reducing the number of points and triangles in the meshes, using the function ft_prepare_headmodel with the low-res meshes causes MATLAB to crash in my machine.

The way I am reducing the resolution of the meshes is via the MATLAB function reducepatch – I thought that I may be causing some issues by doing so.

Is there a way to decimate high-res meshes into low-res meshes using FieldTrip functions, so that ft_prepare_headmodel will work correctly?

Any help is much appreciated,

Best,
Guillermo



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C809dfecba7644a01d08808dc20a1795b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638421125112230674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=g7kHpFNIdmroJ7NPy0itYr6Y1vYzXCtdo9dnWW2mnJ0%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C809dfecba7644a01d08808dc20a1795b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638421125112230674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=j9s5YC0qjRn97bOBp%2FBI1mC2soWYTcFPbqS%2FM%2FBNjiY%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240129/848b3610/attachment.htm>


More information about the fieldtrip mailing list