41
Brainstorm Brainstorm Walkthrough Walkthrough Stephen Whitmarsh Stephen Whitmarsh Grey Box Research Innovations Grey Box Research Innovations By request of the University of Amsterdam By request of the University of Amsterdam

Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Embed Size (px)

Citation preview

Page 1: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Brainstorm WalkthroughBrainstorm Walkthrough

Stephen WhitmarshStephen WhitmarshGrey Box Research InnovationsGrey Box Research Innovations

By request of the University of AmsterdamBy request of the University of Amsterdam

Page 2: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

BackgroundBackground Brainstorm is software written in MATLAB for the analysis and visualization of MEG and EEG data. It Brainstorm is software written in MATLAB for the analysis and visualization of MEG and EEG data. It

provided routines for computing forward models based on spherical and realistic boundary element provided routines for computing forward models based on spherical and realistic boundary element methods. These latter require that a tessellated representation of the brain, skull and scalp is methods. These latter require that a tessellated representation of the brain, skull and scalp is provide for use in these calculations. Inverse methods include dipole fitting based on the MUSIC provide for use in these calculations. Inverse methods include dipole fitting based on the MUSIC scanning method and cortically constrained minimum norm imaging. Also software is included for scanning method and cortically constrained minimum norm imaging. Also software is included for volumetric and surface rendering of inverse solutions. The methods implemented in this software volumetric and surface rendering of inverse solutions. The methods implemented in this software are described in their publications, which can be accessed at are described in their publications, which can be accessed at http://http://neuroimage.usc.eduneuroimage.usc.edu. They have . They have provided a graphical user interface to their software, but all of the basic functions can be called provided a graphical user interface to their software, but all of the basic functions can be called from the command line and are documented at the BrainStorm website.from the command line and are documented at the BrainStorm website.

This walkthrough will make use of most visualization routines, using data from our own experiments This walkthrough will make use of most visualization routines, using data from our own experiments at the UvA. For converting this EEG data into the Brainstorm format a simple Matlab routine is at the UvA. For converting this EEG data into the Brainstorm format a simple Matlab routine is provided (BV2BS.mat) that can be found in the CNGGP folder on the local computer as well as on provided (BV2BS.mat) that can be found in the CNGGP folder on the local computer as well as on the UvA network (Bigbrother). For accurate localization of the custom EEG electrode positions of the the UvA network (Bigbrother). For accurate localization of the custom EEG electrode positions of the experiment, measurements have been done by the Neuronav system and will be imported together experiment, measurements have been done by the Neuronav system and will be imported together with the EEG data.with the EEG data.

This walkthrough will describe, in a step-by-step way, how to use Brainstorm for the following ends:This walkthrough will describe, in a step-by-step way, how to use Brainstorm for the following ends:• Projecting EEG activity on a 3D reconstruction of the cortex (together with layers of CSF, skull and scalp)Projecting EEG activity on a 3D reconstruction of the cortex (together with layers of CSF, skull and scalp)• Source localizationSource localization• Cortical bounded Minimal Norm imagingCortical bounded Minimal Norm imaging

For this purpose many steps have first to be done. These can become quite confusing since For this purpose many steps have first to be done. These can become quite confusing since Brainstorm will launch many GUI’s, and the whole toolbox is still under construction (Beta). Please Brainstorm will launch many GUI’s, and the whole toolbox is still under construction (Beta). Please try to follow the instructions closely and feel free to ask for assistance at any moment. Additional try to follow the instructions closely and feel free to ask for assistance at any moment. Additional information can be found in the Tutorial and Forum section of the Brainstorm website. One thing is information can be found in the Tutorial and Forum section of the Brainstorm website. One thing is clear though, that your efforts will pay of with impressive visualizations, only possible with this clear though, that your efforts will pay of with impressive visualizations, only possible with this toolbox.toolbox.

Enjoy!Enjoy!

Page 3: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Neurnav system recorded 3D locations of EEG sensors and fiducial points

EEG recordings were made with a custom 32+16 channel cap

From a high-resolution MRI scan 3D tessellated surfaces were made

These will all be combined to permit localization of EEG activity on the MRI and 3D surfaces

Page 4: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

ContentContent Creating Brainstorm studyCreating Brainstorm study Importing BVA EEG data and custom electrode locationsImporting BVA EEG data and custom electrode locations Aligning electrode locations to Subject Coordinate System Aligning electrode locations to Subject Coordinate System

(SCS)(SCS) Warping 3D surfaces and MRI scan to electrode locationsWarping 3D surfaces and MRI scan to electrode locations Projecting activity on 3D white matter surfaceProjecting activity on 3D white matter surface Aligning 3D surfaces to MR scanAligning 3D surfaces to MR scan Creating BEM head modelCreating BEM head model Minimal Norm Imaging of difference wave from masking Minimal Norm Imaging of difference wave from masking

experimentexperiment Extracting signal from Minimal NormExtracting signal from Minimal Norm Creating 3Spheres (BERG) head modelCreating 3Spheres (BERG) head model Source localization of Myriam’s studySource localization of Myriam’s study

Page 5: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

First study: Stack-FrameFirst study: Stack-Frame

