[FieldTrip] Stroke lesion segmentation and SimBio MEX compilation issues on Ubuntu 22.04 (MATLAB R2022a)
Sami LAMECHE
sami.lameche at imt-atlantique.net
Thu Jun 19 17:21:22 CEST 2025
Dear Vitoria and John,
Thank you very much for your quick and detailed response, it is really appreciated and helpful.
Regarding the segmentation: we actually already have an MRI image where the lesion area has been masked with zero intensity values. When running an indexed segmentation (`ft_volumesegment`) on this image, we observed that the lesion is most often misclassified as scalp or skull tissue (ref. to the joint images).
As for the conductivity, we came across a recent publication (entitled "The impact of brain lesions on tDCS-induced electric fields" by Carys Evans et al. 2023) which reports that stroke lesion conductivity values are close to 1.2 S/m. Based on this, we would like to model the lesion as a separate tissue class with that specific conductivity value.
We also read the article you co-authored (entitled "Estimating the influence of stroke lesions on MEG source reconstruction" by Maria Carla Piastra et al.2022), in which you mention that reconstructed sources located within approximately 20 mm around the lesion are less reliable. This raised an important question for us: do you think it would be more appropriate to apply a slightly larger mask to account for this zone of uncertainty during source modeling?
Thank you John for your suggestion; we'll test 'DUNeuro' that compiles an FEM too. It is under study right now.
Thanks again for your time and insight, we’re grateful for your expertise.
Best regards,
Arnaud Preuilh & Sami Lameche
LIB
----- Mail original -----
De: "Vitoria Piai" <v.piai.research at gmail.com>
À: "FieldTrip discussion list" <fieldtrip at science.ru.nl>
Cc: "Sami LAMECHE" <sami.lameche at imt-atlantique.net>, "arnaud.preuilh" <arnaud.preuilh at sorbonne-universite.fr>
Envoyé: Mercredi 18 Juin 2025 14:19:02
Objet: Re: [FieldTrip] Stroke lesion segmentation and SimBio MEX compilation issues on Ubuntu 22.04 (MATLAB R2022a)
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%7Cedbfcbb5b596488c9f5108ddaf44f7c0%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638859433737970874%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=tlZJ2zdfLUbUOJz8n%2Fug7%2FwcrRk9LAtijE1v55s3U8c%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%7Cedbfcbb5b596488c9f5108ddaf44f7c0%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638859433737993558%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=qq2pBPFzfexcuu%2F8QR8VkGvWo5Za9r%2BdRtLR80muElA%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%7Cedbfcbb5b596488c9f5108ddaf44f7c0%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638859433738010757%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=%2FRYx1cxvMwywhrppF4HlKlstziMIooT1%2BUl6okn053E%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%7Cedbfcbb5b596488c9f5108ddaf44f7c0%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638859433738031790%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=Idopgrko4%2FvGFy9riSqj9eoKgW4U8EvCQPb6ymnYwd4%3D&reserved=0
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mri_strok_segmented.png
Type: image/png
Size: 390228 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250619/2ccb1b40/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: segmentation_stroke_Vitoria.png
Type: image/png
Size: 232528 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250619/2ccb1b40/attachment-0003.png>
More information about the fieldtrip
mailing list