11367
Comment:
|
19936
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
''Authors: Ken Taylor, John Mosher'' | ''Authors: Ken Taylor, ''''''Francois Tadel, ''John Mosher'' |
Line 23: | Line 23: |
R.J. Ilmoniemi, M.S. Hämäläinen, and J. Knuutila, The Forward and Inverse Problems in the Spherical Model. In: Biomagnetism: Applications and Theory, eds. H. Weinberg, G. Stroink, T. Katil, Pergamon Press, 1985. Elekta Neuromag System Hardware User's Manual, Revision G, September 2005. |
* R.J. Ilmoniemi, M.S. Hämäläinen, and J. Knuutila, The Forward and Inverse Problems in the Spherical Model. In: Biomagnetism: Applications and Theory, eds. H. Weinberg, G. Stroink, T. Katil, Pergamon Press, 1985. * Elekta Neuromag System Hardware User's Manual, Revision G, September 2005. |
Line 28: | Line 27: |
[To do] | Files distributed as part of the phantom Elekta tutorial: * kojak_all_2000nAm_pp_no_chpi_no_ms_raw.fif<<BR>>Source =''' 2000 nAm'''. This corresponds to an unrealistically strong 1,000 nA-m (2,000 nA-m peak to peak) dipole that gives the highest SNR visualization of the experimental source. * kojak_all_200nAm_pp_no_chpi_no_ms_raw.fif<<BR>>Source =''' 200 nAm'''. This is a weaker dipole, closer to the range of amplitudes we can expect from inter-ictal spikes due to epilepsy, visible in raw data. * kojak_all_20nAm_pp_no_chpi_no_ms_raw.fif<<BR>>Source =''' 20 nAm'''. This represents some of the weakest sources we expect in evoked studies which require averaging to detect and estimate (i.e. generally cannot be seen in single trials). * All recordings were performed by John Mosher in the MEG lab at the Cleveland Clinic with an Elekta phantom. |
Line 32: | Line 36: |
* Go to the [[http://neuroimage.usc.edu/bst/download.php|Download]] page of this website, and download the file: '''sample_phantom_elekta.zip''' | * Go to the [[http://neuroimage.usc.edu/bst/download.php|Download]] page and download the file: '''sample_phantom_elekta.zip''' |
Line 35: | Line 39: |
Select the menu File > Create new protocol. Name it '''TutorialPhantomElekta''' and select the options: * '''No, use individual anatomy''', * '''No, use one channel file per acquisition run (MEG)'''. |
* Select the menu File > Create new protocol. Name it '''TutorialPhantomElekta''' and select: * '''No, use individual anatomy''', * '''No, use one channel file per acquisition run (MEG)'''. |
Line 43: | Line 45: |
This creates a new subject '''Kojak_Sphere''' (so named after the 70's TV show) and generates the "anatomy" for this device: one volume and a few surfaces representing the geometry of the phantom. <<BR>><<BR>> |
* This creates a new subject '''Kojak''' (so named after the 70's TV show) and generates the "anatomy" for this device: one volume and a few surfaces representing the geometry of the phantom. <<BR>><<BR>> |
Line 48: | Line 49: |
* You can display the MRI and surfaces as presented in the introduction tutorials. <<BR>><<BR>> {{attachment:MRIandSurface.gif||height="427",width="630"}} | * You can display the MRI and surfaces as presented in the introduction tutorials. <<BR>><<BR>> {{attachment:phantom_mri.gif||height="387",width="336"}} {{attachment:phantom_surfaces.gif||height="216",width="254"}} |
Line 56: | Line 57: |
* Select the '''200nA''' source. |
* Select the file format: "'''MEG/EEG: Elekta-Neuromag (*.fif)'''" * Select the '''200nA''' file: '''sample_phantom_elekta'''/kojak_all_200nAm...fif |
Line 61: | Line 63: |
Close the figure and double click the link to raw file to open a list of the events. At this point, you may wish to rename your groups so that the ordering remains convenient. To do this, click group 1, click '''Events''' > '''Rename group''', and rename it to '''01'''. Repeat this for 2 - 9. This step, and others like it, can also be performed by importing the data into '''MATLAB''', running the following code below, and then exporting the data back into Brainstorm: {{{ % to change the trigger numbers to appear sequentially for i = 1:32, STR = str2num(link_filename.F.events(i).label); link_filename.F.events(i).label = sprintf('%02.0f',STR); |
* A figure is opened at the end of the import to show the position of the phantom in the MEG: <<BR>><<BR>> {{attachment:phantom_registration.gif||height="180",width="493"}} == Organize the events == * Double click the link to raw file: it opens the recordings and shows the list of the events. * In the Record tab, rename your groups so that the ordering remains convenient: * Double-click on event group "1" (or menu Events > Rename group), rename it to '''01'''. * Repeat this for events #2-#9. * Some unnecessary triggers are generated by the neuromag system, we will delete them: * Select all the categories with only one event ('''#256-#7939'''), press the '''delete '''key. * These steps can also be performed from your MATLAB command window: * Close the file viewer. * Right-click on the link > File > Export to Matlab > "link" * Run the lines of code below: {{{ for i = 1:32 STR = str2num(link.F.events(i).label); link.F.events(i).label = sprintf('%02.0f',STR); |
Line 71: | Line 81: |
}}} Some other triggers are generated by the neuromag system which are unnecessary so we will delete them: * Trim away the singleton events by clicking on '''256 (x1)''', shift clicking on '''7936 (x1)''' and pressing the '''delete''' key. There is also a switching transient in the phantom generator which should be removed: * Remove the first event from dipole '''01''' by clicking on it, clicking on the '''first''' time instant, and pressing the '''delete''' key. Events should now appear as per the image below on the right: <<BR>> |
link.F.events(33:end) = []; }}} * Right-click on the link > File > Import from Matlab > "link". * There is also a switching transient in the phantom generator which should be removed: * Select category '''01''', click on the '''first''' time instant and press the '''delete''' key. * Events should now appear as per the image below on the right: <<BR>><<BR>> |
Line 84: | Line 90: |
__'''Note:'''__''' '''Make sure to save the modifications that you make before proceeding. If you hit the grey X to close all figures and clear memory, you will be prompted to save modifications, and you should click '''Yes'''. == Importing the dipole events == Right click on '''Link to raw file''' and click '''Import in database''' |
* Close the recordings figure to save the modifications. == Import the dipole events == Right click on Link to raw file > '''Import in database''': * Select all the events '''#01-#32''', Epoch time = '''[-100,300]ms''' |
Line 90: | Line 97: |
* Check '''Remove DC offset''', set the time range from -100 to -10ms | * Check '''Remove DC offset''', time range = '''[-100,-10]ms''' |
Line 93: | Line 100: |
* Click '''Import'''<<BR>><<BR>> {{attachment:kojak_dipole_import.gif||height="306",width="630"}} <<BR>><<BR>> | * Click '''Import'''<<BR>><<BR>> {{attachment:kojak_dipole_import.gif||height="306",width="630"}} |
Line 96: | Line 103: |
With the epochs loaded, we can now calculate the noise covariance from the prestims. To do this, '''select all 32 dipoles''' (click the first then shift click the last), then right click, '''Noise covariance''' > '''Compute from recordings'''. Uncheck '''MEG MAG''' and hit '''OK'''. <<BR>><<BR>> . {{attachment:kojak_noise_covariance.gif||height="216",width="630"}} <<BR>><<BR>> Average all of the epochs by '''selecting all 32 '''again, dragging them to the process box, clicking '''RUN'''. Next click the cog, and select '''Average''' > '''Average files'''. Group the files '''By trial group (folder average)''', and select '''Arithmetic average: mean(x)''', and click "'''Run'''". <<BR>><<BR>> |
With the epochs imported, we can now calculate the noise covariance from the prestims: * Select all the imported epochs (click on the first group, hold the shift key, click on the last). * Right-click on any epochs group > Noise covariance > '''Compute from recordings'''. * Keep all the default options and hit '''OK'''.<<BR>><<BR>> . {{attachment:kojak_noise_covariance.gif||height="216",width="630"}} == Average trials == * In Process1, select all the 32 trials groups. * Run process '''Average''' > '''Average files''' > '''By trial group (folder average)'''.<<BR>><<BR>> |
Line 105: | Line 118: |
To compute the head model, right click on the '''kojak_all_200nA '''file and select '''Compute head model'''. * Source space: select '''MRI volume''' * Forward modeling methods: '''Single sphere'''<<BR>><<BR>> {{attachment:kojak_head_model.gif||height="233",width="630"}} . <<BR>> A figure opens showing a sphere fit to the phantom, however we can see that the location is a little off. In this case we alread know where the center of the sphere should be, so we adjust it manually: * Click the '''Edit sphere properties''' button in the top toolbar. * Change the center location to '''[ 0 0 0 ] '''and hit OK. The center of the sphere shifts to the correct position. Click the '''OK '''button next to the edit sphere properties button to perform the MRI/surface interpolation. A window appears allowing adjustment of the volume source grid. * Select '''Regular grid (isotropic) '''with '''Grid resolution 2.5mm''' This results in an around 56K grid point, which is sufficient.<<BR>><<BR>> . {{attachment:kojak_sphere.gif||height="335",width="630"}} . <<BR>> |
* Right-click on the channel file > '''Compute head model '''> '''MRI volume''', '''Single sphere'''. <<BR>><<BR>> {{attachment:kojak_head_model.gif||height="233",width="630"}} * A figure opens showing a sphere fit to the phantom, however we can see that the location is not exactly (0,0,0). We can adjust it manually: * Click the '''Edit sphere properties''' button in the top toolbar. * Change the center location to '''[ 0 0 0 ] '''and hit OK. * Click the '''[OK] '''button. A window appears allowing adjustment of the volume source grid. * Select '''Regular grid (isotropic) '''with '''Grid resolution 2.5mm'''. <<BR>>This results in an around 56K grid point, which is sufficient.<<BR>><<BR>> {{attachment:kojak_sphere.gif||height="335",width="630"}} |
Line 181: | Line 180: |
. {{attachment:kojak_3D.gif||height="306",width="630"}} . <<BR>> == Results == {{{ Dipole Loc (mm) Amp (nA-m) Gof Perf Chi2 RChi2 -------------------------------------------------------------------------- 01 - [ -0.4 -60.4 21.3] 75.1 98.8% 208.7 513 (201) 2.55 02 - [ 2.1 -47.9 21.3] 83.3 97.9% 117.4 295 (201) 1.47 03 - [ -0.4 -35.4 23.8] 79.8 94.1% 64.5 263 (201) 1.31 04 - [ -0.4 -25.4 21.3] 74.6 83.9% 36.2 251 (201) 1.25 05 - [ 2.1 -35.4 48.8] 92.7 98.1% 154.3 466 (201) 2.32 06 - [ 2.1 -25.4 43.8] 91.4 96.8% 87.9 256 (201) 1.27 07 - [ 2.1 -15.4 38.8] 90.7 91.9% 53.2 251 (201) 1.25 08 - [ 2.1 -5.4 33.8] 77.7 80.9% 30.6 222 (201) 1.10 09 - [-60.4 2.1 21.3] 77.3 98.6% 204.2 584 (201) 2.91 10 - [-47.9 2.1 23.8] 82.2 98.0% 120.0 290 (201) 1.44 11 - [-35.4 -0.4 23.8] 83.9 94.8% 69.1 262 (201) 1.30 12 - [-25.4 2.1 21.3] 80.4 88.9% 42.3 224 (201) 1.12 13 - [-35.4 2.1 51.3] 84.4 98.4% 178.3 507 (201) 2.52 14 - [-27.9 2.1 43.8] 86.0 96.9% 101.7 326 (201) 1.62 15 - [-15.4 2.1 38.8] 89.3 93.5% 60.9 258 (201) 1.28 16 - [ -7.9 2.1 31.3] 80.4 83.1% 35.2 251 (201) 1.25 17 - [ -0.4 47.1 41.3] 85.8 98.7% 176.4 423 (201) 2.10 18 - [ -0.4 44.6 31.3] 77.1 98.0% 106.0 229 (201) 1.14 19 - [ -0.4 42.1 18.8] 72.7 94.5% 68.7 273 (201) 1.36 20 - [ -0.4 34.6 8.8] 74.4 88.8% 42.3 224 (201) 1.12 21 - [ -0.4 14.6 61.3] 79.5 98.3% 131.7 306 (201) 1.52 22 - [ 2.1 17.1 48.8] 87.9 96.1% 82.1 274 (201) 1.36 23 - [ 2.1 22.1 36.3] 86.4 92.5% 55.9 253 (201) 1.26 24 - [ 2.1 19.6 23.8] 91.6 84.0% 36.7 258 (201) 1.28 25 - [ 47.1 2.1 41.3] 88.1 97.1% 94.2 264 (201) 1.31 26 - [ 42.1 -0.4 31.3] 83.7 93.9% 61.7 247 (201) 1.23 27 - [ 37.1 -0.4 18.8] 87.5 88.9% 45.6 260 (201) 1.29 28 - [ 29.6 2.1 11.3] 85.3 87.7% 32.7 151 (201) 0.75 29 - [ 14.6 2.1 58.8] 92.1 97.6% 129.1 402 (201) 2.00 30 - [ 17.1 2.1 48.8] 86.8 95.8% 76.7 257 (201) 1.28 31 - [ 19.6 2.1 38.8] 80.1 91.3% 48.3 223 (201) 1.11 32 - [ 22.1 2.1 23.8] 87.2 84.6% 34.3 213 (201) 1.06 Location errors from true Dipole Loc (mm) True (mm) Diff [x y z] Norm (mm) ------------------------------------------------------------------------------ 01 - [ -0.4 -60.4 21.3] [ 0.0 -59.7 22.9] [ -0.4 -0.7 -1.6] ( 1.8) 02 - [ 2.1 -47.9 21.3] [ 0.0 -48.6 23.5] [ 2.1 0.7 -2.2] ( 3.2) 03 - [ -0.4 -35.4 23.8] [ 0.0 -35.8 25.5] [ -0.4 0.4 -1.7] ( 1.8) 04 - [ -0.4 -25.4 21.3] [ 0.0 -24.8 23.1] [ -0.4 -0.6 -1.8] ( 2.0) 05 - [ 2.1 -35.4 48.8] [ 0.0 -37.2 52.0] [ 2.1 1.8 -3.2] ( 4.3) 06 - [ 2.1 -25.4 43.8] [ 0.0 -27.5 46.4] [ 2.1 2.1 -2.6] ( 4.0) 07 - [ 2.1 -15.4 38.8] [ 0.0 -15.8 41.0] [ 2.1 0.4 -2.2] ( 3.1) 08 - [ 2.1 -5.4 33.8] [ 0.0 -7.9 33.0] [ 2.1 2.5 0.8] ( 3.4) 09 - [-60.4 2.1 21.3] [-59.7 -0.0 22.9] [ -0.7 2.1 -1.6] ( 2.7) 10 - [-47.9 2.1 23.8] [-48.6 -0.0 23.5] [ 0.7 2.1 0.3] ( 2.2) 11 - [-35.4 -0.4 23.8] [-35.8 -0.0 25.5] [ 0.4 -0.4 -1.7] ( 1.8) 12 - [-25.4 2.1 21.3] [-24.8 -0.0 23.1] [ -0.6 2.1 -1.8] ( 2.8) 13 - [-35.4 2.1 51.3] [-37.2 -0.0 52.0] [ 1.8 2.1 -0.7] ( 2.9) 14 - [-27.9 2.1 43.8] [-27.5 -0.0 46.4] [ -0.4 2.1 -2.6] ( 3.4) 15 - [-15.4 2.1 38.8] [-15.8 -0.0 41.0] [ 0.4 2.1 -2.2] ( 3.1) 16 - [ -7.9 2.1 31.3] [ -7.9 -0.0 33.0] [ 0.0 2.1 -1.7] ( 2.7) 17 - [ -0.4 47.1 41.3] [ 0.0 46.1 44.4] [ -0.4 1.0 -3.1] ( 3.3) 18 - [ -0.4 44.6 31.3] [ 0.0 41.9 34.0] [ -0.4 2.7 -2.7] ( 3.8) 19 - [ -0.4 42.1 18.8] [ 0.0 38.3 21.6] [ -0.4 3.8 -2.8] ( 4.7) 20 - [ -0.4 34.6 8.8] [ 0.0 31.5 12.7] [ -0.4 3.1 -3.9] ( 5.0) 21 - [ -0.4 14.6 61.3] [ 0.0 13.9 62.4] [ -0.4 0.7 -1.1] ( 1.4) 22 - [ 2.1 17.1 48.8] [ 0.0 16.2 51.5] [ 2.1 0.9 -2.7] ( 3.6) 23 - [ 2.1 22.1 36.3] [ 0.0 20.0 39.1] [ 2.1 2.1 -2.8] ( 4.1) 24 - [ 2.1 19.6 23.8] [ 0.0 19.3 27.9] [ 2.1 0.3 -4.1] ( 4.7) 25 - [ 47.1 2.1 41.3] [ 46.1 -0.0 44.4] [ 1.0 2.1 -3.1] ( 3.9) 26 - [ 42.1 -0.4 31.3] [ 41.9 -0.0 34.0] [ 0.2 -0.4 -2.7] ( 2.8) 27 - [ 37.1 -0.4 18.8] [ 38.3 -0.0 21.6] [ -1.2 -0.4 -2.8] ( 3.1) 28 - [ 29.6 2.1 11.3] [ 31.5 -0.0 12.7] [ -1.9 2.1 -1.4] ( 3.1) 29 - [ 14.6 2.1 58.8] [ 13.9 -0.0 62.4] [ 0.7 2.1 -3.6] ( 4.2) 30 - [ 17.1 2.1 48.8] [ 16.2 -0.0 51.5] [ 0.9 2.1 -2.7] ( 3.6) 31 - [ 19.6 2.1 38.8] [ 20.0 -0.0 39.1] [ -0.4 2.1 -0.3] ( 2.1) 32 - [ 22.1 2.1 23.8] [ 19.3 -0.0 27.9] [ 2.8 2.1 -4.1] ( 5.4) Orientation errors from true Dipole Amp (nA-m) [X Y Z] TRUE [X Y Z] Degrees ------------------------------------------------------------------------ 01 - ( 75.1) [-0.01 0.31 0.95] vs [ 0.00 0.36 0.93] ( 3.0 ) 02 - ( 83.3) [-0.02 0.38 0.93] vs [ 0.00 0.44 0.90] ( 3.7 ) 03 - ( 79.8) [-0.09 0.52 0.85] vs [ 0.00 0.58 0.81] ( 6.5 ) 04 - ( 74.6) [-0.10 0.60 0.79] vs [ 0.00 0.68 0.73] ( 8.2 ) 05 - ( 92.7) [-0.03 0.79 0.61] vs [ 0.00 0.81 0.58] ( 2.7 ) 06 - ( 91.4) [-0.02 0.85 0.53] vs [ 0.00 0.86 0.51] ( 2.0 ) 07 - ( 90.7) [-0.02 0.91 0.41] vs [ 0.00 0.93 0.36] ( 3.2 ) 08 - ( 77.7) [ 0.10 0.98 0.19] vs [ 0.00 0.97 0.23] ( 6.0 ) 09 - ( 77.3) [ 0.32 0.03 0.95] vs [ 0.36 0.00 0.93] ( 3.0 ) 10 - ( 82.2) [ 0.43 0.08 0.90] vs [ 0.44 0.00 0.90] ( 4.7 ) 11 - ( 83.9) [ 0.53 0.10 0.84] vs [ 0.58 0.00 0.81] ( 6.7 ) 12 - ( 80.4) [ 0.61 0.20 0.76] vs [ 0.68 0.00 0.73] ( 12.1 ) 13 - ( 84.4) [ 0.82 0.02 0.58] vs [ 0.81 0.00 0.58] ( 1.5 ) 14 - ( 86.0) [ 0.84 0.02 0.55] vs [ 0.86 0.00 0.51] ( 2.8 ) 15 - ( 89.3) [ 0.92 0.10 0.37] vs [ 0.93 0.00 0.36] ( 6.0 ) 16 - ( 80.4) [ 0.96 0.13 0.25] vs [ 0.97 0.00 0.23] ( 7.3 ) 17 - ( 85.8) [ 0.00 -0.66 0.75] vs [ 0.00 -0.69 0.72] ( 2.7 ) 18 - ( 77.1) [-0.05 -0.57 0.82] vs [ 0.00 -0.63 0.78] ( 5.2 ) 19 - ( 72.7) [-0.13 -0.39 0.91] vs [ 0.00 -0.49 0.87] ( 9.5 ) 20 - ( 74.4) [-0.15 -0.22 0.96] vs [ 0.00 -0.37 0.93] ( 12.3 ) 21 - ( 79.5) [-0.10 -0.97 0.22] vs [ 0.00 -0.98 0.22] ( 5.6 ) 22 - ( 87.9) [-0.08 -0.95 0.32] vs [ 0.00 -0.95 0.30] ( 4.5 ) 23 - ( 86.4) [-0.11 -0.85 0.51] vs [ 0.00 -0.89 0.46] ( 7.3 ) 24 - ( 91.6) [-0.18 -0.75 0.63] vs [ 0.00 -0.82 0.57] ( 11.8 ) 25 - ( 88.1) [-0.65 0.03 0.76] vs [-0.69 0.00 0.72] ( 3.8 ) 26 - ( 83.7) [-0.58 -0.01 0.81] vs [-0.63 0.00 0.78] ( 3.6 ) 27 - ( 87.5) [-0.43 -0.03 0.90] vs [-0.49 0.00 0.87] ( 4.3 ) 28 - ( 85.3) [-0.32 -0.04 0.95] vs [-0.37 0.00 0.93] ( 4.1 ) 29 - ( 92.1) [-0.97 -0.02 0.25] vs [-0.98 0.00 0.22] ( 2.0 ) 30 - ( 86.8) [-0.94 -0.02 0.34] vs [-0.95 0.00 0.30] ( 2.5 ) 31 - ( 80.1) [-0.89 -0.00 0.46] vs [-0.89 0.00 0.46] ( 0.5 ) 32 - ( 87.2) [-0.71 -0.00 0.70] vs [-0.82 0.00 0.57] ( 9.7 ) }}} == Scripting == ==== Generate Matlab script ==== Available in the Brainstorm distribution: '''brainstorm3/toolbox/script/tutorial_phantom_elekta.m''' |
MEG current phantom (Elekta-Neuromag)
Authors: Ken Taylor, Francois Tadel, John Mosher This tutorial explains how to import and process Elekta-Neuromag current phantom recordings. We decided to release this example for testing and cross-validation purposes. With these datasets, we can evaluate the equivalence of various forward models and dipole fitting methods in the case of simple recordings with single dipoles. The recordings are available in two file formats (native and FIF) to cross-validate the file readers available in Brainstorm and MNE. A similar page exists for the CTF phantom. Contents
This tutorial dataset remains a property of its authors: Ken Taylor, John Mosher (Epilepsy Center, Cleveland Clinic Neurological Institute, Cleveland, OH USA). If you reference this dataset in your publications, please acknowledge them and cite Brainstorm as indicated on the website. For questions, please contact us through the forum.
A current phantom is provided with the Elekta Neuromag for checking the system performance. It contains 32 artificial dipoles and four fixed head-position indicator coils. The phantom is based on the mathematical fact that an equilateral triangular line current produces equivalent magnetic field distribution to that of a tangential current dipole in a spherical conductor, provided that the vertex of the triangle and the origin of the conducting sphere coincide. For a detailed description of how the phantom works, see here. The phantom dipoles are energized using an internal signal generator which also feeds the HPI coils. An external multiplexer box is used to connect the signal to the individual dipoles. Only one dipole can be activated at a time. The location of the dipole is recorded relative to the center of the sphere (0,0,0)m, where X is positive toward the nasion, Y is positive toward the left ear and Z is positive toward the top of the head (see the CoordinateSystems tutorial for more details). Use of the phantom is shown below. Note that the uncovered version is the phantom that came with the Neuromag-122, which explicitly shows the wiring. The covered version uses the same principle but somewhat different dipole locations. Further details are available in Section 7.2 of the User's Manual.
Files distributed as part of the phantom Elekta tutorial: kojak_all_2000nAm_pp_no_chpi_no_ms_raw.fif kojak_all_200nAm_pp_no_chpi_no_ms_raw.fif kojak_all_20nAm_pp_no_chpi_no_ms_raw.fif
Requirements: You have followed the introduction tutorials and Brainstorm is installed. Go to the Download page and download the file: sample_phantom_elekta.zip Select the menu File > Create new protocol. Name it TutorialPhantomElekta and select: No, use individual anatomy, No, use one channel file per acquisition run (MEG).
In the Matlab command window: type "generate_phantom_elekta". This creates a new subject Kojak (so named after the 70's TV show) and generates the "anatomy" for this device: one volume and a few surfaces representing the geometry of the phantom. You can display the MRI and surfaces as presented in the introduction tutorials.
We can now review one of the raw kojak data sets. These have been generated by sequentially activating each of the 32 phantom dipoles in a single raw file. Switch to the functional data view by clicking the second button under the protocol name. Right-click on the subject folder > Review raw file. Select the file format: "MEG/EEG: Elekta-Neuromag (*.fif)" Select the 200nA file: sample_phantom_elekta/kojak_all_200nAm...fif Click Event channel, select STI201, and hit OK. A figure is opened at the end of the import to show the position of the phantom in the MEG:
Double-click on event group "1" (or menu Events > Rename group), rename it to 01. Select all the categories with only one event (#256-#7939), press the delete key. Right-click on the link > File > Export to Matlab > "link" Right-click on the link > File > Import from Matlab > "link". Select category 01, click on the first time instant and press the delete key. Events should now appear as per the image below on the right:
Right click on Link to raw file > Import in database: Select all the events #01-#32, Epoch time = [-100,300]ms Uncheck Apply SSP/ICA projectors (we will use noise covariance to stabilize the data) Check Remove DC offset, time range = [-100,-10]ms Resample the recordings to 100Hz (change from 1000Hz) Do not create separate folders Click Import
With the epochs imported, we can now calculate the noise covariance from the prestims: Right-click on any epochs group > Noise covariance > Compute from recordings. Keep all the default options and hit OK.
Run process Average > Average files > By trial group (folder average).
Right-click on the channel file > Compute head model > MRI volume, Single sphere. Click the Edit sphere properties button in the top toolbar. Change the center location to [ 0 0 0 ] and hit OK. Click the [OK] button. A window appears allowing adjustment of the volume source grid. Select Regular grid (isotropic) with Grid resolution 2.5mm.
Right click the Single sphere (volume) and select Compute sources [2016] Method: Dipole modeling Source model: Dipole orientations Unconstrained For the sensor selection you can choose to use either the gradiometers or the magnetometers, in this case we select both. Click Show details if the noise covariance regularization is hidden. Select Regularize noise covariance: 0.1 Ignore the other settings, and click OK
Select the set of 32 averages and drop them into the process box again. Switch to process sources and click the cog in the pipeline editor. Select Sources > Dipole Scanning [BETTER]. Set the process options to look at 60ms only by changing the Time window to 60ms - 60ms, and clicking Run. Next we should average all the dipole fits together. To do this, we can expand the tree of average files and select Avg: 01 (19 files) | dipole scan through Avg: 32 (20 files) | dipole scan, then right click and select Merge dipoles. Alternatively, we can set Matlab to the study directory and use As an optional step, we can sign flip the dipoles in Matlab so that they are all pointing up for convenience. To do this, right click on Merge: 32 files and export to Matlab as the variable merge_dips. Then in Matlab use the following code: You can then right click on the channel file and click File Right click on the flippled dipole merge and click Diplay on MRI (3D), which brings up a figure showing the dipole locations. To compare these to the true locations in Matlab, you can run the following code: The true dipole locations are now shown in red along with the estimated locations in blue:
Available in the Brainstorm distribution: brainstorm3/toolbox/script/tutorial_phantom_elekta.m License
The phantom
References
Description of the experiment
Source = 2000 nAm. This corresponds to an unrealistically strong 1,000 nA-m (2,000 nA-m peak to peak) dipole that gives the highest SNR visualization of the experimental source.
Source = 200 nAm. This is a weaker dipole, closer to the range of amplitudes we can expect from inter-ictal spikes due to epilepsy, visible in raw data.
Source = 20 nAm. This represents some of the weakest sources we expect in evoked studies which require averaging to detect and estimate (i.e. generally cannot be seen in single trials). Download and installation
Generate anatomy
Access the recordings
Organize the events
for i = 1:32
STR = str2num(link.F.events(i).label);
link.F.events(i).label = sprintf('%02.0f',STR);
end
link.F.events(33:end) = [];
Import the dipole events
Noise covariance
Average trials
Head modelling
This results in an around 56K grid point, which is sufficient.
Dipole source estimation
Dipole scanning
FILES = dir('dipoles_fit*');
new = dipoles_merge({FILES.name});
for i = 1:32,
merge_dips.Dipole(i).Amplitude = merge_dips.Dipole(i).Amplitude*...
sign(merge_dips.Dipole(i).Amplitude(3));
end
merge_dips.Comment = [merge_dips.Comment ' | flipped'];
[true_dipole_mat,true_loc,true_orient] = generate_phantom_neuromag_dips;
hold on
hq = quiver3(true_loc(1,:),true_loc(2,:),true_loc(3,:),...
true_orient(1,:),true_orient(2,:),true_orient(3,:));
hold off
set(hq,'color','r'),shg
Results
Dipole Loc (mm) Amp (nA-m) Gof Perf Chi2 RChi2
--------------------------------------------------------------------------
01 - [ -0.4 -60.4 21.3] 75.1 98.8% 208.7 513 (201) 2.55
02 - [ 2.1 -47.9 21.3] 83.3 97.9% 117.4 295 (201) 1.47
03 - [ -0.4 -35.4 23.8] 79.8 94.1% 64.5 263 (201) 1.31
04 - [ -0.4 -25.4 21.3] 74.6 83.9% 36.2 251 (201) 1.25
05 - [ 2.1 -35.4 48.8] 92.7 98.1% 154.3 466 (201) 2.32
06 - [ 2.1 -25.4 43.8] 91.4 96.8% 87.9 256 (201) 1.27
07 - [ 2.1 -15.4 38.8] 90.7 91.9% 53.2 251 (201) 1.25
08 - [ 2.1 -5.4 33.8] 77.7 80.9% 30.6 222 (201) 1.10
09 - [-60.4 2.1 21.3] 77.3 98.6% 204.2 584 (201) 2.91
10 - [-47.9 2.1 23.8] 82.2 98.0% 120.0 290 (201) 1.44
11 - [-35.4 -0.4 23.8] 83.9 94.8% 69.1 262 (201) 1.30
12 - [-25.4 2.1 21.3] 80.4 88.9% 42.3 224 (201) 1.12
13 - [-35.4 2.1 51.3] 84.4 98.4% 178.3 507 (201) 2.52
14 - [-27.9 2.1 43.8] 86.0 96.9% 101.7 326 (201) 1.62
15 - [-15.4 2.1 38.8] 89.3 93.5% 60.9 258 (201) 1.28
16 - [ -7.9 2.1 31.3] 80.4 83.1% 35.2 251 (201) 1.25
17 - [ -0.4 47.1 41.3] 85.8 98.7% 176.4 423 (201) 2.10
18 - [ -0.4 44.6 31.3] 77.1 98.0% 106.0 229 (201) 1.14
19 - [ -0.4 42.1 18.8] 72.7 94.5% 68.7 273 (201) 1.36
20 - [ -0.4 34.6 8.8] 74.4 88.8% 42.3 224 (201) 1.12
21 - [ -0.4 14.6 61.3] 79.5 98.3% 131.7 306 (201) 1.52
22 - [ 2.1 17.1 48.8] 87.9 96.1% 82.1 274 (201) 1.36
23 - [ 2.1 22.1 36.3] 86.4 92.5% 55.9 253 (201) 1.26
24 - [ 2.1 19.6 23.8] 91.6 84.0% 36.7 258 (201) 1.28
25 - [ 47.1 2.1 41.3] 88.1 97.1% 94.2 264 (201) 1.31
26 - [ 42.1 -0.4 31.3] 83.7 93.9% 61.7 247 (201) 1.23
27 - [ 37.1 -0.4 18.8] 87.5 88.9% 45.6 260 (201) 1.29
28 - [ 29.6 2.1 11.3] 85.3 87.7% 32.7 151 (201) 0.75
29 - [ 14.6 2.1 58.8] 92.1 97.6% 129.1 402 (201) 2.00
30 - [ 17.1 2.1 48.8] 86.8 95.8% 76.7 257 (201) 1.28
31 - [ 19.6 2.1 38.8] 80.1 91.3% 48.3 223 (201) 1.11
32 - [ 22.1 2.1 23.8] 87.2 84.6% 34.3 213 (201) 1.06
Location errors from true
Dipole Loc (mm) True (mm) Diff [x y z] Norm (mm)
------------------------------------------------------------------------------
01 - [ -0.4 -60.4 21.3] [ 0.0 -59.7 22.9] [ -0.4 -0.7 -1.6] ( 1.8)
02 - [ 2.1 -47.9 21.3] [ 0.0 -48.6 23.5] [ 2.1 0.7 -2.2] ( 3.2)
03 - [ -0.4 -35.4 23.8] [ 0.0 -35.8 25.5] [ -0.4 0.4 -1.7] ( 1.8)
04 - [ -0.4 -25.4 21.3] [ 0.0 -24.8 23.1] [ -0.4 -0.6 -1.8] ( 2.0)
05 - [ 2.1 -35.4 48.8] [ 0.0 -37.2 52.0] [ 2.1 1.8 -3.2] ( 4.3)
06 - [ 2.1 -25.4 43.8] [ 0.0 -27.5 46.4] [ 2.1 2.1 -2.6] ( 4.0)
07 - [ 2.1 -15.4 38.8] [ 0.0 -15.8 41.0] [ 2.1 0.4 -2.2] ( 3.1)
08 - [ 2.1 -5.4 33.8] [ 0.0 -7.9 33.0] [ 2.1 2.5 0.8] ( 3.4)
09 - [-60.4 2.1 21.3] [-59.7 -0.0 22.9] [ -0.7 2.1 -1.6] ( 2.7)
10 - [-47.9 2.1 23.8] [-48.6 -0.0 23.5] [ 0.7 2.1 0.3] ( 2.2)
11 - [-35.4 -0.4 23.8] [-35.8 -0.0 25.5] [ 0.4 -0.4 -1.7] ( 1.8)
12 - [-25.4 2.1 21.3] [-24.8 -0.0 23.1] [ -0.6 2.1 -1.8] ( 2.8)
13 - [-35.4 2.1 51.3] [-37.2 -0.0 52.0] [ 1.8 2.1 -0.7] ( 2.9)
14 - [-27.9 2.1 43.8] [-27.5 -0.0 46.4] [ -0.4 2.1 -2.6] ( 3.4)
15 - [-15.4 2.1 38.8] [-15.8 -0.0 41.0] [ 0.4 2.1 -2.2] ( 3.1)
16 - [ -7.9 2.1 31.3] [ -7.9 -0.0 33.0] [ 0.0 2.1 -1.7] ( 2.7)
17 - [ -0.4 47.1 41.3] [ 0.0 46.1 44.4] [ -0.4 1.0 -3.1] ( 3.3)
18 - [ -0.4 44.6 31.3] [ 0.0 41.9 34.0] [ -0.4 2.7 -2.7] ( 3.8)
19 - [ -0.4 42.1 18.8] [ 0.0 38.3 21.6] [ -0.4 3.8 -2.8] ( 4.7)
20 - [ -0.4 34.6 8.8] [ 0.0 31.5 12.7] [ -0.4 3.1 -3.9] ( 5.0)
21 - [ -0.4 14.6 61.3] [ 0.0 13.9 62.4] [ -0.4 0.7 -1.1] ( 1.4)
22 - [ 2.1 17.1 48.8] [ 0.0 16.2 51.5] [ 2.1 0.9 -2.7] ( 3.6)
23 - [ 2.1 22.1 36.3] [ 0.0 20.0 39.1] [ 2.1 2.1 -2.8] ( 4.1)
24 - [ 2.1 19.6 23.8] [ 0.0 19.3 27.9] [ 2.1 0.3 -4.1] ( 4.7)
25 - [ 47.1 2.1 41.3] [ 46.1 -0.0 44.4] [ 1.0 2.1 -3.1] ( 3.9)
26 - [ 42.1 -0.4 31.3] [ 41.9 -0.0 34.0] [ 0.2 -0.4 -2.7] ( 2.8)
27 - [ 37.1 -0.4 18.8] [ 38.3 -0.0 21.6] [ -1.2 -0.4 -2.8] ( 3.1)
28 - [ 29.6 2.1 11.3] [ 31.5 -0.0 12.7] [ -1.9 2.1 -1.4] ( 3.1)
29 - [ 14.6 2.1 58.8] [ 13.9 -0.0 62.4] [ 0.7 2.1 -3.6] ( 4.2)
30 - [ 17.1 2.1 48.8] [ 16.2 -0.0 51.5] [ 0.9 2.1 -2.7] ( 3.6)
31 - [ 19.6 2.1 38.8] [ 20.0 -0.0 39.1] [ -0.4 2.1 -0.3] ( 2.1)
32 - [ 22.1 2.1 23.8] [ 19.3 -0.0 27.9] [ 2.8 2.1 -4.1] ( 5.4)
Orientation errors from true
Dipole Amp (nA-m) [X Y Z] TRUE [X Y Z] Degrees
------------------------------------------------------------------------
01 - ( 75.1) [-0.01 0.31 0.95] vs [ 0.00 0.36 0.93] ( 3.0 )
02 - ( 83.3) [-0.02 0.38 0.93] vs [ 0.00 0.44 0.90] ( 3.7 )
03 - ( 79.8) [-0.09 0.52 0.85] vs [ 0.00 0.58 0.81] ( 6.5 )
04 - ( 74.6) [-0.10 0.60 0.79] vs [ 0.00 0.68 0.73] ( 8.2 )
05 - ( 92.7) [-0.03 0.79 0.61] vs [ 0.00 0.81 0.58] ( 2.7 )
06 - ( 91.4) [-0.02 0.85 0.53] vs [ 0.00 0.86 0.51] ( 2.0 )
07 - ( 90.7) [-0.02 0.91 0.41] vs [ 0.00 0.93 0.36] ( 3.2 )
08 - ( 77.7) [ 0.10 0.98 0.19] vs [ 0.00 0.97 0.23] ( 6.0 )
09 - ( 77.3) [ 0.32 0.03 0.95] vs [ 0.36 0.00 0.93] ( 3.0 )
10 - ( 82.2) [ 0.43 0.08 0.90] vs [ 0.44 0.00 0.90] ( 4.7 )
11 - ( 83.9) [ 0.53 0.10 0.84] vs [ 0.58 0.00 0.81] ( 6.7 )
12 - ( 80.4) [ 0.61 0.20 0.76] vs [ 0.68 0.00 0.73] ( 12.1 )
13 - ( 84.4) [ 0.82 0.02 0.58] vs [ 0.81 0.00 0.58] ( 1.5 )
14 - ( 86.0) [ 0.84 0.02 0.55] vs [ 0.86 0.00 0.51] ( 2.8 )
15 - ( 89.3) [ 0.92 0.10 0.37] vs [ 0.93 0.00 0.36] ( 6.0 )
16 - ( 80.4) [ 0.96 0.13 0.25] vs [ 0.97 0.00 0.23] ( 7.3 )
17 - ( 85.8) [ 0.00 -0.66 0.75] vs [ 0.00 -0.69 0.72] ( 2.7 )
18 - ( 77.1) [-0.05 -0.57 0.82] vs [ 0.00 -0.63 0.78] ( 5.2 )
19 - ( 72.7) [-0.13 -0.39 0.91] vs [ 0.00 -0.49 0.87] ( 9.5 )
20 - ( 74.4) [-0.15 -0.22 0.96] vs [ 0.00 -0.37 0.93] ( 12.3 )
21 - ( 79.5) [-0.10 -0.97 0.22] vs [ 0.00 -0.98 0.22] ( 5.6 )
22 - ( 87.9) [-0.08 -0.95 0.32] vs [ 0.00 -0.95 0.30] ( 4.5 )
23 - ( 86.4) [-0.11 -0.85 0.51] vs [ 0.00 -0.89 0.46] ( 7.3 )
24 - ( 91.6) [-0.18 -0.75 0.63] vs [ 0.00 -0.82 0.57] ( 11.8 )
25 - ( 88.1) [-0.65 0.03 0.76] vs [-0.69 0.00 0.72] ( 3.8 )
26 - ( 83.7) [-0.58 -0.01 0.81] vs [-0.63 0.00 0.78] ( 3.6 )
27 - ( 87.5) [-0.43 -0.03 0.90] vs [-0.49 0.00 0.87] ( 4.3 )
28 - ( 85.3) [-0.32 -0.04 0.95] vs [-0.37 0.00 0.93] ( 4.1 )
29 - ( 92.1) [-0.97 -0.02 0.25] vs [-0.98 0.00 0.22] ( 2.0 )
30 - ( 86.8) [-0.94 -0.02 0.34] vs [-0.95 0.00 0.30] ( 2.5 )
31 - ( 80.1) [-0.89 -0.00 0.46] vs [-0.89 0.00 0.46] ( 0.5 )
32 - ( 87.2) [-0.71 -0.00 0.70] vs [-0.82 0.00 0.57] ( 9.7 )
Scripting
Generate Matlab script