We will start by working with data We will start by working with data from a stack-frame paradigm. The from a stack-frame paradigm. The ERP represents the additional activity ERP represents the additional activity (via a subtraction) correlated(via a subtraction) correlatedwith boundary detection.with boundary detection.

Page 6: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Importing EEG dataImporting EEG data Startup brainstorm. Several windows will open. Notice the window called ‘Brainstorm – v…’ from Startup brainstorm. Several windows will open. Notice the window called ‘Brainstorm – v…’ from

which you can call all others. which you can call all others.

Page 7: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Importing EEG dataImporting EEG data Activate the Activate the Data ManagerData Manager via via FileFile in the in the main windowmain window.. Open the Open the Protocol windowProtocol window via via DatabaseDatabase new/edit new/edit

protocolsprotocols Click Click newnew and select the appropriate directories (..\Tutorial\ and select the appropriate directories (..\Tutorial\

Data & ..\Tutorial\Subject) and press Data & ..\Tutorial\Subject) and press SaveSave.. Do what the popup wants: Do what the popup wants: DatabaseDatabase New/EditNew/Edit Subjects Subjects

in Databasein Database Fill in the fieldsFill in the fields by own preference and click by own preference and click addadd.. Be sure to put Be sure to put whateverwhatever name in front of name in front of

‘‘_brainstormsubject.mat’_brainstormsubject.mat’, default is the same of the , default is the same of the subject, but leave the latter part unchanged for future subject, but leave the latter part unchanged for future reference.reference.

Page 8: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Importing EEG dataImporting EEG dataWe are now ready to import the EEG dataset.We are now ready to import the EEG dataset. Data Manager Data Manager Database Database New/Edit New/Edit Datasets (EEG/MEG) Datasets (EEG/MEG) Import New Import New Select the subject that has just been made in the right-side box and then select ‘raw Select the subject that has just been made in the right-side box and then select ‘raw

format’ from the dropdown menu. format’ from the dropdown menu. It will ask for a Study (i.o.w. the name of the experiment). Press It will ask for a Study (i.o.w. the name of the experiment). Press cancelcancel to make one. to make one.

Name it e.g. ‘tutorial’ and click Name it e.g. ‘tutorial’ and click add,add, Save Save and and DoneDone.. Select the brainstormstudy file that has been created, then:Select the brainstormstudy file that has been created, then:

• cchLocations_32+16_Subject.txt hLocations_32+16_Subject.txt voor voor Sensor LocationsSensor Locations • CTFCTF as as coordinate system coordinate system (we will get to the meaning of this soon)(we will get to the meaning of this soon)• Choose ‘Mixed: read file’ and select Choose ‘Mixed: read file’ and select StackFrame_chTypeStackFrame_chType

(This will select certain channels as ‘bad’ that are only used as reference)(This will select certain channels as ‘bad’ that are only used as reference)• ‘‘Cancel’ for Cancel’ for Orientations Orientations (only used for MEG)(only used for MEG)• StackFrameStackFrame_chLabels.txt_chLabels.txt for for Channel LabelsChannel Labels• ‘‘Cancel’ for Cancel’ for Reference WeightsReference Weights• StackFrame_data.rawStackFrame_data.raw for for Spatio-temporal Data Matrix Spatio-temporal Data Matrix (EEG data)(EEG data)• StackFrameStackFrame_sTiming_sTiming for for Time Values Time Values (sample times)(sample times)• YesYes to to TransposeTranspose

Press Press CloseClose SelectSelect Main window Main window Inverse SolutionsInverse Solutions InteractiveInteractive. A new window ‘. A new window ‘data viewerdata viewer’ ’

opens. Dont change anything yet but just press opens. Dont change anything yet but just press plotplot to to see the timeseries to to see the timeseries overlayed per electrode.overlayed per electrode.

Page 9: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

AlignmentsAlignments For a correct correspondence between electrodepositions and a 3D surface or MR scan, For a correct correspondence between electrodepositions and a 3D surface or MR scan,

electrodepositions as well as the target of the projection have to refer to the same coordinate electrodepositions as well as the target of the projection have to refer to the same coordinate system. Brainstorm needs everything in the CTF orientation:system. Brainstorm needs everything in the CTF orientation:

Page 10: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

AlignmentsAlignments For reference purposes four landmark-points (fiducials) For reference purposes four landmark-points (fiducials)

have been measured on the scalp of a test subject, using have been measured on the scalp of a test subject, using the Neuronav system. At the same time ‘dummy’ electrode the Neuronav system. At the same time ‘dummy’ electrode positions were measures: The positions were measures: The NasionNasion, , LeftLeft and and right pre-right pre-auricularauricular as well as the as well as the InionInion. They have not been loaded as . They have not been loaded as EEG channels (automatically marked as ‘bad channels’) but EEG channels (automatically marked as ‘bad channels’) but will be used to determine the coordinate system of all the will be used to determine the coordinate system of all the other electrodes.other electrodes.

For determining the coordinate system of our 3D surfaces For determining the coordinate system of our 3D surfaces we will have to add these positions (Nasion, Left & Right we will have to add these positions (Nasion, Left & Right pre-auricular) manually.pre-auricular) manually.

