4535
Comment:
|
14895
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Tutorials: First steps = | = Tutorial 1: First steps = Objectives: Create a protocol with one subject, that uses the default anatomy Colin27. |
Line 3: | Line 5: |
== Brainstorm database == Brainstorm toolbox allows you to classify your recordings and analysis with three different levels of definition: * '''Protocol''' * Some people would prefer to call this ''experiment ''or ''study''. * It can designate all the data that were acquired on one or several subjects, with the same objectives (study of a specific cognitive task, epileptic spikes localization, functional differences between two populations). * Default data can be defined at the protocol level. If you cannot get the individual MR images of all or some of your subjects, you can use a default anatomy. If you want to localize the sources for an EEG recording but do not know the location of each electrode in space, you can use standardized electrodes positions. * '''Subject''' * A person who participated in a given protocol. * You need two categories of information to define a subject: * Files describing the subject's anatomy : MRI and surfaces * Functional data files, ie. files that have a temporal dimension or that are related to a precise recording session: EEG / MEG recordings, definition of the sensors, source estimations, statistical results... * '''Condition''' * For each subject, functional files can be classified in different ''experimental conditions''. * This level of definition is also used to separate different ''runs ''(ie. recording sessions) for the same subject. === Some properties === * It is created and managed completely from the Brainstorm GUI (tree in the main interface window) * It is based on the files/directories architecture: * Anatomy data in: protocol_name/subject_name/'''anat'''/ * Functional data in: protocol_name/subject_name/'''data'''/condition_name/ * Each file you see in the Brainstorm window corresponds to a proper file on the hard drive; but the contrary is not necessarily true. There are extra information stored in each directory, to save properties, comments, default data, links between different items, etc.For this reason, you should not try to manipulate directly the files in the Brainstorm database directory. * Database structure in memory: * A copy of the database structure is saved by Brainstorm in your home directory (''~username'' on Linux, ''Documents and settings\username'' on Windows), so that when you start the program or change protocol, there is no need to read again all the files on the hard drive (this may take some time). * As a consequence, the files that are displayed in the Brainstorm window may differ from what is actually on the disk (if some process crashed, or if you moved or add some files by yourself. If this happens, you will have to reload the current protocol (popup menu ''Reload'') or the whole database (menu ''File > Reload database'') |
|
Line 15: | Line 44: |
== Brainstorm database == Brainstorm toolbox allows you to classify your recordings and analysis with three different levels of definition: * '''Protocol''' * Some people would prefer to call this ''experiment ''or ''study''. * It can designate all the data that were acquired on one or several subjects, with the same objectives (study of a specific cognitive task, epileptic spikes localization, functional differences between two populations). * Each protocol may include one or several subjects. * Default data can be defined at the protocol level. If you cannot get the individual MR images of all or some of your subjects, you can use a default anatomy. If you want to localize the sources for an EEG recording but do not know the location of each electrode in space, you can use standardized electrodes positions. * '''Subject''' * A person who participated in a given protocol. * You need two categories of information to define a subject: * Files describing the subject's anatomy : MRI and surfaces * Functional data files, ie. files that have a temporal dimension or that are related to a precise recording session: EEG / MEG recordings, definition of the sensors, source estimations, statistical results... * '''Condition''' * For each subject, functional files can be classified in different ''experimental conditions''. * This level of definition is also used to separate different ''runs ''(ie. recording sessions) for the same subject. Some Brainstorm database properties: * It is created and managed completely from the Brainstorm GUI (tree in the main interface window) * It is based on the files/directories architecture: * Anatomy data in: protocol_name/subject_name/'''anat'''/ * Functional data in: protocol_name/subject_name/'''data'''/condition_name/ * Each file you see in the Brainstorm window corresponds to a proper file on the hard drive; but the contrary is not necessarily true. There are extra information stored in each directory, to save properties, comments, default data, links between different items, etc. * For this reason, you should not try to manipulate directly the files in the Brainstorm database directory. * A copy of the database structure is saved by Brainstorm in your home directory, so that when you start the program or change protocol, there is no need to read again all the files on the hard drive (this may take some time).<<BR>>As a consequence, the files that are displayed in the Brainstorm window may differ from what is actually on the disk (if some process crashed, or if you moved or add some files by yourself).<<BR>>If this happens, you will have to reload the current protocol (popup menu ''Reload'') or the whole database (menu ''File > Reload database'') |
|
Line 44: | Line 46: |
1. Edit the protocol name and enter: "Tutorial_FirstSteps". It will automatically update the paths to the ''Anatomy path'' and the ''Dataset path'' 1. Select the "" |
1. Edit the protocol name and enter: "!TutorialFirstSteps". It will automatically update the paths (''Anatomy path'' and ''Datasets path''. 1. Select the "''MNI Colin27''" as the default anatomy. * This anatomy (MRI & surfaces) will be available if needed by all the subjects in the protocol. * This can be changed later, using the "''Use default''" menu in the subjects' popup menu. * This default anatomy is based on the ''Colin27 ''MRI volume provided by the Montreal Neurological Institute: an average of 27 T1-weighted scans of Colin Holmes brain. Many surfaces are provided with this default anatomy; they were extracted with different programs: [[Links|BrainVisa]], [[Links|BrainSuite]], and [[Links|FreeSurfer]]. 1. ''Subjects configuration'' panel: * These are the default settings that will be applied when creating new subjects. It is then possible to override those settings for each subject. * Our objective is to create one subject that uses the default anatomy Colin27, so select the option "''Yes, use protocol's default anatomy''". * The option selected for ''Default channel file'' is not important because we are not going to import recordings (and channel files, ie. files that describe each sensor: position, orientation, name...). This point will be described in another tutorial. 1. Once you get something like the following figure, click on ''Create''.<<BR>><<BR>> {{attachment:createNewProtocol.gif}} 1. Confirm that you want to create the directories 1. The ''MRI Viewer'' window opens automatically and displays the Colin27 brain, and a message box informs you that you should select some points on the MRI. Those fiducial points are used to register the MRI with the MEG or EEG sensors, when you import recordings. We don't need to define them now, because we are not going to import any recordings in this turorial, but let's play with the MRI Viewer Viewer. == Fiducials selection (MRI Viewer) == MRI Viewer window: * {{attachment:mriViewer.gif}} * You can navigate through the volume by clicking anywhere in the slices, or by using the sliders below each image. * There are four small buttons above each image. They may be useful when you import your own MR volumes, if they are not oriented in the way Brainstorm want them (e.g. you see the ''Sagittal ''title on top of the coronal view; or the small white "''P''", which is supposed to indicate the posterior part of the head, points the nose). Leave your mouse a few seconds over button one to read their description tooltip. Click on them and try to understand what they are doing. * Images' contrast can be changed with the mouse: click and hold the right button on one image, and move your mouse up and down (this operation will be later referred as ''right-click+move''). * Right-clicking in any view shows a popup menu that will be discribed in the following tutorials. * You can define six points on the MRI: * Three to define the [[CoordinateSystems|Subject Coordinate System (SCS)]]: Nasion (NAS), Left pre-auricular point (LPA), Right pre-auricular point (RPA), * Three to define the[[CoordinateSystems|Talairach coordinate system]] (referred here as ''Normalized CS''): Anterior commissure (AC), Posterior commissure (PC), and any Interhemispheric point (IH).<<BR>> => To know more about [[CoordinateSystems|how to define the fiducial points]]. * To define a point, position the three views at the point your want to define (pointed by the 3 crosses), and click on the ''Set ''button. Later you can click on ''View ''to move the views to this point again. * You can see that all the points are already defined on this MRI, but you should '''always '''check their positions. For many reasons, each research group has a different way to define those points. So you may not position the ears or the nasion exactly the same way as we do. So do not hesitate to move the fiducials to better fit your needings; if not the results might be much less accurate. * The ''Display options'' panel allows to hide some of the components. If the ''MIP/Anatomy ''checkbox is selected, the Maximum Intensity Power is displayed instead of the regular slices: At each point, the value displayed is the maximum value across all the slices. * The ''Coordinates ''panel shows the (x,y,z) coordinates in all the coordinate systems managed by Brainstorm: MRI, SCS, and Talairach. * Once you're done, click on ''Cancel ''(unless you really want to save all your experimentations). == Protocol exploration == The protocol is created and you can now see it in the database explorer, in Brainstorm window. It is represented by the top-most node in the tree. . {{attachment:treeNewProtocol.gif||height="151px",width="333px"}} * You can switch between anatomy and functional data with the first three buttons in the toolbar. They are no subjects in the database yet, so the ''Functional data'' views are completely empty. However, in the ''Anatomy ''view, there is a ''(Default anatomy)'' node; it contains the MRI and surfaces that can be used by default for the subjects without individual anatomy. * Display the ''Anatomy ''view, click on the small "+" to expand the contents of the ''(Default anatomy)'' node. There is one MRI and several surfaces, identified by different icons. * All you can do with each node (anatomy files, subjects, protocol), is accessible by right-clicking on it. Take 10 minutes to explore all the popup menus by yourself. Don't be afraid to click everywhere you want, at this point you cannot damage anything. * If you explored well, you should have found the "''New subject''" menu in the protocol's popup menu. Click on it. ||<tablewidth="200px"#ffffff style="vertical-align: top;"> {{attachment:menuNewSubject.gif}} || {{attachment:createNewSubject.gif||height="296",width="341"}} || * Usually, the only thing you need to do here is to edit the name of the subject. * But you can also override here the protocol's defaults regarding the sharing of anatomy and channel file between subjects and conditions. For the example, leave selected the "''Yes, use default anatomy''" option. The click on ''Save''. * You should see a the new subject in both ''Anatomy ''and ''Functional data'' views. * In the Anatomy view, the subject node only contains a link called (Default anatomy). It is here just to remind that the subject is using the default ''MNI Colin27'' anatomy.<<BR>> {{attachment:subjectDefaultAnat.gif}} == MRI visualization == There are three different ways to display the MR volumes. Right click on the ''T1-MRI'' in ''Default anatomy'', menu ''Display''. <<BR>>Just click everywhere and try all the options by yourself, it is the best way to learn. === MRI Viewer === Already introduced in this tutorial. Note: it is the default visualization mode; when you double-click on the T1-MRI file, it brings up the MRI Viewer. === Axial / coronal / sagittal slices === {{attachment:mriSlicesContact.gif||height="231",width="210"}} * Zoom: mouse wheel * Move in zoomed image: click + move * Adjust contrast: right click + move up/down * Colormap selection in menu * Save as image in menu === 3D orthogonal slices === ||<tablewidth="200px"> {{attachment:mriSlices3d.gif||height="229",width="292"}} || {{attachment:menuShortcut.gif}} || * '''Simple mouse operations ''' * Rotate: click + move * Zoom: mouse wheel * Move object: left+right click + move * Move MRI slices: right click + move along direction of the slice (or ''Resect ''panel in ''Surfaces ''tab) * Colormap contrast/brightness: click on the colorbar, and move up/down (brightness) or left/right (contrast) * Reset view: double click * '''Popup operations''' (right-click on the figure) * Full ''Anatomy ''colormap edition (detailed in next tutorial) * Snapshots: save images or movies from this figure * Figure: display X,Y,Z axes and menus for an advanced figure editing and management using Matlab tools. * Views: configure camera position with pre-defined settings. * '''Keyboard shortcuts''': * Notice the indications in the right part of the popup menu (''CTRL+A'' in front of ''Figures>Axes'', ''"1"'' in front of ''Views>Left''), they represent the keyboard shortcut for each menu. * Views shortcuts (0,1,2...9 and "="): Remember them, they will be very useful when exploring the cortical sources. It is much faster to press a key to switch from left to right hemisphere, than having to rotate the brain with the mouse. * '''Surfaces tab''' (in the Brainstorm main window): * This panel is dedicated to the surfaces display, but some controls can also be useful for 3D MRI view. * ''Transparency ''slider * ''Smooth ''slider: it changes the threshold applied to the MRI slices. If you set it zero, you will see the full slices, as extracted from the volume. * ''Resect ''panel: you cna change the position of the slices with the three sliders. == Surfaces visualization == There is only one way to display the surfaces: in 3D figures. To display a surface you can either double-click on it or right-click > Display. * It is the same type on figure than previously (3D), thus all the mouse and keyboard operations are the same. * If you display two surfaces from the same anatomy directory, they will be displayed on the same figure. * Surfaces tab: more options are available<<BR>><<BR>> {{attachment:panelSurfaces.gif||height="321",width="532"}} * Open the ''Cortex ''surface and try all the buttons and sliders. Then do the same with the ''Scalp ''surface. All the controls should have some effect on the display, except the sliders in the "''Data options''" panel. They are useful only when some additional data is mapped on the surfaces. * Multiple surfaces: If you have more than one surface in a figure, you need to select the surface you want to edit before changing its properties. The list of the available surfaces is displayed on top of the ''Surfaces ''tab. * You can also quickly add or remove surfaces in any 3D figure with the top-right buttons of the ''Surfaces ''tab. == Next == Now you know how to create a protocol with a default anatomy, and visualize MR volumes and surfaces. Next step: learn how to [[Tutorials/TutImportAnatomy|import an individual anatomy]] for a subject. |
Tutorial 1: First steps
Objectives: Create a protocol with one subject, that uses the default anatomy Colin27.
Contents
Brainstorm database
Brainstorm toolbox allows you to classify your recordings and analysis with three different levels of definition:
Protocol
Some people would prefer to call this experiment or study.
- It can designate all the data that were acquired on one or several subjects, with the same objectives (study of a specific cognitive task, epileptic spikes localization, functional differences between two populations).
- Default data can be defined at the protocol level. If you cannot get the individual MR images of all or some of your subjects, you can use a default anatomy. If you want to localize the sources for an EEG recording but do not know the location of each electrode in space, you can use standardized electrodes positions.
Subject
- A person who participated in a given protocol.
- You need two categories of information to define a subject:
- Files describing the subject's anatomy : MRI and surfaces
- Functional data files, ie. files that have a temporal dimension or that are related to a precise recording session: EEG / MEG recordings, definition of the sensors, source estimations, statistical results...
Condition
For each subject, functional files can be classified in different experimental conditions.
This level of definition is also used to separate different runs (ie. recording sessions) for the same subject.
Some properties
- It is created and managed completely from the Brainstorm GUI (tree in the main interface window)
- It is based on the files/directories architecture:
Anatomy data in: protocol_name/subject_name/anat/
Functional data in: protocol_name/subject_name/data/condition_name/
- Each file you see in the Brainstorm window corresponds to a proper file on the hard drive; but the contrary is not necessarily true. There are extra information stored in each directory, to save properties, comments, default data, links between different items, etc.For this reason, you should not try to manipulate directly the files in the Brainstorm database directory.
- Database structure in memory:
A copy of the database structure is saved by Brainstorm in your home directory (~username on Linux, Documents and settings\username on Windows), so that when you start the program or change protocol, there is no need to read again all the files on the hard drive (this may take some time).
As a consequence, the files that are displayed in the Brainstorm window may differ from what is actually on the disk (if some process crashed, or if you moved or add some files by yourself. If this happens, you will have to reload the current protocol (popup menu Reload) or the whole database (menu File > Reload database)
Running Brainstorm for the first time
- Start Matlab, go to brainstorm3 directory, and type "brainstorm3" in Matlab command window.
- With some Matlab installations, you may observe an error message in the command window, about the compilation of the MEX files. Some files from the permutation tests functions need to be compiled on your own operating system, and you may not be able to use some statistical tests if you have such an error. You may ignore this problem, it will be fixed later.
The Licence Agreement will be display. Read the licence file, and click on "Agree" if you agree with it.
If you have two screens on your computer, you may have a message asking if you want to use your second screen. You can try to say yes: you will have the Brainstorm window on primary screen and the data figures on the secondary one). If does not work properly, go to the menu Options > GUI, and uncheck the menu "Use two screens when available".
Then you will be asked to specify Brainstorm database directory. Read carefully the Important notes and then create or select an empty directory to store your Brainstorm database (for instance "brainstorm_database", or "brainstorm_protocols").
- After a last message asking you to create or load a protocol, you should see the main Brainstorm window
Main interface window
Create first protocol
Click on the Protocol selection drop list, and select Create new protocol.
Edit the protocol name and enter: "TutorialFirstSteps". It will automatically update the paths (Anatomy path and Datasets path.
Select the "MNI Colin27" as the default anatomy.
This anatomy (MRI & surfaces) will be available if needed by all the subjects in the protocol.
This can be changed later, using the "Use default" menu in the subjects' popup menu.
This default anatomy is based on the Colin27 MRI volume provided by the Montreal Neurological Institute: an average of 27 T1-weighted scans of Colin Holmes brain. Many surfaces are provided with this default anatomy; they were extracted with different programs: ?BrainVisa, ?BrainSuite, and ?FreeSurfer.
Subjects configuration panel:
- These are the default settings that will be applied when creating new subjects. It is then possible to override those settings for each subject.
Our objective is to create one subject that uses the default anatomy Colin27, so select the option "Yes, use protocol's default anatomy".
The option selected for Default channel file is not important because we are not going to import recordings (and channel files, ie. files that describe each sensor: position, orientation, name...). This point will be described in another tutorial.
Once you get something like the following figure, click on Create.
- Confirm that you want to create the directories
The MRI Viewer window opens automatically and displays the Colin27 brain, and a message box informs you that you should select some points on the MRI. Those fiducial points are used to register the MRI with the MEG or EEG sensors, when you import recordings. We don't need to define them now, because we are not going to import any recordings in this turorial, but let's play with the MRI Viewer Viewer.
Fiducials selection (MRI Viewer)
MRI Viewer window:
- You can navigate through the volume by clicking anywhere in the slices, or by using the sliders below each image.
There are four small buttons above each image. They may be useful when you import your own MR volumes, if they are not oriented in the way Brainstorm want them (e.g. you see the Sagittal title on top of the coronal view; or the small white "P", which is supposed to indicate the posterior part of the head, points the nose). Leave your mouse a few seconds over button one to read their description tooltip. Click on them and try to understand what they are doing.
Images' contrast can be changed with the mouse: click and hold the right button on one image, and move your mouse up and down (this operation will be later referred as right-click+move).
- Right-clicking in any view shows a popup menu that will be discribed in the following tutorials.
- You can define six points on the MRI:
Three to define the Subject Coordinate System (SCS): Nasion (NAS), Left pre-auricular point (LPA), Right pre-auricular point (RPA),
Three to define theTalairach coordinate system (referred here as Normalized CS): Anterior commissure (AC), Posterior commissure (PC), and any Interhemispheric point (IH).
=> To know more about how to define the fiducial points.To define a point, position the three views at the point your want to define (pointed by the 3 crosses), and click on the Set button. Later you can click on View to move the views to this point again.
You can see that all the points are already defined on this MRI, but you should always check their positions. For many reasons, each research group has a different way to define those points. So you may not position the ears or the nasion exactly the same way as we do. So do not hesitate to move the fiducials to better fit your needings; if not the results might be much less accurate.
The Display options panel allows to hide some of the components. If the MIP/Anatomy checkbox is selected, the Maximum Intensity Power is displayed instead of the regular slices: At each point, the value displayed is the maximum value across all the slices.
The Coordinates panel shows the (x,y,z) coordinates in all the coordinate systems managed by Brainstorm: MRI, SCS, and Talairach.
Once you're done, click on Cancel (unless you really want to save all your experimentations).
Protocol exploration
The protocol is created and you can now see it in the database explorer, in Brainstorm window. It is represented by the top-most node in the tree.
You can switch between anatomy and functional data with the first three buttons in the toolbar. They are no subjects in the database yet, so the Functional data views are completely empty. However, in the Anatomy view, there is a (Default anatomy) node; it contains the MRI and surfaces that can be used by default for the subjects without individual anatomy.
Display the Anatomy view, click on the small "+" to expand the contents of the (Default anatomy) node. There is one MRI and several surfaces, identified by different icons.
- All you can do with each node (anatomy files, subjects, protocol), is accessible by right-clicking on it. Take 10 minutes to explore all the popup menus by yourself. Don't be afraid to click everywhere you want, at this point you cannot damage anything.
If you explored well, you should have found the "New subject" menu in the protocol's popup menu. Click on it.
|
|
- Usually, the only thing you need to do here is to edit the name of the subject.
But you can also override here the protocol's defaults regarding the sharing of anatomy and channel file between subjects and conditions. For the example, leave selected the "Yes, use default anatomy" option. The click on Save.
You should see a the new subject in both Anatomy and Functional data views.
In the Anatomy view, the subject node only contains a link called (Default anatomy). It is here just to remind that the subject is using the default MNI Colin27 anatomy.
MRI visualization
There are three different ways to display the MR volumes. Right click on the T1-MRI in Default anatomy, menu Display.
Just click everywhere and try all the options by yourself, it is the best way to learn.
MRI Viewer
Already introduced in this tutorial.
Note: it is the default visualization mode; when you double-click on the T1-MRI file, it brings up the MRI Viewer.
Axial / coronal / sagittal slices
- Zoom: mouse wheel
- Move in zoomed image: click + move
- Adjust contrast: right click + move up/down
- Colormap selection in menu
- Save as image in menu
3D orthogonal slices
|
|
Simple mouse operations
- Rotate: click + move
- Zoom: mouse wheel
- Move object: left+right click + move
Move MRI slices: right click + move along direction of the slice (or Resect panel in Surfaces tab)
- Colormap contrast/brightness: click on the colorbar, and move up/down (brightness) or left/right (contrast)
- Reset view: double click
Popup operations (right-click on the figure)
Full Anatomy colormap edition (detailed in next tutorial)
- Snapshots: save images or movies from this figure
- Figure: display X,Y,Z axes and menus for an advanced figure editing and management using Matlab tools.
- Views: configure camera position with pre-defined settings.
Keyboard shortcuts:
Notice the indications in the right part of the popup menu (CTRL+A in front of Figures>Axes, "1" in front of Views>Left), they represent the keyboard shortcut for each menu.
- Views shortcuts (0,1,2...9 and "="): Remember them, they will be very useful when exploring the cortical sources. It is much faster to press a key to switch from left to right hemisphere, than having to rotate the brain with the mouse.
Surfaces tab (in the Brainstorm main window):
- This panel is dedicated to the surfaces display, but some controls can also be useful for 3D MRI view.
Transparency slider
Smooth slider: it changes the threshold applied to the MRI slices. If you set it zero, you will see the full slices, as extracted from the volume.
Resect panel: you cna change the position of the slices with the three sliders.
Surfaces visualization
There is only one way to display the surfaces: in 3D figures. To display a surface you can either double-click on it or right-click > Display.
- It is the same type on figure than previously (3D), thus all the mouse and keyboard operations are the same.
- If you display two surfaces from the same anatomy directory, they will be displayed on the same figure.
Surfaces tab: more options are available
Open the Cortex surface and try all the buttons and sliders. Then do the same with the Scalp surface. All the controls should have some effect on the display, except the sliders in the "Data options" panel. They are useful only when some additional data is mapped on the surfaces.
Multiple surfaces: If you have more than one surface in a figure, you need to select the surface you want to edit before changing its properties. The list of the available surfaces is displayed on top of the Surfaces tab.
You can also quickly add or remove surfaces in any 3D figure with the top-right buttons of the Surfaces tab.
Next
Now you know how to create a protocol with a default anatomy, and visualize MR volumes and surfaces.
Next step: learn how to ?import an individual anatomy for a subject.