Using BrainVISA

Authors: Francois Tadel

It is not the purpose of Brainstorm tutorials to teach you how to use BrainVISA. But many Brainstorm users are lost when it gets to the segmentation of the MRI. So here is a short introduction to the BrainVISA T1 MRI processing pipeline. To extract head and cortex meshes from a T1 MRI, you can also try to use: BrainSuite, CAT12 or FreeSurfer.

This tutorial was written for BrainVISA 4.6. To get started, or for additional information, you can also read the BrainVISA tutorial and the Morphologist tutorial.

Installation

Running Morphologist

The procedure to run the segmentation of a MRI volume is described in the Morphologist tutorial. Only the first few steps are illustrated below.

Import the MRI

Start Morphologist

What if if crashes?

MarsAtlas parcellation

Importing the results in Brainstorm

  1. Switch to the anatomy side of the database explorer
  2. Create a new subject, set the default anatomy option to "No, use individual anatomy"
  3. Right-click on the subject > Import anatomy folder...

    import1.gif

  4. Select the file format "BrainVISA folder" and select the top folder of your subject: /.../brainvisa_db/segmentation/SubjectName
  5. Then you're prompted for the number of vertices you want in the final cortex surface. This will by extension define the number of dipoles to estimate during the source estimation process. By default we set this value to 15000 for the entire brain (it means 7500 for each hemisphere).

    nVertices.gif

  6. The MRI Viewer appears. The AC/PC/IH points are already read from the BrainVISA folder, but you should define the positions of the NAS/LPA/RPA fiducial points. Alternatively, compute the MNI normalization for obtaining default positions for these points.

    mriviewer.gif

  7. Click on Save to keep your modifications, and the automatic import will go on.
  8. This process imports the following files from the folder .../SubjectName/t1mri/default_acquisition/default_analysis/ :

    • nobias_SubjectName.nii.gz (T1 MRI volume)

    • SubjectName.APC (position of the fiducials AC, PC and IH)

    • segmentation/mesh/SubjectName_head.gii (head surface)

    • segmentation/mesh/SubjectName_Lhemi.gii (grey/csf interface, left hemisphere)

    • segmentation/mesh/SubjectName_Rhemi.gii (grey/csf interface, right hemisphere)

    • segmentation/mesh/SubjectName_Lwhite.gii (white matter, left hemisphere)

    • segmentation/mesh/SubjectName_Rwhite.gii (white matter, right hemisphere)

    • segmentation/mesh/surface_analysis/SubjectName_Lwhite_parcels_marsAtlas.gii

    • segmentation/mesh/surface_analysis/SubjectName_Rwhite_parcels_marsAtlas.gii

  9. The successive steps that are automatically performed by Brainstorm:
    • Import all the surfaces (left/right, white/cortex)
    • Import the MarsAtlas parcellation for the white surfaces

    • Downsample each hemisphere to the number specified in the options (by default 7500, half of the total default number 15000)
    • Merge left and right hemispheres for the two surface types: white matter and cortex envelope
    • Delete all the unnecessary surfaces
    • Fill the holes in the head surface
  10. The files you can see in the database explorer at the end:

    checkDb.gif

    • MRI: The T1 MRI of the subject

    • SubjectName_head_8000V: Scalp surface generated by Brainvisa (holes filled by Brainstorm).

    • cortex_170000V: High-resolution cortex surface that was generated by BrainVISA.

    • cortex_15000V: Low-resolution cortex surface, downsampled using the reducepatch function from Matlab (it keeps a meaningful subset of vertices from the original surface). This surface appears in green, it means that is going to be used as the default by the processes that require a cortex surface.

    • white_170000V: High-resolution white matter surface from BrainVISA (with MarsAtlas)

    • white_15000V: Low-resolution white matter, processed with reducepatch (with MarsAtlas)

  11. A figure is automatically shown at the end of the process, in order to check visually that the low-resolution cortex and head surfaces were properly imported. If it doesn't look like the following picture, do not go any further in your source analysis, fix the anatomy first.

    • result.gif



Handling errors

How to check the quality of the result