For the MRI scan fiducials are already supplied although we For the MRI scan fiducials are already supplied although we will probably have to displace them a bit to create a good will probably have to displace them a bit to create a good overlap with the 3D surfaces. overlap with the 3D surfaces.

Page 11: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Aligning 3D surfacesAligning 3D surfacesWe’ll start with aligning the 3D surfacesWe’ll start with aligning the 3D surfaces

Main windowMain window Tools Tools Surface Manager Surface Manager. A new window will appear, showing the . A new window will appear, showing the four layers from the montreal phantom in a list. Select them all and then choose four layers from the montreal phantom in a list. Select them all and then choose AlignAlign from the from the ActionAction drop-down menu. drop-down menu.

Again, new windows will appear: a Again, new windows will appear: a Surface and Channel Alignment ToolSurface and Channel Alignment Tool as well as an as well as an Envelope VizEnvelope Viz. Choose . Choose DirectDirect from the pop-up. from the pop-up.

NasionRight pre-auricular

Page 12: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Aligning surfacesAligning surfaces

Note: You can rotate the surfaces by opening the Camera Note: You can rotate the surfaces by opening the Camera Toolbar in the Envelope Viz (View Toolbar in the Envelope Viz (View Camera Toolbar) and Camera Toolbar) and selecting the utmost left option (orbit camera). Click selecting the utmost left option (orbit camera). Click somewhere on the Envelope Viz and drag the mouse to somewhere on the Envelope Viz and drag the mouse to rotate the camera angle.rotate the camera angle.

Press Press NasionNasion and place the cursor above the nose, on the and place the cursor above the nose, on the head (See previous slide). Press head (See previous slide). Press NasionNasion again to confirm. again to confirm. Repeat for the Repeat for the LeftLeft and and Right pre-auricularRight pre-auricular..

When done, tick the When done, tick the CTFCTF box and press box and press Align SurfacesAlign Surfaces. . Every surface now loaded (WhiteMatter, CSF, Skull and Scalp) will Every surface now loaded (WhiteMatter, CSF, Skull and Scalp) will

be re-written with appropriate coordinates (filenames: *_CTF) and be re-written with appropriate coordinates (filenames: *_CTF) and appear in the surface manager.appear in the surface manager.

Press Quit in the Press Quit in the Surface & Channels Alignment tool.Surface & Channels Alignment tool.

Page 13: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Aligning MR brainAligning MR brainWe will put the MRI scan in the same coordinate system byWe will put the MRI scan in the same coordinate system byappointing the same fiducials. appointing the same fiducials.

Main menu Main menu Tools Tools MRI tool MRI tool.. MRI File MRI File Load Brainstorm Format Load Brainstorm Format. Choose the . Choose the

tutorial_subjectimage. A pretty brainscan will appear with fiducials tutorial_subjectimage. A pretty brainscan will appear with fiducials already appointed. They still have to be defined, though: already appointed. They still have to be defined, though:

Image Coordinates Image Coordinates Define Fiducials Define Fiducials. Select the appropriate . Select the appropriate fiducials and press fiducials and press AssignAssign for all three. Then press for all three. Then press DoneDone. . • First select the same Tutorial_subjectimage to save (and overwrite) First select the same Tutorial_subjectimage to save (and overwrite)

and then select the same file to load again.and then select the same file to load again. The MRI scan has to be linked to the subject. Go to The MRI scan has to be linked to the subject. Go to Data Manager Data Manager

Database Database new/edit new/edit subject in database subject in database. Press . Press RefreshRefresh, , UpdateUpdate and check is everything is there. and check is everything is there.

Press Press Close.Close.

Page 14: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Aligning Electrode positionsAligning Electrode positionsFinally the electrodepositions will be referenced in CTF.Finally the electrodepositions will be referenced in CTF.

In the main Brainstorm window tick the box that says EEG at the left.In the main Brainstorm window tick the box that says EEG at the left. Press Press Load ChannelsLoad Channels in the in the Surface and Alignment Surface and Alignment tool (if you closed the tool (if you closed the

window in the meantime, First go to window in the meantime, First go to Tools Tools Surface Manager Surface Manager, select all , select all four four CTFCTF surfaces and then select surfaces and then select AlignAlign in the drop-down menu again). in the drop-down menu again).

Select the Select the tutorial_channel.mattutorial_channel.mat file. This file has been generated when the file. This file has been generated when the data was imported. Electrodes will appear as yellow dots in the data was imported. Electrodes will appear as yellow dots in the Envelope Envelope VizViz. .

Tick the CTF box on.Tick the CTF box on. Select Select Align Channels, Align Channels, answeranswer No, No, and select the appropriate fiducials (all and select the appropriate fiducials (all

the way at the bottom of the list: ‘the way at the bottom of the list: ‘nasion’nasion’, ‘, ‘left’left’ and ‘ and ‘right’ right’ respectively). respectively).

Note that most electrodes will still not appear on the scalp surface since Note that most electrodes will still not appear on the scalp surface since the shape of the electrode-cap and the shape of the Phantom surface are the shape of the electrode-cap and the shape of the Phantom surface are different. For that purpose we will now ‘warp’ the Phantom surfaces, different. For that purpose we will now ‘warp’ the Phantom surfaces, together with the accompanying MRI scan, to the electrode positions.together with the accompanying MRI scan, to the electrode positions.

