Brain2mesh - Create mesh from .nii file

Dear brainstorm team and users,
I am trying to use "generate FEM mesh" with a brain atlas in order to define scoots in the surface of my source reconstruction.

I read and followed the tutorial procedure but I met an error I could not understand. Here are the steps I undertook with Brainstorm (v 2021-07-17) for this:

  • First, I imported my atlas as a .nii file (Schaefer_17N_200_reslice, MNI)
  • Then I clicked on "generate FEM mesh' and selected the brain2mesh option.
  • It ran for a few minutes and the last sentence in the command window of Matlab says: "surface mesh generation is complete" (see the first screenshot for complete information)
  • Then I had the error "line 205: s2m. Too many input arguments." (see the second screenshot)

How can I fix this issue?
Is there another way to import an atlas in the surface representation of my source reconstructions to define my scoots?

Thank you in advance for your help.

King regard,
Théophile Bieth

Here is the second sreenshot

The FEM 3D mesh are dedicated only to FEM forward modeling, this has nothing to do with defining parcellations of the cortex surface.
https://neuroimage.usc.edu/brainstorm/Tutorials/Duneuro

If you want to use the Schaefer parcellation, either on the surface or in volumes, process the T1 MRI of the subject with CAT12:
https://neuroimage.usc.edu/brainstorm/Tutorials/SegCAT12

Hi François,
Thank you very much for your reply. I guess I did not use the right tutorial for what I wanted to do. Hence, I followed the second tutorial you mentioned but I have several additional questions.

First, I should add more information concerning my analysis. I computed source reconstruction without the individual MRI of my subject. I used the MNI152 template. I used constrained method to calculate functional connectivity on my sources (I know it is not the best but I read that there is no available method on brainstorm to compute it with unconstrained approach). I want to define scoots in the surface of my source reconstruction to reduce the size of my connectivity matrix.

Here are my questions:

  • Can I use the segmentation of CAT12 in the default anatomy folder (as I don't have individual MRI) or do I need to do each subject manually? When I try the segmentation with the MNI152 in the subject folder, it works, but not in the default folder.
  • I cannot compute my source if I first segment the MNI152 (the BEM head model doesn't work), but I can do the reverse (compute source and then segment). Is it the usual way ?
  • At the end, I can apply the Schaefer atlas on my source reconstuction, but the scoots are not precise (see picture 1). However, if I open the output of CAT12, I can see that the segmentation is good (gyrification folder, see picture 2).
  • Finally, a more naive question: when I display the surface of the output of CAT12, I can see the scoots related to the selected atlas. But there are values with a scale (similar to the one in source reconstruction). I am not sure to understand what it is.

Capture d’écran 2022-01-12 à 10.37.53

Thank you again for your help
King regard,
Théophile Bieth

Can I use the segmentation of CAT12 in the default anatomy folder (as I don't have individual MRI) or do I need to do each subject manually?

You can use the default MNI ICBM152 as it is, without any modification (FreeSurfer segmentation).
As I said before, if you need the Shaeffer segmentation, run CAT12.

When I try the segmentation with the MNI152 in the subject folder, it works, but not in the default folder.

Do you mean that if you right-click on the file Default anatomy / MRI: ICBM152 > MRI segmentation > CAT12, you get an error?
If so, please copy-paste the full error message you get, together with a screen capture of what your database looks like.

I cannot compute my source if I first segment the MNI152 (the BEM head model doesn't work), but I can do the reverse (compute source and then segment). Is it the usual way ?

If you run CAT12 on the ICBM152 brain, you would need to recompute the BEM surfaces after:
https://neuroimage.usc.edu/brainstorm/Tutorials/TutBem
If you get an error with OpenMEEG computation: check the workarounds in the tutorial, then if nothing works please report the full error message in a different thread.

At the end, I can apply the Schaefer atlas on my source reconstuction,

There is no need to "apply" anything.
The Schaefer atlas is readily available on the cortex surfaces when running the MRI segmentation with CAT12.


image

I can see the scoots related to the selected atlas. But there are values with a scale (similar to the one in source reconstruction). I am not sure to understand what it is.

I'm not sure what you are referring to.
Please post screen captures and explain better your question.

Hi,
Yes, I get this error when I right-click on the file Default anatomy / MRI: ICBM152 > MRI segmentation > CAT12.

This is what looks like my database (this is a not my real database, but only to test with one subject) after running the CAT12 segmentation in the Default anatomy folder:

If I create a subject and importe the MNI template (as it was a individual MRI) and then run the CAT12 segmentation , it works. But:

  • first, it will take more time (but if there are no other options, it is fine)
  • second, the result is bad (as I showed you in the previous message): several parts of the brain have no brain atlas label. I see that your segmentation is better but not as much as the one illustrated in the CAT12 tutorial (https://neuroimage.usc.edu/brainstorm/Tutorials/SegCAT12), in which all the label seems to cover all the brain surface. Is it normal ?

Thank you again for your help,
Théophile

The error is due to a bug when trying to compute the extra cortical maps (thickness, etc.) from the default anatomy: the "default anatomy" is not a real subject, and the cortical maps can't be imported for it. You wouldn't see this error if you were answering NO to the question about the cortical maps.

I added tests to always disable this option when trying to run CAT12 directly from the default anatomy folder. Update Brainstorm to get this last fix.

second, the result is bad (as I showed you in the previous message): several parts of the brain have no brain atlas label.

Zoom in and look at the surface with the edges of the surface: all the vertices are labelled.
ROI = scout = a list of vertices.
The faces in between the ROIs are not painted with any color, but they are not expected to.

image