Tutorial 2: Importing individual anatomy

Objectives: Import anatomy for CTF MEG tutorial.

Create protocol

  1. Create a new protocol called TutorialCTF with the following options:

    • "No, use individual anatomy", because the individual subject anatomy is available
    • "No, use one channel file per condition (MEG)", because we are going to process regular MEG data in the next tutorial
  2. Create a new subject (let's keep the default name: Subject01)

Import MRI

  1. Go to the Anatomy view of the protocol files (very first button in Brainstorm window toolbar).

  2. Right click on subject node, and select menu "Import MRI..."

    menuImportMri.gif

  3. Select file "TutorialCtf/Anatomy/01.mri".
    If you didn't download the CTF tutorial data yet, go back to the Tutorials page.

  4. The MRI viewer is displayed, together with a message box that tells you what to do. Follow the instructions. The MRI is already well oriented so you can directly process with the fiducials selection. You will see that three fiducials were already identified in the MRI file (NAS, LPA, RPA); you just need to add the three other ones (AC, PC, IH).
    For instructions to find the fiducials, follow this link: CoordinateSystems.

Import surfaces

The MRI is available in the anatomy folder for Subject01. Let's now proceed with the surfaces. The envelopes we are going to import in this tutorial were extracted using BrainVISA, and their names and types may differ from other software solutions. To learn how to get those surfaces by yourself: read the tutorial for BrainVISA.

  1. Right click on the subject node again, and click on "Import surfaces...". Select at the same time (holding Shift or Ctrl key) all the files in the directory "TutorialCtf/Anatomy/BrainVISA" (head, Lhemi, Rhemi). Click on "Open" and answer Yes to the question: "Align surfaces with MRI now?".

    • Note: The coordinate system used to localize in 3D the vertices of each surface depends on the software that created them. When importing the surfaces, Brainstorm registers them with the MRI using its fiducials points (NAS, LPA, RPA). This simple algorithm needs the head (ie. scalp) surface, so if you try to import only the cortical surface, it will not be well registered with the MRI, and all the following computations will fail.
  2. You should see the three surfaces in the database tree.

    treeSurfaces.gif

    • One has been identified automatically as a scalp (=head) surface, because its original filename contained the "scalp" keyword. Usually, Brainstorm identifies file types with this kind of tags in the file names.

    • The two other files were not identified automatically. They contain the envelopes of the left and right hemispheres of the brain, but Lhemi and Rhemi are not keywords that are identified automatically by Brainstorm.

    • Try to display the surfaces by double-clicking on them, or with the popup menu Display.

Downsample and merge surfaces

In the Surfaces tab, you can see the numbers of faces and vertices for each surface, and also display their faces (wireframe) with the Edges button. They look great, but their resolution is too high for the algorithms we will apply on them later, they need to be downsampled.

  1. Downsample:
    • Right-click on the head surface > Less vertices...: enter 7000, and press Ok.

    • Right-click on the Lhemi surface > Less vertices...: enter 7500, and press Ok.

    • Right-click on the Rhemi surface > Less vertices...: enter 7500, and press Ok.

    • Three new surfaces appeared in the list, with the number of vertices as a suffix.
  2. Group left and right hemisphere to build a Cortex surface:

    • Select Lhemi_7500V and Rhemi_7500V files at once (hold Ctrl key and left-click on both)

    • Right-click > Merge surfaces

    • A file called New surface appeared at the end of the list, rename it in Cortex (F2 key, or click twice on it but waiting between the two clicks, or right-click > Rename). Its icon should change automatically: the surface has been classified automatically as a Cortex (keyword that was recognized).

    • If you prefer calling it in an other way, you would have to specify manually that it is a cortex envelope: right-click > Set surface type > Cortex

    • Double-click on it to display it (or right-click > Display), and check in the Surfaces tab that the number of vertices is about 15000.

  3. Multiple surfaces of the same type:
    • Here you are in configuration where you have two surfaces that are classified as head.

    • The one which is displayed in green is considered as the default one. It would be used automatically by all the functions that would need the head surface for this subject.
    • Double-click on the other head surface to select it, it should turn green.
    • However, this is not the recommanded way to proceed, it might be confusing. To make things clear: always set as "Other" the surfaces you are not going to use in the source estimation process.

  4. A bit of cleaning:
    • Rename the 01_head_SCS_7000V in Head.

    • Delete all the surfaces but the Head and Cortex (Delete key, or right-click>Delete).

    • Before: treeBeforeCleaning.gif After: treeAfterCleaning.gif

Bug warning

Description: On some operating systems, it may happen that the tree is not refreshed well. Just after adding new files, the database tree can be displayed incompletely or can event appear completely empty. This bug occurs sometimes because the interactions between Matlab and Java are not always well synchronized.

Workaround: If this happens, just refresh the tree display with by either pressing the F5 key, or by changing the display mode. We'll try to fix this bug some day.

Check registration with MRI

Your Subject01 anatomy is ready for source estimation. But before going further, you should always check that surfaces and MRI are well registered. When performing those steps a bit too fast, it is really easy to end up with a cortex envelope that is not aligned with the MRI. None of the following steps in source estimation will check that for you, and the sources estimated would be completely wrong.

Fix registration with MRI

In some rare cases, the surfaces may not be registered correctly with the MRI.

Defining the fiducials on head surface

Manual alignment

What happened on the hard drive

For most manipulations, it is not necessary to know exactly what is going on at the level of the real files, in Brainstorm database directory. But many things are not accessible from the Brainstorm interface, and you may find useful to manipulate some piece of data directly from the Matlab command window.

The right-click > File menu, accessible on all the nodes in Brainstorm database explorer, offers many tools to interact with the file system and the Matlab environment.

Where are the files ?

Several ways to reach a file:

Right-click on any file: Many menus can lead you to the files and their contents, example with the Cortex node:

treeFileMenu.gif

What are all those other files ?

Next

The anatomy of our subject is ready for source estimation, the next tutorial will explain ?how to import recordings.

Tutorials/TutImportAnatomy (last edited 2010-07-21 20:11:51 by hirkania)