Page 15: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

WarpingWarping In the In the Alignment Tool Alignment Tool press press PhantomPhantom..

• Answer Answer NoNo to remove channels – we need the ‘bad’ channels for a better fit to the scalp shape. to remove channels – we need the ‘bad’ channels for a better fit to the scalp shape.• Answer Answer YesYes to alignment. to alignment.

The topmost The topmost AutoassignAutoassign button will associate electrode positions that have been button will associate electrode positions that have been loaded with the similarly named default positions defined by the Phantom. Press that loaded with the similarly named default positions defined by the Phantom. Press that one and see the red warping vectors (pin-needles) in the one and see the red warping vectors (pin-needles) in the Envelope Viz Envelope Viz appear.appear.

Page 16: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

WarpingWarping Press Press GoGo and select the appropriate files IN THE TUTORIAL and select the appropriate files IN THE TUTORIAL

DIRECTORY! It points at the Montreal Phantom by default.DIRECTORY! It points at the Montreal Phantom by default.• select Tutorial_4layer_tess.mat select Tutorial_4layer_tess.mat • Tutorial_subjectimage.mat Tutorial_subjectimage.mat • Wait until the Wait until the message windowmessage window tells you the new warped surfaces have tells you the new warped surfaces have

been saved. been saved. Open the Open the surface managersurface manager again via the again via the main windowmain window ( (toolstools) to ) to

refresh its content.refresh its content. In the In the surface managersurface manager now deselect all surfaces that have been now deselect all surfaces that have been

ticked in the ticked in the viewview box. Select instead all four box. Select instead all four warpedwarped surfaces, tick surfaces, tick the the view boxview box and press and press ViewView. . • (Tip: select one surface, press (Tip: select one surface, press CTRL-A CTRL-A and then tock & un-tick the and then tock & un-tick the View View

box box to deselect all surfaces). Rotate the 3D surface again to see that it to deselect all surfaces). Rotate the 3D surface again to see that it now has a somewhat different shape then before.now has a somewhat different shape then before.

In the In the actionsactions drop-down menu select drop-down menu select View ChannelsView Channels (and select (and select the same channel file as before) to check if electrode positions the same channel file as before) to check if electrode positions now show up on the scalp surface.now show up on the scalp surface.

Page 17: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

ExampleExample For some nice visuals: Select subsequently outer to inner layers (Scalp, Skull & CSF) For some nice visuals: Select subsequently outer to inner layers (Scalp, Skull & CSF)

in the in the surface managersurface manager and make them transparent with the slide on the left in the and make them transparent with the slide on the left in the surface managersurface manager. You can also pick a separate color for each layer.. You can also pick a separate color for each layer.

Page 18: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Checking alignment with MRChecking alignment with MRWe will now have to check if we succeeded aligningWe will now have to check if we succeeded aligningthe 3D surface with the MRI image.the 3D surface with the MRI image.

Open the Open the MRI ToolMRI Tool and load the and load the warpedwarped subjectimage (Main Window subjectimage (Main Window Tools Tools MRI Tool MRI Tool MRI File MRI File Load Brainstorm format). You will notice a samewhat different shape MRI image. It is now warped Load Brainstorm format). You will notice a samewhat different shape MRI image. It is now warped to fit the electrodepositions and, in effect, will resemble the shape of the subject on which we to fit the electrodepositions and, in effect, will resemble the shape of the subject on which we recorder those electrode positions.recorder those electrode positions.

Overwrite the original subjectimage with this warped image (MRI File Overwrite the original subjectimage with this warped image (MRI File Save in Brainstorm format). Save in Brainstorm format). Somehow if you don’t it will keep using the original one for the next calcualtionsSomehow if you don’t it will keep using the original one for the next calcualtions

Open or activate the Open or activate the surface managersurface manager window and select the window and select the warped white matterwarped white matter surface surface From the From the actionaction drop-down menu select drop-down menu select check alignment with MRI. check alignment with MRI. This can take a while (approx. 5 This can take a while (approx. 5

minutes).minutes). The The MRI viewerMRI viewer will appear and will show the warped tessellated surface in yellow on the MR scan. will appear and will show the warped tessellated surface in yellow on the MR scan.

Work the slides to check the alignment. The process can be repeated for the other three surfaces Work the slides to check the alignment. The process can be repeated for the other three surfaces (CTF, Skull and Scalp). Adjust the fiducials on the MRI scan if the alignment seems not good enough (CTF, Skull and Scalp). Adjust the fiducials on the MRI scan if the alignment seems not good enough (selecting, defining and saving procedure as before). (selecting, defining and saving procedure as before).

TIP: since we will be interested in the posterior part of the brain at least that alignment should be TIP: since we will be interested in the posterior part of the brain at least that alignment should be rather accurate. If the yellow boundaries show up too high with respect to the MRI, the fiducials of rather accurate. If the yellow boundaries show up too high with respect to the MRI, the fiducials of the MRI (left and right auricular) can be moved downwards. You can probably leave the nasion in its the MRI (left and right auricular) can be moved downwards. You can probably leave the nasion in its place. See the next slide as an example (I worked hard on that one, for now it doesn’t have to be place. See the next slide as an example (I worked hard on that one, for now it doesn’t have to be perfect).perfect).

