[FieldTrip] Stroke lesion segmentation and SimBio MEX compilation issues on Ubuntu 22.04 (MATLAB R2022a)
Vitoria Piai
v.piai.research at gmail.com
Wed Jun 18 14:19:02 CEST 2025
Hi Arnaud and Sami,
I cannot speak to your second question, but re. the first one, from the top
of my head (I can look up some of my code later if needed):
In my experience (after fiddling with this for more than 5 years now...),
what has been working relatively well for us is to use ft_volumesegment on
your MRI, then read the binary lesion mask (and realign it to the MRI if
you did some realignment there) and then manually add it to your
segmentation, subtracting it from the rest of the segmentation (so for ex.
if SPM segments certain voxels as GM and you add those manually as lesion,
you need to set those voxels to 0, depending on what type of segmentation
you're using, indexed or probabilistic). Also, if you're going to assign
CSF conductivity for your lesion, then you could consider not adding it as
a separate tissue, but rather add it into your CSF segmentation instead.
The rest of the pipeline would remain the same, the head model will be
prepared using this segmentation.
I hope this helps,
Vitoria
On Wed, 18 Jun 2025 at 13:40, Sami LAMECHE via fieldtrip <
fieldtrip at science.ru.nl> wrote:
> Dear FieldTrip team,
>
> I am currently working on source reconstruction from EEG data in a patient
> who has suffered a stroke. I am using FieldTrip on Ubuntu 22.04 with MATLAB
> R2022a, and I would like to ask for advice on two specific issues:
>
> 1.Stroke lesion segmentation
> I have an MRI volume of the patient, as well as a binary lesion mask
> (in NIfTI format) corresponding to the stroke area. I would like to include
> this lesion as a separate tissue class in the segmentation process (e.g.,
> alongside gray matter, white matter, CSF, skull, and scalp) to generate a
> realistic headmodel.
> - Is there an official or recommended workflow in FieldTrip to
> incorporate a lesion mask into `ft_volumesegment` or another segmentation
> pipeline?
> - If not, what is the best way to manually integrate this lesion into
> the segmentation structure in a way that remains compatible with headmodel
> creation?
>
> 2. SimBio MEX compilation issues on Ubuntu 22.04
> I am following the FEM pipeline described on the official FieldTrip
> tutorial ([
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ftutorial%2Fsource%2Fheadmodel_eeg_fem%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C221aa00d3ce64aaaf26708ddae62594b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638858459615826743%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=5vmwPTkt8rmdCIh1ydVIfPRdRWBC3sdUBEyO%2FoEmJA0%3D&reserved=0](https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ftutorial%2Fsource%2Fheadmodel_eeg_fem%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C221aa00d3ce64aaaf26708ddae62594b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638858459615854200%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=8rFypiY8hBW6hsySh0zqanFE2EfNSzmtfjRvDyLvTF4%3D&reserved=0)).
> However, I encounter issues when trying to load the SimBio MEX files (when
> doing ft_prepare_headmodel) on Ubuntu 22.04 with MATLAB R2022a.
> Specifically, I receive the following error:
>
> Invalid MEX-file '.../calc_stiff_matrix_val.mexa64':
> ... wrong ELF class, or undefined symbol, or GLIBC_x.x not found ...
>
> - Are there known compatibility issues with SimBio and Ubuntu 22.04 or
> with MATLAB R2022a?
> - Would you recommend specific compiler flags, patches, or an alternative
> build process to successfully compile and use SimBio’s MEX files in this
> setup?
>
> Any suggestions, workarounds, or reference materials would be very helpful.
>
> Best regards,
> Arnaud Preuilh & Sami Lameche
> LIB
>
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C221aa00d3ce64aaaf26708ddae62594b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638858459615873467%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=4WKb29xGzcBvk9rT4KlrcnKZh9oGcLdzrFio99a1L1c%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C221aa00d3ce64aaaf26708ddae62594b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638858459615889837%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=fUWaeWpJGPjgsl79T3bt5TgB5%2BQBH0oacAKI0Dxs4aQ%3D&reserved=0
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250618/9f3a0e85/attachment.htm>
More information about the fieldtrip
mailing list