It's hard to estimate what would be a good cortical reconstruction. What you are trying to spot at this level is mostly the obvious errors, like when the early stages of the brain extraction didn't perform well, just with a visual inspection. Play with the Smooth slider in the Surface tab. If it looks like a brain (two separate hemispheres) in both smooth and original views, it is probably ok.

Display the cortex surface on top of the MRI slices, to make sure that they are well aligned, that the surface follows well the folds, and that left and right were not flipped: right-click on the low-resolution cortex > MRI registration > Check MRI/surface registration...

checkAlign.gif

The cortex looks bad

It is critical to get a good cortex surface for source estimation. If the final cortex surface looks bad, it means that something didn't work well somewhere along the BrainVISA pipeline. The options are:

The head surface looks bad

It is not mandatory to have a perfect head surface to use any of the Brainstorm features: you don't necessarily have to recognize the face (for the anonymity of the figures, it can be even better if you don't).

The head surface is important mostly for the alignment of the MEG sensors and the MRI. If you digitized the head shape with a Polhemus device, you can automatically align the head surface (hence the MRI) with the MEG sensors (in the same referential as the Polhemus points). The quality of this automatic registrations depends on the quality of both surfaces: the Polhemus head shape (green points) and the head surface from the MRI (grey surface). If you placed lots of points on the nose but your head surface doesn't have a nose, these points are not going to help. Except for that, a nice head shape is mainly useful for producing nicer figures.

checkAlignMeg.gif

If the default head surface looks bad, you can try generating another one: right-click on the subject folder > Generate head surface. The options are:

Cortical parcellations

The process Cortical surface > Anatomy > Hip-Hop Cortical Parameterization in BrainVISA implements an automatic parcellation of the cortical surface in anatomical regions. The MarsAtlas model is described here:
https://meca-brain.org/software/marsatlas/

This atlas is available only on the white matter surface (ie. the grey-white interface, named white_*). It is imported in Brainstorm as scouts (cortical regions of interest), and saved directly in the surface files. To check where they are saved: right-click on the low-resolution white surface > File > View file contents. You can see the available structures "Atlas", the first one that has Name='User scouts', and the second one Name='MarsAtlas'.

viewMat.gif

To access them from the interface: Double-click on the cortex and go to the Scout tab, and click on the drop-down list to select another Atlas (ie group of scouts):

marsAtlas.gif

Manual import of the anatomy

In case you need to import the MRI, surfaces and atlases separately instead of using the menu "Import anatomy folder", here is the sequence of operations to perform to get to the same result:

  1. From the Anatomy side of the database explorer: create a subject.

  2. Right-click on the subject folder > Import MRI > Select "nobias_subjectname.nii.gz"

  3. Set the 3 fiducial points NAS/LPA/RPA (or compute MNI normalization), save
  4. Right-click on the subject folder > Import surfaces > Select simultaneously: head.gii, Lhemi.gii, Rhemi.gii, Lwhite.gii, Rwhite.gii

  5. Double-click on Lwhite to display it. In the scout tab: Atlas > Load atlas > select the file format "GIfTI texture" and the file default_analysis/segmentation/mesh/surface_analysis/..._Lwhite_parcels_marsAtlas.gii. Close the figure.

  6. Repeat with surface Rwhite.
  7. Select Lhemi, Rhemi, Lwhite, Rwhite, right-click > Less vertices > 7500 vertices > Select the first option "Matlab reducepatch"

  8. Select Lhemi, Rhemi, right-click > Merge surfaces: Generates a surface cortex_70000V

  9. Select Lwhite, Rwhite, right-click > Merge surfaces: Generates a surface white_70000V

  10. Select Lhemi_7500V, Rhemi_7500V, right-click > Merge surfaces: Generates a surface cortex_15000V

  11. Select Lwhite_7500V, Rwhite_7500V, right-click > Merge surfaces: Generates a surface white_15000V

  12. Delete all the separate hemispheres: *hemi*, *white*
  13. Double-click on cortex_15000V to set it as the default cortex





Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):


Tutorials/SegBrainVisa (last edited 2022-06-24 10:19:19 by FrancoisTadel)