Page 19: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

ExampleExample

Page 20: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Some payoff now: Some payoff now: Visualizing the dataVisualizing the data

Now a simple but visually appealing presentation of the data can beNow a simple but visually appealing presentation of the data can bemade.made.

Make sure that Make sure that warped 4 layer-tess warped 4 layer-tess is selected in the is selected in the surfacesurface drop-down menu of drop-down menu of the main Brainstorm window. the main Brainstorm window.

Refresh the Data Viewer window (Main Window Refresh the Data Viewer window (Main Window Inverse Solution Inverse Solution Interactive).Interactive).

Now, in the Now, in the data viewer windowdata viewer window, select , select 3D Scalp Surface3D Scalp Surface in the drop-down menu in the drop-down menu under under Data viewingData viewing. .

Press Press Plot, Plot, selectselect white matter, white matter, and ‘do the twist’. and ‘do the twist’. You can now add the other (warped) surfaces (select in the list, tick the You can now add the other (warped) surfaces (select in the list, tick the view boxview box

and press the and press the viewview buttonbutton).). Play around, if you want, with the transparency and camera angle. Play around, if you want, with the transparency and camera angle. In the In the time windowtime window in the in the data viewerdata viewer a time-point or average over an interval a time-point or average over an interval

(work with (work with stepstep) can be selected, which will be updated on the 3D surface ) can be selected, which will be updated on the 3D surface projection.projection.

With the With the truncate slidetruncate slide on the on the surface managersurface manager more or less signal can be more or less signal can be shown.shown.

Try pressing the Try pressing the gogo button next to button next to smoothsmooth once or more while the white matter once or more while the white matter is selected in the is selected in the surface managersurface manager. It is also possible to add curvature in grey. . It is also possible to add curvature in grey.

Try walking through the Try walking through the timecoursetimecourse (in (in Data ViewerData Viewer press the arrow) and see press the arrow) and see what the signal does in the what the signal does in the Envelope VizEnvelope Viz!!

Page 21: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

ExamplesExamples

Page 22: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Forward problemForward problem Given a set of EEG signals from an array of external sensors, the inverse problem Given a set of EEG signals from an array of external sensors, the inverse problem

involves estimation of the properties of the current sources within the brain that involves estimation of the properties of the current sources within the brain that produced these signals. Before we can make such an estimate, we must first solve produced these signals. Before we can make such an estimate, we must first solve the forward problem, in which we compute the scalp potentials and external fields for the forward problem, in which we compute the scalp potentials and external fields for a specific set of neural current sources. The electric potential picked up by the EEG a specific set of neural current sources. The electric potential picked up by the EEG sensors has first traveled through the cerospinal fluid, the skull and scalp. These all sensors has first traveled through the cerospinal fluid, the skull and scalp. These all have different characteristics of electric conductivity and will distort/spread the have different characteristics of electric conductivity and will distort/spread the electric potentials differently before the signal is finally picked up by the EEG electric potentials differently before the signal is finally picked up by the EEG sensors. Methods for localizing electric fields (or magnetic as in MEG) can solve the sensors. Methods for localizing electric fields (or magnetic as in MEG) can solve the forward problem in several ways.forward problem in several ways.

One way is using simplified geometries so that the head is assumed to consist of a One way is using simplified geometries so that the head is assumed to consist of a set of nested concentric homogeneous spherical shells representing brain, skull, and set of nested concentric homogeneous spherical shells representing brain, skull, and scalp. We will use this approach to localize dipoles scalp. We will use this approach to localize dipoles withinwithin the brain. the brain.

Of course the brain, skull and scalp are in reality not spherical as well and are also Of course the brain, skull and scalp are in reality not spherical as well and are also anisotropic and inhomogeneous. More accurate solutions to the forward problem can anisotropic and inhomogeneous. More accurate solutions to the forward problem can use anatomical information obtained from high resolution volumetric brain images use anatomical information obtained from high resolution volumetric brain images obtained with MR or CT imaging. We have already seen the 3D surfaces that were obtained with MR or CT imaging. We have already seen the 3D surfaces that were extracted from MR images. These can be included in the Boundary Element Method extracted from MR images. These can be included in the Boundary Element Method (BEM) for more accurate calculations. Although it uses realistic shapes, it still (BEM) for more accurate calculations. Although it uses realistic shapes, it still assumes homogeneity and isotropy within each region of the head. We will use the assumes homogeneity and isotropy within each region of the head. We will use the BEM method for Minimal Norm imaging. This assumes that primary sources are BEM method for Minimal Norm imaging. This assumes that primary sources are currents in the currents in the cortical surfacecortical surface. Thus a current dipole is assigned to each of many . Thus a current dipole is assigned to each of many tens of thousands of tessellation elements perpendicular to cortical surface. The tens of thousands of tessellation elements perpendicular to cortical surface. The Minimal Norm image will try to create a least-squares solution using the least amount Minimal Norm image will try to create a least-squares solution using the least amount of (cortical) dipoles.of (cortical) dipoles.

Page 23: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

3 Spheres Headmodel3 Spheres HeadmodelWe will start with the 3 Spheres HeadmodelWe will start with the 3 Spheres Headmodel

Tools Tools Headmodel Headmodel Advanced Advanced.. Select Select 3 Shell-Sphere (BERG)3 Shell-Sphere (BERG) in the in the forward modelingforward modeling box. box. In the head compartments select the warped scalp and the warped white matter for In the head compartments select the warped scalp and the warped white matter for

the scalp and cortex respectively. Tick the the scalp and cortex respectively. Tick the ComputeCompute in the in the Volume Source Grid Volume Source Grid box. box. Press Press AdjustAdjust in the in the Sphere ParametersSphere Parameters box to see the fitted spheres on the scalp in box to see the fitted spheres on the scalp in

the Envelope Viz. See Example.the Envelope Viz. See Example. You can adjust the sphere parameters, but for now leave them at default value.You can adjust the sphere parameters, but for now leave them at default value. Tick the Tick the ComputeCompute box under box under Volume Source GridVolume Source Grid.. Press Press RunRun The headmodel will be saved in the The headmodel will be saved in the Data folderData folder and appear in the main Brainstorm and appear in the main Brainstorm

window under the Headmodel drop-down menu.window under the Headmodel drop-down menu.

A way to make this spherical headmodel A way to make this spherical headmodel more realistic it to first warp the MRI scan and 3D more realistic it to first warp the MRI scan and 3D surfaces to a sphere. Since MEG electrodes are surfaces to a sphere. Since MEG electrodes are positioned in a sphere anyway, using this approach positioned in a sphere anyway, using this approach with MEG sensors will be feasible.with MEG sensors will be feasible.

Page 24: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

UpdatingUpdating

It could happen that Brainstorm does It could happen that Brainstorm does not update all the available files (e.g. not update all the available files (e.g. headmodel).headmodel).

Go to Go to Data Manager Data Manager Database Database new/edit new/edit subject in database subject in database. . Press Press RefreshRefresh and then and then UpdateUpdate and and check is everything is there.check is everything is there.

Page 25: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

RAP-MUSICRAP-MUSICBrainstorm’s source localization method is called RAP-MUSIC. MUSIC stands Brainstorm’s source localization method is called RAP-MUSIC. MUSIC stands for for Multiple Signal Classification ApproachMultiple Signal Classification Approach. It can be applied for the whole . It can be applied for the whole time range thus creating fixed locations of dipoles, as well as for different time range thus creating fixed locations of dipoles, as well as for different time-epochs for which different solutions can be found. Because of the time-epochs for which different solutions can be found. Because of the many possible number of sources located (equal to the number of sensors), many possible number of sources located (equal to the number of sensors), Brainstorm uses the Brainstorm uses the Recursively Applied and ProjectedRecursively Applied and Projected (RAP) method. By (RAP) method. By this way after each successive source is found its contribution to the signal this way after each successive source is found its contribution to the signal will be ‘projected away’, leaving the next source to explain the remaining will be ‘projected away’, leaving the next source to explain the remaining signal. Moreover, one can specify the number of components that the signal. Moreover, one can specify the number of components that the search will start with, according to a manual selection of the number of search will start with, according to a manual selection of the number of components that the data will extract.components that the data will extract.

Open the Open the Data ViewerData Viewer window again ( window again (Inverse Solutions Inverse Solutions Interactive Interactive)) In the In the Analysis boxAnalysis box select select RAP-MUSIC RAP-MUSIC.. The signal will be decomposed in several components. Slide through a The signal will be decomposed in several components. Slide through a

number of ‘number of ‘RanksRanks’ to see the re-composed signal when only several ’ to see the re-composed signal when only several components are included in the further analysis. See next slide for an components are included in the further analysis. See next slide for an example.example.

Page 26: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

ExampleExample

Unexplained signal

Decomposed signal

number of components

Page 27: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

RAP-MUSICRAP-MUSIC Eventually select the suggested number of five or six components/dipoles you want Eventually select the suggested number of five or six components/dipoles you want

to search forto search for and press and press DoneDone. They will subsequently be checked to the correlation . They will subsequently be checked to the correlation threshold, and - if found - appear in the MRI tool window.threshold, and - if found - appear in the MRI tool window.

In the now appearing In the now appearing Parameters RAP-MUSICParameters RAP-MUSIC choose: choose:• Correlation ThresholdCorrelation Threshold on .85 on .85• TruncatedTruncated ConditionCondition as as RegularizationRegularization, , ParameterParameter on 10. on 10.

Press Press ExecuteExecute

Page 28: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

RAP-MUSICRAP-MUSIC It can happen that the computation stops and the Matlab interface It can happen that the computation stops and the Matlab interface

appears. In that case it will ask you if youappears. In that case it will ask you if you really really want to continue while want to continue while sources localized will not meet the statistical threshold. IF you want you sources localized will not meet the statistical threshold. IF you want you can press can press continuecontinue (the downward arrow in the (the downward arrow in the main toolbarmain toolbar of Matlab). of Matlab).

Click on the second source from the list (2) in the Click on the second source from the list (2) in the MRI ViewerMRI Viewer. As can be . As can be seen in the seen in the Data Time Series FigureData Time Series Figure, the second source accommodates the , the second source accommodates the second peak in the data and is placed more anterior to the first.second peak in the data and is placed more anterior to the first.

How would you interpret these results?How would you interpret these results?

Page 29: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

BugBug

Brainstorm needs some workarounds since Brainstorm needs some workarounds since it’s still in a Beta state.it’s still in a Beta state.

Before calculating another headmodel the Before calculating another headmodel the old one has to be removed. Take your old one has to be removed. Take your Windows Explorer to the EEG folder of Windows Explorer to the EEG folder of your subject and your subject and delete all headmodel delete all headmodel filesfiles. The files all start with headmodel_*.. The files all start with headmodel_*.

Page 30: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

BEM HeadmodelBEM HeadmodelNext up is the BEM headmodel. We will use this to look at cortical Next up is the BEM headmodel. We will use this to look at cortical sources of recurrent processing from a masking study with which sources of recurrent processing from a masking study with which you will be familiar now.you will be familiar now.

ToolsTools HeadmodelingHeadmodeling AdvancedAdvanced Select Select BEMBEM in the second drop-down menu. in the second drop-down menu. In the In the BEM parameters menuBEM parameters menu, select successively the , select successively the Warped Warped CSF, CSF,

Skull and Scalp surfaces. In that order! You can view the surfaces Skull and Scalp surfaces. In that order! You can view the surfaces by pressing by pressing view envelopesview envelopes..

Change the Change the Test methodTest method to to CollocationCollocation for calculation speed (or for calculation speed (or else it will take hours).else it will take hours).

In the In the Head Modeling ToolHead Modeling Tool window select the window select the warped white matterwarped white matter as as CortexCortex under under Head CompartmentsHead Compartments. That will be the source of . That will be the source of the forward solution.the forward solution.

Press Press RunRun. When the message window says: ‘BEM with linear . When the message window says: ‘BEM with linear basis’ you will probably have to wait for a while (approx. 5 basis’ you will probably have to wait for a while (approx. 5 minutes).minutes).

Page 31: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

BEM HeadmodelBEM Headmodel

The aligned surfaces for the BEM computation that will show up The aligned surfaces for the BEM computation that will show up automatically should look something like this:automatically should look something like this:

Page 32: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Masking ExperimentMasking Experiment The results of the masking experiment have already been The results of the masking experiment have already been

discussed in a previous practice. Summing up, re-entrant discussed in a previous practice. Summing up, re-entrant activity of the primary visual area’s is suppressed when a activity of the primary visual area’s is suppressed when a stimulus is shortly followed by a mask. This is shown by an stimulus is shortly followed by a mask. This is shown by an absence of activity in the primary visual area’s between absence of activity in the primary visual area’s between approx. 110 and 140 ms. For the purpose of localizing the approx. 110 and 140 ms. For the purpose of localizing the ‘origin of the difference’ between masked and not-masked ‘origin of the difference’ between masked and not-masked stimuli, the ERP from the masked stimuli is subtracted from stimuli, the ERP from the masked stimuli is subtracted from the ERP from unmasked stimuli. See the next two slides to the ERP from unmasked stimuli. See the next two slides to get an impression about the resulting difference wave from get an impression about the resulting difference wave from masked and unmasked stimuli. masked and unmasked stimuli.

Try to formulate how the difference wave would look.Try to formulate how the difference wave would look.

Page 33: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Masking ExperimentMasking Experiment

Page 34: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Masking ExperimentMasking Experiment

Page 35: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Importing EEG dataImporting EEG dataWe will now to import the data from the masking experiment in the same way as we sis We will now to import the data from the masking experiment in the same way as we sis

before.before. Data Manager Data Manager Database Database New/Edit New/Edit Datasets (EEG/MEG) Datasets (EEG/MEG) Import New Import New Select the subject in the right-side box and then select ‘raw format’ from the Select the subject in the right-side box and then select ‘raw format’ from the

dropdown menu. dropdown menu. Select the brainstormstudy file, then:Select the brainstormstudy file, then:

• cchLocations_32+16_Subject.txt hLocations_32+16_Subject.txt voor voor Sensor LocationsSensor Locations • CTFCTF as as coordinate system coordinate system (we will get to the meaning of this soon)(we will get to the meaning of this soon)• Choose ‘Mixed: read file’ and select Choose ‘Mixed: read file’ and select MaskNoMask_chTypeMaskNoMask_chType

(This will select those channels as ‘bad’ that are only used as reference)(This will select those channels as ‘bad’ that are only used as reference)• ‘‘Cancel’ for Cancel’ for Orientations Orientations (only used for MEG)(only used for MEG)• MaskNoMaskMaskNoMask_chLabels.txt_chLabels.txt for for Channel LabelsChannel Labels• ‘‘Cancel’ for Cancel’ for Reference WeightsReference Weights• MaskNoMask_data.rawMaskNoMask_data.raw for for Spatio-temporal Data Matrix Spatio-temporal Data Matrix (EEG data)(EEG data)• MaskNoMaskMaskNoMask_sTiming_sTiming for for Time Values Time Values (sample times)(sample times)• YesYes to to TransposeTranspose

Press Press CloseClose SelectSelect Main window Main window Inverse SolutionsInverse Solutions InteractiveInteractive. A new window ‘. A new window ‘data viewerdata viewer’ ’

opens. Dont change anything yet but just press opens. Dont change anything yet but just press plotplot to to see the timeseries to to see the timeseries overlayed per electrode.overlayed per electrode.

Page 36: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Minimal Norm ImagingMinimal Norm Imaging Close the Close the Surface ManagerSurface Manager, the , the Envelope VizEnvelope Viz and in and in Data ManagerData Manager

press press refreshrefresh.. Make sure the Make sure the warpedwarped MRI and MRI and warped 4 layer tess warped 4 layer tess surfaces are surfaces are

selected in the selected in the Main BrainStorm windowMain BrainStorm window.. In the In the Main BrainStorm windowMain BrainStorm window the headmodel should also have the headmodel should also have

appeared.appeared. Via theVia the Main BrainStorm window Main BrainStorm window go togo to Inverse Solutions Inverse Solutions

Interactive.Interactive. In the analysis section choose In the analysis section choose Minimal Norm imagingMinimal Norm imaging in the drop- in the drop-

down menu of the down menu of the Source ImagingSource Imaging box. box. We’ll constrain the solution a bit by adjusting the We’ll constrain the solution a bit by adjusting the Tikonov Tikonov

regularisationregularisation to 50%. to 50%. We’ll calculate the Minimal Norm for every timepoint so we can We’ll calculate the Minimal Norm for every timepoint so we can

see it evolve over time. The time-course interval for which the see it evolve over time. The time-course interval for which the Minimal Norm will be calculated is taken from the data-viewer box Minimal Norm will be calculated is taken from the data-viewer box and although it can be adjusted here, for the moment just press and although it can be adjusted here, for the moment just press gogo..

Page 37: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Minimal Norm ImagingMinimal Norm Imaging The minimal norm image will shown on the 3D warped cortical surface in a new The minimal norm image will shown on the 3D warped cortical surface in a new Envelope Viz.Envelope Viz. Scroll through the time-course in the Data Viewer and see the Minimal Norm solution for that Scroll through the time-course in the Data Viewer and see the Minimal Norm solution for that

timecourse displayed in the Envelope Viz.timecourse displayed in the Envelope Viz. We can now look up the moment in time at which the difference wave will show re-entrant We can now look up the moment in time at which the difference wave will show re-entrant

processing at the occipital pole. Scroll to 110 ms. It should look something like this:processing at the occipital pole. Scroll to 110 ms. It should look something like this:

Page 38: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Minimal Norm ImagingMinimal Norm ImagingWe are now able to extract mean signal from the dipoles.We are now able to extract mean signal from the dipoles.

First make sure the MRI Manager window is open. If not do so and load the warped First make sure the MRI Manager window is open. If not do so and load the warped subjectimage.subjectimage.

Go to the surface manager and in the action drop-down menu selectGo to the surface manager and in the action drop-down menu select Dispatch Scouts. Dispatch Scouts. Press Press probeprobe on the now appearing on the now appearing Cortical Scout ManagerCortical Scout Manager and move along the 3D and move along the 3D

white matter surface. Notice that the location of the crosshairs will be projected on white matter surface. Notice that the location of the crosshairs will be projected on the MRI scan.the MRI scan.

Click on the most activated area (e.g. left occipital pole)Click on the most activated area (e.g. left occipital pole)

We will include several vertices (each containing a dipole). We will include several vertices (each containing a dipole).

Tick the Tick the constrainedconstrained box in the box in the Cortical Scout ManagerCortical Scout Manager. This will result in only . This will result in only selecting those vertices that are ‘active’ according to the colored overlay.selecting those vertices that are ‘active’ according to the colored overlay.

Press ‘Press ‘+’+’ next to next to scout sizescout size in the in the Cortical Scout ManagerCortical Scout Manager a couple of times to enlarge a couple of times to enlarge the probed area. See the next slide for an example. Also notice that the location of the probed area. See the next slide for an example. Also notice that the location of the probe is shown on the MRI scan.the probe is shown on the MRI scan.

Deselect the Deselect the Absolute valuesAbsolute values box in the box in the Cortical Scout ManagerCortical Scout Manager for a more appealing for a more appealing comparison with the original EEG datacomparison with the original EEG data..

Press Press ActivateActivate on the on the Cortical Scout ManagerCortical Scout Manager to extract the to extract the MeanMean time series. time series. You can add more scouts and by selecting them together, can overlay the activity You can add more scouts and by selecting them together, can overlay the activity

(see next slide for an example).(see next slide for an example).

Page 39: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam
Page 40: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

Concluding this part…Concluding this part…

Do you see the data -as is has been Do you see the data -as is has been visualized now- confirm the visualized now- confirm the hypothesis of interrupted re-entrant hypothesis of interrupted re-entrant processing by masking?processing by masking?

Page 41: Brainstorm Walkthrough Stephen Whitmarsh Grey Box Research Innovations By request of the University of Amsterdam

That’s it!That’s it!

Please feel free to play around now. Please feel free to play around now. (BrainStorm is freeware(BrainStorm is freeware))