talairach daemon
Transcription
talairach daemon
LOW RESOLUTION BRAIN ELECTROMAGNETIC TOMOGRAPHY LOW RESOLUTION BRAIN ELECTROMAGNETIC TOMOGRAPHY LORETA Documentation for the LORETA-KEY full software package version 2003 June Roberto Domingo Pascual-Marqui, Ph.D. The KEY Institute for Brain-Mind Research University Hospital of Psychiatry Lenggstr. 31, CH-8029 Zurich, Switzerland Tel.:+41-1-3884934 ; Fax:+41-1-3803043 [email protected] http://www.keyinst.unizh.ch/loreta.htm Index i. ii. iii. iv. v. vi. vii. viii. Legal matters Acknowledgements Data formats Misusing LORETA Installation requirements Montreal Neurological Institute (MNI) Brain to Talairach Appendix on misusing LORETA (technical details and examples) Developers Guide 1. Electrode coordinates maker (in Talairach space) 1.1. Based on extended 10/10 system template 1.2. Based on spherical coordinates in Scherg-Berg convention 1.3. Based on real coordinates 2. Electrodes viewer 2.1. In Talairach slices 2.2. On 3D cortical surface 3. Transformation matrix (LORETA operator) 4. LORETA Explorer for EEG/ERP 5. Talairach Atlas 6. EEG/ERP -> LORETA 7. EEG/ERP -> LORETA-xyz 8. LORETA viewer 9. EEG cross-spectra 10. LORETA Explorer for EEG cross-spectra 11. EEG cross-spectrum -> LORETA 12. Statistical non-Parametric Mapping (SnPM) 12.1. (TANOVA: comparison of ERP maps 12.1.1. Paired samples 12.1.2. Independent samples 12.2. Electrode-wise comparison of ERPs 12.2.1. Paired samples 12.2.2. Independent samples 12.3. Electrode-wise comparison of EEG cross-spectra 12.3.1. Paired samples 12.3.2. Independent samples 12.4. Voxel-wise LORETA (text format) comparisons (functional mapping of the human brain) 12.4.1. Paired samples (LORETA text) 12.4.2. Independent samples (LORETA text) 12.5. Voxel-wise LORETA (binary format) comparisons (functional mapping of the human brain) 12.5.1. Paired samples (LORETA binary) 12.5.2. Independent samples (LORETA binary) 12.6. Voxel/Electrode-wise paired tests (any format) (2-tailes, comm var.) 13. Utilities 13.1. Averager (ERP/LORETA files) 13.2. Baseline removal (ERPs & LORETA) 13.3. Filtering and/or deleting electrodes from EEG/ERP files 13.4. Long EEG recording -> Epochs 13.5. List of "FileNames" Maker (helper for statistics) 13.6. LORETA format converter (Text <--> Binary) 13.7. Averager (CrossSpectra) 14. Troubleshoot 3D graphics i. Legal matters If you want to use this software, then you must agree to: 1: not redistribute this software; 2: not redistribute the password; 3: not make changes to this software; 4: not erase the "LORETA-KEY" text appearing in the upper right corner of images produced by this software. If you don't agree, then quit now. If you don't agree, but you've decided to still install this software, then you might be accused of performing an unethical act. DISCLAIMER OF WARRANTY: THIS SOFTWARE IS LICENSED ON AN AS-IS BASIS, WITHOUT WARRANTY OR CONDITION OF ANY KIND AND THE KEY INSTITUTE FOR BRAIN-MIND RESEARCH DISCLAIMS ALL WARRANTIES AND CONDITIONS, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. The entire risk as to the quality and performance of the Software is borne by you. Should the Software prove defective, you and not THE KEY INSTITUTE FOR BRAIN-MIND RESEARCH assume the entire responsibility. This Disclaimer of Warranty constitutes an essential part of the License Agreement. LIMITATION OF LIABILITY: UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT, CONTRACT, OR OTHERWISE, SHALL THE KEY INSTITUTE FOR BRAIN-MIND RESEARCH BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY TYPE INCLUDING, WITHOUT LIMITATION, DAMAGES FOR COMPUTER FAILURE OR MALFUNCTION, OR LOSS OF DATA. ii. Acknowledgements This software package has made extensive use of the work of others: 1. Cross-registration from spherical head to Talairach head was achieved with published data from: Towle VL, Bolanos J, Suarez D, Tan K, Grzeszczuk R, Levin DN, Cakmur R, Frank SA, Spire J-P: The spatial location of EEG electrodes: locating the best-fitting sphere relative to cortical anatomy. Electroencephalogr Clin Neurophysiol 1993; 86:1–6. 2. The digitized Talairach and probability atlases, and the “Colin head”, provided by the Brain Imaging Centre, Montreal Neurologic Institute. (http://www.bic.mni.mcgill.ca/). 3. Talairach labels provided by: Lancaster JL, Woldorff MG, Parsons LM, Liotti M, Freitas CS, Rainey L, Kochunov PV, Nickerson D, Mikiten SA, Fox PT, "Automated Talairach Atlas labels for functional brain mapping". Human Brain Mapping 10:120-131, 2000. (http://biad73.uthscsa.edu/resources/talairachdaemon/talairachdaemon.html). 4. Triangulated cortical surface of the “Colin head”, provided by the Van Essen Lab [see e.g.:Dickson, J., Drury, H., and Van Essen, D.C. (2001) Surface management system (SuMS): A surface-based database to aid cortical surface reconstruction, visualization and analysis. Phil. Trans. Royal Soc, Ser B 356:1277-1292] at: http://stp.wustl.edu/ 5. Information on spherical coordinates for some electrodes from: [Michael Scherg, University of Heidelberg, and Patrick Berg, University of Konstanz. Copyright © 2000 by MEGIS Software GmbH. MEGIS Software GmbH, Munich / Germany.] http://www.besa.de/demos.htm [dipole simulator] 6. The Talairach atlas: Talairach J, Tournoux P: Co-Planar Stereotaxic Atlas of the Human Brain: Three-Dimensional Proportional System. Stuttgart, Germany, Georg Thieme, 1988. 7. MNI (Montreal Neurological Institute) coordinates to Talairach coordinates correction based on: Brett M. Johnsrude IS. Owen AM. The problem of functional localization in the human brain. Nature Reviews Neuroscience. 3(3):243-249, 2002 Mar. (http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html). iii. Some notes on data formats 1. EEG/ERP data: These are text files containing numbers, usually in microvolt units. An example EEG/ERP corresponding to 4 electrodes, 3 time frames (3 time samples) is: 0.8 -1.4 5.5 -10.0 -8.88 5.4 -6.5 -10.10101 5.8 6.4 -5.5 20.0 Note that the rows correspond to time, the columns to electrodes. Another example EEG/ERP corresponding to 3 electrodes, 4 time frames is: 0.8 -1.4 5.5 -8.88 5.4 -6.5 5.8 6.4 -5.5 20.0 0.8 -1.4 5.5 Note that the rows correspond to time, the columns to electrodes. The separator between numbers in an EEG/ERP file can be a space, tab, or CR character. Typically, EEG/ERP files contain 21 to 256 electrodes, and up to 1024 time frames. This software package does not handle long EEG recordings. 2. Electrode coordinates in Talairach space: These are text files, and an example, for 7 electrodes, is: 7 -3.281065E+0001 8.100142E+0001 -3.699663E+0000 Fp1 1.490116E-0009 9.016444E+0001 -4.630887E+0000 Fpz 3.281065E+0001 8.100142E+0001 -3.699663E+0000 Fp2 -5.914433E+0001 3.991571E+0001 -3.652514E+0001 AF9 -5.863954E+0001 5.520868E+0001 -1.078385E+0000 AF7 -5.180929E+0001 6.230663E+0001 2.203998E+0001 AF5 -2.961122E+0001 7.511947E+0001 3.581290E+0001 AF3 The first number indicates the number of cephalic electrodes, and the remaining rows contain the Talairach (X,Y,Z) coordinates, followed by an electrode name. Note the use of exponential notation for real numbers (e.g. “3.581290E+0001”, which means that you should multiply “3.581290” by 10 to the power “+0001”). 3. LORETA files: This new software uses 4-byte reals for LORETA values. The previous versions used simple text files. A LORETA file consists of an integer multiple of 2394 numbers. 2394 is the number of LORETA voxels in the brain, in this implementation. Voxels lie in grey matter volume, including some hippocampus and amygdala, and correspond to a 7mm grid resolution. A LORETA file computed from time domain EEG/ERP corresponds to current density vector field magnitude. A LORETAxyz file computed from time domain EEG/ERP corresponds to all components of the current density vector field. The first 2394 numbers correspond to the X-moment, the following 2394 numbers correspond to the Y-moment, and the following 2394 numbers correspond to the Z-moment, and so on, for each time frame. A LORETA file computed from frequency domain EEG cross-spectra corresponds to current density vector field power. 4. Cross-Spectral files (very technical): These files correspond to a structured binary format. The header is (using PASCAL language): Type THeader01=packed record NumFiles,Ne,Nt,iFrq1,iFrq2,NumMat:integer; SampRateHz,frq1,frq2,FreqResHz:double; ClassicalBands:boolean; end; where: NumFiles:number of EEG epochs Ne: number of electrodes Nt: number of time frames iFrq1: integer index for lower end frequency (starts at 1 for DC) iFrq2: integer index for upper end frequency NumMat: number of cross-spectral matrices SampRateHz: sampling rate in Hz frq1: Lower end frequency in Hz frq2: Upper end frequency in Hz FreqResHz: Frequency resolution in Hz ClassicalBands: if true, then there are 7 or 8 cross-spectral matrices only, corresponding to the classical EEG bands; if false, then the number of matrices are user-specified discrete frequencies. After the header follow “NumMat” cross-spectral matrices. If the number of electrodes is “Ne”, then a cross-spectral matrix is defined as: Type vector=array[1..Ne] of double; Matrix= array[1..Ne] of vector; Let C:matrix denote a cross-spectral matrix variable. Then C[i,i], for i=1..Ne, contains the spectral density at electrode “i”. C[i,j], for i=1..Ne, and for j=(i+1)…Ne, contains the real part of the hermitian covariance between electrode “i” and electrode “j”. C[j,i], for i=1..Ne, and for j=(i+1)…Ne, contains the imaginary part of the hermitian covariance between electrode “i” and electrode “j”. 1.1. Make electrode Talairach coordinates file from extended 10/10 system template, selecting manually, or from name list. The panel (1) shows the 10/10 system template, as viewed from the top of the head. If you click on any electrode, its color will toggle. A blue-font electrode signifies that it has not been selected. A red-font electrode signifies that it has been selected. Note that the respective electrode lists (1a:NotSelected and 2a:Selected) are updated each time you click an electrode. You can also add (3) or delete (4) electrodes by using the electrode lists (1a and 2a), and clicking the proper buttons (3 and 4). The “Reset all” button (5) clears the new montage. You can re-order your list by selecting an electrode (2a), and moving it up (6) or down (7). Your electrode list MUST match the exact NUMBER and the exact ORDER of your EEG/ERP recordings. This is your responsibility. Alternatively, suppose you created a text file containing the electrode names of your montage, one electrode name on each line, no blank lines. For example, a list of 4 electrodes can look like this: Fp1 Fp2 F3 F4 Then you can open this file (8), and your electrode coordinates will be created automatically. Be sure to SAVE your montage! (9) Finally, you can view your electrodes in Talairach space: by slices (10), or in 3D (11). 2.1. View electrodes in slicer mode. You can open an electrode coordinates file (1). The list of electrode names is shown in the right panel (2). The highlighted electrode (3) is displayed as a violet dot in the image. Note the total number of electrodes in your file (4). Note the electrode number (5) of the highlighted electrode (3). You can scroll through the list (2), and the image will be updated. The image shows the electrode position: in an axial slice seen from above (6) in a saggital slice seen from the left (7) in a coronal slice seen from the front (8). You can save all images (11) by specifying an output folder (9). Each image corresponds to an electrode, with file name containing the electrode name. Images are saved in JPEG format, and you can specify the quality of the image (10). NOTE: you are expected to inspect each image very closely, to check if the electrodes actually lie on the scalp surface, and outside, or inside the brain. NOTE: you can drop an electrode coordinates file on this program. 2.2. View electrodes in 3D. You can open an electrode coordinates file (1). Click the “Redraw” menu item (2) if you can’t see the brain. You may use to mouse to rotate, translate, zoom, etc. This is indicated in the “HINTS” when the mouse is over the image (3). If you maximize (or resize) the program, then the “ResetSize” menu item (4) restores the initial size. You can change the background color with the “BckGrndCol” menu item (5). You can change the cortex color with the “CrtxCol” menu item (6). You can change the electrode color with the “ElectrdCol” menu item (7). You can change the scalp color with the “SclpCol” menu item (8). If you rotated or manipulated the cortex, then the “ResetView” menu item (9) restores the original-initial view. You can create the 6 orthogonal views with the “OrthoView” menu item (10). The image resizes if the “AllowResize” option is checked (11). The image resizes with fixed aspect ratio if the “FixAspRat” option is checked (12). You can save the image by clicking the WYSIWYG (what you see is what you get) button (13). You can manipulate electrode transparency (14). You can manipulate scalp transparency (15). You can manipulate the 3D perception of the cortex (16). You can change the cortex representation (17-20). NOTE: you can drop an electrode coordinates file on this program. 1.2 Make electrode Talairach coordinates file from a "Patrick Berg" spherical coordinates file (http://www.besa.de; see the dipole-simulator therein). [Michael Scherg, University of Heidelberg, and Patrick Berg, University of Konstanz. Copyright © 2000 by MEGIS Software GmbH. MEGIS Software GmbH, Munich / Germany.] The tool assumes you have a text file with electrode positions indicated in spherical coordinates, according to the Berg-Scherg convention. An example text file looks like this: F3 F1 Fz F2 F4 F6 F8 F10 -60 -51 -50 -68 46 90 50 68 60 51 75 41 92 36 115 35 You must first open the file (1). And you must specify a file name for saving the electrode coordinates in Talairach space (2). Then hit the “Go” button (3). Spherical electrodes are cross-registered to the Talairach scalp. Finally, you can view your electrodes in Talairach space by clicking the “View in Talairach slices” button (4), or the “View in 3D Talairach” button (5). Beware of non-cephalic electrodes, such as chin, sphenoidal, etc. No checking is made, and their Talairach coordinates are meaningless! 1.3. Make electrode Talairach coordinates file from a set of real coordinates, by crossregistration. This tool assumes you have a text file with real electrode Euclidean (X,Y,Z) positions referred to any origin, orientation, etc. An example file looks like this: 29 Nasion -9.33 13.70 1.26 Inion -12.92 30.80 2.20 L-Ear -11.36 22.08 -4.98 R-Ear -10.15 22.44 8.53 Fp1 -13.49 13.07 -0.93 Fp2 -13.07 13.09 4.50 F3 -18.29 15.53 -1.65 F4 -17.61 15.72 6.18 C3 -20.77 21.03 -2.64 C4 -19.68 21.08 7.82 P3 -20.48 26.56 -1.67 P4 -19.14 26.99 6.97 O1 -15.99 29.61 -1.33 O2 -14.59 30.20 5.16 F7 -14.42 16.57 -3.97 F8 -13.20 16.36 7.58 T3 -15.28 21.56 -4.94 T4 -13.54 21.49 9.12 T5 -15.98 26.83 -3.73 T6 -14.16 27.06 8.08 Fz -19.23 14.99 2.38 Pz -21.27 26.92 2.91 Cz -22.51 20.61 2.88 Oz -15.45 30.75 2.36 Fpz -13.67 12.52 1.75 Nasion -9.61 13.89 1.08 Inion -12.69 30.80 2.16 L-Ear -11.49 22.29 -4.96 R-Ear -10.09 22.63 8.45 Note that the first line indicates the number of lines that follow. In the example, the following 29 lines contain an electrode name, and the (X,Y,Z) coordinates. Of these 29 lines, the first 4 and the last 4 must correspond to the landmarks “Nasion, Inion, Left pre-auricular, Right pre-auricular”. You must open the file (1). And you must specify a file name for saving the electrode coordinates in Talairach space (2). Then hit the “Go” button (3). The real scalp is cross-registered to the Talairach scalp. Finally, you can view your electrodes in Talairach space by clicking the “View in Talairach slices” button (4), or the “View in 3D Talairach” button (5). NOTE: the Talairach coordinates file thus created will contain 29-8=21 electrodes only, because the landmarks are not included. 3. Make the LORETA transformation matrix, or LORETA operator Once you have created your electrode coordinates file in Talairach space, you must create the corresponding LORETA transformation matrix. This will later allow you to convert your EEG/ERP to LORETA images. Manual Mode Specify your electrodes (1). Specify a file name for saving the LORETA transformation matrix (2). You can now Click “Go” (3). After some lengthy computations, the program will create the Transformation Matrix. This corresponds to the smoothest possible inverse solution, without “over-smoothing”, where the regularization parameter (over-smoothness) is 0 (zero). You can manually type in a value for over-smoothness (4) and click “Go” (3). An objective calculation of the amount of over-smoothness can be performed. It is based on the cross-validation criteria. Technical details can be found at: http://www.ee.tut.fi/rgi/ijbem/volume1/number1/html/ar10.htm and: http://www.ee.tut.fi/rgi/ijbem/volume1/number2/html/pas-app2.htm#P154_16013 If you select the EEG/ERP data you want to analyze (6), and you specify correctly the number of time frames in each file (7), and the analysis time window of interest (8 and 9), then by clicking the “Go” (3) button, the “best” value for over-smoothness will be computed, based on cross-validation. HOWEVER, this method tends to exaggerate the amount of smoothing! Automatic part Specify your electrodes (1). Specify a file name for saving the LORETA transformation matrix (2). If you click “Run in automatic mode” (5), then the program will create several matrices, with different pre-defined amounts of over-smoothness. If your output file name is xx.tm, then the following matrices are created: xx-s0.tm, xx-s5.tm, xx-s4.tm, xx-s3.tm with increasing over-smoothness (0, 10-5, 10-4, 10-3). Over-smoothness is useful when dealing with noisy data (which has great influence with more than 35 electrodes). Technical details of smoothing can be found at: http://www.ee.tut.fi/rgi/ijbem/volume1/number1/html/ar10.htm and: http://www.ee.tut.fi/rgi/ijbem/volume1/number2/html/pas-app2.htm#P154_16013 You can “Run in pseudo-batch mode” (10), if you prepare a text file with the following structure and information. The number of lines in the file must be a multiple of 4. There should be no blank lines, neither at the beginning, nor at the end, nor in between. Each 4 lines are: - The file name of the electrode coordinates in Talairach space. - A file name for saving the computed transformation matrix. -1 - Regularization parameter. An example is: tcoord21.xyz ttm00.21 1 0 tcoord21.xyz ttm05.21 1 1.0e-5 tcoord21a.xyz ttm04.21a 1 1.0e-4 NOTE: Each time a transformation matrix is created, an associated file with extension “-info.txt” is also created. This is a text file with information about the transformation matrix. 4. LORETA explorer Please first see the note on misuse of LORETA! You are requested to not misuse LORETA. Once you have created your electrode coordinates file in Talairach space, and the corresponding LORETA transformation matrix, you can explore your data. First specify the number of electrodes (1). Then specify the sampling rate (2). Check the reference electrode to be used (none, or average reference) (3). Check the filter settings (on/off, and the band-pass) (4). Under the “File” menu item (5), open an EEG/ERP file. An additional waveshape appears, corresponding to the global field power (GFP) curve (as the last electrode displayed). Also note that the number of time frames in the EEG/ERP file is displayed (19). Under the “File” menu item (5), open a Talairach electrode coordinates file. The electrode names will be written next to the waveshapes. Under the “File” menu item (5), open a LORETA transformation matrix file. The program may delay while computing the LORETAs. When finished, an additional waveshape appears, corresponding to the LORETA global field power (LGFP) curve (as the last electrode displayed). Note the light green panel under the waveshapes (6). Here are “HINTS” about several options related to the effects of mouse clicks: Left mouse click places the main cursor. Right mouse click places the secondary cursor (must be at higher latency than main cursor). Ctrl+Left mouse click erases the cursors. Ctrl+Right mouse click erases the secondary cursor Note the light yellow panel under the waveshapes (7). This panel will display information about the mouse and cursor positions (in time frame units, and in milliseconds), and the GFP. You can change the: background color (8) EEG color (9) GFP color (10) Font for electrode names (11) Increase waveshape thickness (12) Decrease waveshape thickness (13) You can change the number of displayed signals (14). You can scroll the displayed signals (15). You may view the scalp map (16) at the main cursor. You may view all the information about files, etc (17). You may clear all the data (18). You may change the scale for the waveshapes (20). You may change the transparency of the “EEG/ERP Viewer” window (21). You may change the main cursor position (22). You may change the secondary cursor position (23). You may view the neuronal generator distribution (LORETA) (24) at the main cursor. You may view the average neuronal generator distribution (LORETA) (25) between the cursors. You may view an animation of scalp maps and LORETA, for the time interval between the cursors (26). The red bar (27) has a height corresponding to the scale for the electric potential indicated in (28). Under the “File” menu item (5), you can save the waveshape image. Under the “File” menu item (5), you can save the LORETA values at the main cursor. Under the “File” menu item (5), you can save the LORETA values between cursors. Under the “File” menu item (5), you can save all LORETA values. NOTE: you can drop an EEG/ERP file on this window. The “Scalp Map” window file:///E|/LORETA-30/010-Help/2003-06-10/05/LorHlp3.htm (1 of 4) [2003-06-10 12:27:45] LOW RESOLUTION BRAIN ELECTROMAGNETIC TOMOGRAPHY This displays a spherical scalp map viewed from the top. A=anterior, P=posterior, L=left, R=right, TF=time frame. Under the “File” menu item (1), you can save the scalp map and the color scale. You can change the color for positive values (2), for negative values (3), for value zero (4), for the background (5), and for the pen (6). You can display the electrode positions (7), and change their Font (8). You can change the scale, in linearity (9) and in value (10). You can change the smoothness of the interpolated map (11). You can change the transparency of the “Scalp Map” window (12). By default, each map is displayed relative to its own maximum. You can force the use of the global maximum (13). This is toggle switch, and can be set back to each map’s maximum. The “LORETA Explorer 02” window If you make an “Alt+Left” mouse click in a grey matter area of the LORETA image, an additional waveshape appears in the “EEG/ERP Viewer” window, corresponding to the LORETA signal there. This is displayed as the last electrode. Note that this is equivalent to a “virtual depth electrode”! You can erase all virtual electrodes by “Ctrl+LeftClick” on the LORETA image. The image shows 3 orthogonal slices through the brain. Typically, anatomy is represented in greys. Positive LORETA values in red, zero in white, negative values in blue. In the image, the left slice is axial (horizontal) (1), viewing the head from the top. L=left, R=right. The center slice is saggital (2), viewed from the left. A=anterior, P=posterior. The right slice is coronal (3), viewed from the back. All axes and specified coordinates are in Talairach space. Black triangles (4) along the axes indicate the point through which all three orthogonal slices are made. Its coordinates are indicated in the image as (X,Y,Z) (5). The number in parenthesis, next to the coordinates, indicates the LORETA value of the selected point (6). Note that the time frame for this image is indicated (7). The bottom panel (8) displays the LORETA value and the Talairach coordinates for the mouse position (when the mouse is over the image). The “+Col” button on the right panel (9) lets you re-define a color for positive LORETA values. The “-Col” button on the right panel (10) lets you re-define a color for negative LORETA values. The “Grey” button on the right panel (11) lets you re-define a color for anatomy. The “Default” button on the right panel (12) sets the LORETA and anatomy colors to the default colors (anatomy in greys, positive LORETA values in red, zero in white, negative values in blue). The “Negat.” button on the right panel (13) makes a negative of the anatomy colors. The “Jmax” button on the right panel (14) displays the LORETA image at the coordinates of the maximum value. The “Jmin” button on the right panel (15) displays the LORETA image at the coordinates of the minimum value. The “ï” button on the right panel (16) displays a dialog box for changing contrast and brightness of anatomy. The “Up/Down” arrow buttons and “Left/Right” arrow buttons (17) in the top panel allow you to scroll through horizontal, saggital, and coronal slices. If you left-click on the image, a jump occurs to the corresponding voxel position. If you right-click on the image, a pop-up window shows anatomical information of the corresponding voxel. The “File” menu item (18) at the top allows you to save the current image (with user defined name, or with XYZ-generated name) as a JPEG image. It also allows you to save the full 3D image (as a “raw” file). You can also change the anatomy file. The anatomy files are: AnatGrey305.dat AnatGreyPD.dat AnatGreyT1.dat AnatGreyT2.dat Do not select any other file for this purpose, since the system might crash. The “ScaleWin” menu item (19) at the top opens the scale window. There you are allowed to change the scale in linearity and in value (note: you may type in a value, but must hit the [enter] for the value to take effect). By default, each LORETA image is displayed relative to its own maximum. You can force the use of the global maximum (20). This is toggle switch, and can be set back to each LORETA’s maximum. The “TalLabWin” menu item (21) at the top opens the “Talairach Labels” window. Within, by clicking “Find”, anatomical information is displayed. Within, the “Levels” option allows you to find more than one best match in anatomical information. The “FindTalLab(Off/On)” menu item (22) is a toggle switch. When “On”, anatomical information will be written to the “Talairach Labels” window each and every time you change the voxel position in the image. The “AllSlicesWin” menu item (23) at the top displays all horizontal slices. The “FindMaxMinWin” menu item (24) at the top opens a window that allows you to search for all local maxima and minima. The “3Dsurf” menu item (25) has the same functionality as explained in the 3D viewer for electrodes. However, there are three additional features: A. The cortical surface is color coded for LORETA values. B. The electrodes are color coded for electric potential values. C. The scalp is color coded for electric potential values. Two examples follow: 5. Talairach atlas This program initializes by displaying the lowest horizontal Talairach slice at Z=-40mm. You can select a horizontal slice by clicking on "Down", "Up", or "SelectSlice", in the menu of the main window "Talairach Atlas". The "Z" coordinate of the slice is displayed in the menu of "Talairach Atlas". If your screen displays at least 1024x768 pixels, you can view the full slice by clicking on "HalfSize" in the menu of "Talairach Atlas". The only option you have under this mode is to click "OK" to "Return to normal view". If you move the cursor over the image in "Talairach Atlas", the exact Talairach coordinates are displayed under the menu of "Talairach Labels", in the area with yellow background. If you make a normal mouse click (left button), Talairach label information is written to the notepad of "Talairach Labels". If you go on clicking, all the information is written there, with a blank line separating each click, until you "Clear" it. If you make a rightmouse-button-click, you will additionally view the same information in a pop-up-menu. The information in the notepad of "Talairach Labels" is, for example: (X= -4 , Y= 31 , Z= -8) 1st Best Match (d= 1 mm) Brodmann area 32 Anterior Cingulate Limbic Lobe Where "Best Match (d= XXX mm)" means that the closest grey matter region to your click lies at approximately d= XXX mm. You can write your own notes into the notepad of "Talairach Labels", and you can copy/paste. You can save the text to a standard text file (‘.txt’ will be appended). 6. From time domain scalp electric potential differences (scalp maps) to LORETA. EEG/ERP files can be converted to files containing LORETA values. Please first see the note on misuse of LORETA! You are requested to not misuse LORETA. In manual mode: you must specify: an EEG/ERP file (1) the LORETA transformation matrix file (2) a file name for saving the LORETAs (3) the time window of interest (4) (e.g., 20…30 creates a file with 11 LORETAs!). Finally, click “Go” (5). In semiautomatic mode: Select any number of EEG/ERP files (1) Specify the LORETA transformation matrix file (2) Specify the time window of interest (3) When you click “Go” (4), for each EEG/ERP file, a LORETA file will be created, with the same file name, but with extension “lorb”. Each LORETA file contains several LORETAs, according to the specified time window. In pseudo-batch mode: you must create (and read in (1)) an ASCII file with the following structure and information. The number of lines in the file must be a multiple of 4. There should be no blank lines, neither at the beginning, nor at the end, nor in between. Each 4 lines are: - The EEG/EP file name. - The LORETA transformation matrix in Talairach space. - The file name for saving the results (the LORETA file). - TF1 TF2 (first and last time frames). An example is: VEP01.asc ttm00.21 VEP01a.LORB 50 50 VEP02.asc ttm00.21 VEP02a.LORB 1 256 Note: In all cases, it is your problem to keep track of the meaning of “time frames” in the LORETA files. For example, if your ERP file was a visual ERP, and the P100 to N150 peak occurred from time frame 26 to time frame 40 in the ERP file, and you made a LORETA for this time window, then in the LORETA file TF=1 corresponds to TF=26 of the ERP file; TF=2 for LORETA corresponds to TF=27 for the ERP, and so on. This information is not stored in the LORETA file. It is your problem to keep track of this information! 7. From time domain scalp electric potential differences (scalp maps) to LORETA-xyz. Please first see the note on misuse of LORETA! You are requested to not misuse LORETA. This program is essentially identical to the “Voltage -> LORETA” program previously described. Please first familiarize yourself fully with that program. This program creates LORETA files that contain the full current density vector field, whose format is explained elsewhere. 8. The LORETA viewer This program allows you to read in and display LORETA files. Under the “File” menu item, you can read in diverse LORETA formats. You can Drag&Drop LORETA files onto this program. When you open a LORETA file, with name (e.g.) “c:\hello\abc.lorb”, the program will automatically search for a text-ascii file with name “c:\hello\abc.lorb.TFlabels”. Note that the second file has identical name (and path) to the first file, but with an appended extension “.TFlabels”. If this second file exists, then it will be read in by the program. The program expects this text file to contain, on separate lines, the names of the time frames or frequencies, which will then be displayed by the program. This second file must have as many lines as there are LORETAs in the LORETA file! If these conditions are not met, the program may crash. The maximum number of characters for each TimeFrame or Frequency name is 20. Almost all the features of this program are explained under the “LORETA explorer” section above. Please first familiarize yourself fully with that program. Note the text (above and outside the image), indicating the file name and the time frame information (1). The light-yellow panel will show “HINTS” (2). The light-green panel displays the LORETA value and the Talairach coordinates for the mouse position (when the mouse is over the image) (3). The “Time Frame [1…]” panel (4) directly under the image displays the number of LORETAs contained in your file. You can scroll through the images with the arrow buttons. The “Copy à Clipboard” button (7) will copy the LORETA image to the clipboard. The “Play sequence” panel (5) allows you to play the sequence of images specified by the time window (TF1…TF2), which you are allowed to change. The “Play” button will play the sequence. The “Save” button will play and save all the images. The “Initial voxel” panel (6) determines which voxel is selected and displayed each time a new image is displayed: Jump to max: jumps to voxel with largest value. Jump to min: jumps to voxel with smallest value. Jump to abs extreme: jumps to voxel with largest absolute value. Fixed point: stays at the voxel position displayed in the image. Bottom/left/back: jumps to voxel at coordinates (-66,-102,-41). The menu item “File” at the top allows you to save the current image (with user defined name, or with XYZ-generated name) as a JPEG image. It also allows you to change the anatomy file. The anatomy files are: AnatGrey305.dat AnatGreyPD.dat AnatGreyT1.dat AnatGreyT2.dat Do not select any other file for this purpose, since the system might crash. The menu item “AllSlicesWin” at the top displays all horizontal slices. If this window is open while PLAYING-SAVING, then these images are also saved. 9. Computing EEG cross-spectra (frequency domain). Although EEG can be analyzed in the time-domain, typical analyses are carried out in the frequency-domain. This program computes EEG cross-spectra. In general, you must always specify the following items: The number of electrodes (1). The number of time frames in each EEG file (2). The sampling rate (3). Specify the frequency settings: d[1.5…6], q[6.5…8], a1[8.5…10], a2[10.5…12], b1[12.5…18], b2[18.5…21], b3[21.5…30], W[1.5…30] (4) d[1…3], q[4…7], a[8…12], b1[13…18], b2[19…21], b3[22…30], W[1…30] (5) Discrete frequencies in the user-specified band (6). Check or uncheck the “Normalize each EEG file” box (7). Note that EEG normalization implies that each EEG file is normalized to unit total global field power before computing the spectra. Total global field power is the sum of squared electric potentials over all electrodes and time frames, for average reference transformed data. Several modes are available. All EEGs -> 1 Spectra (manual mode): In this mode, 1 single cross-spectral file is computed from a group of EEG files. Select the EEG files (9). Specify the file name for saving the cross-spectral file (10). Click “Go” (8). Each EEG -> 1 Spectra (manual mode): In this mode, 1 single cross-spectral file is computed separately for each and every EEG file selected. Select the EEG files (11). Click “Go” (8). NOTE: the cross-spectral files have same file name as the EEG file name, except that the extension changes to “crs”. All EEGs -> 1 Spectra (automatic mode): In this mode, 1 single cross-spectral file is computed separately for each and every folder containing any number of EEG files. Therefore, your EEG files must be grouped in separate folders (subdirectories). Select the folders containing EEG files, using the folder view of your computer (12), and the “add” buttons (13) or (14). The selected folders are shown in the destination window (15). You can deselect folders with buttons (16) and (17). Click “Go” (8). NOTES: 1. Selected folders must contain exclusively EEG files. No other files can be present. 2. For each folder, a single cross-spectral file will be computed, corresponding to all EEG files within the folder. 3. The cross-spectral file will be located outside the folder (not within the folder). The cross-spectral file name will be exactly the same as the folder name, but with extension "crs". 10. Viewing cross-spectra and the generators of the EEG frequency components. This program is very similar to the LORETA explorer explained above. The difference is that you explore cross-spectral files, instead of time-domain EEG/ERP files. For this purpose, you can directly open a cross-spectral file. There’s no need to specify number of electrodes, nor sampling rate, since all this information is contained within the cross-spectral file. The program displays the square root of the spectra, and LORETA for the generators of the frequencies components. 3D cortical surfaces are shown in high anatomical resolution. 11. From EEG cross-spectra to the generators of the EEG frequency components Please first see the note on misuse of LORETA! You are requested to not misuse LORETA. This program is similar to the program for computing LORETA files from time-domain EEG/ERP files. In this case, LORETAs are computed from cross-spectral files. This is the main difference. It is worth noting that when this program runs under “Pseudo-Batch mode”, in this case you must create an ASCII file with the following structure and information. The number of lines in the file must be a multiple of 4. There should be no blank lines, neither at the beginning, nor at the end, nor in between. Each 4 lines are: - The cross-spectral file name. - The LORETA transformation matrix in Talairach space. - The file name for saving the results (the LORETA file). - Frq1 Frq2 (lower and upper frequency limits; 0 0 for all). An example is: Subj01.crs ttm00.21 Subj01.lorb 00 Subj02.crs ttm00.21 Subj02.lorb 6.5 15 12.1.1. ERPs: time windows of significant difference between two conditions. Paired design. Randomization tests. This program contains its own help window, which you must open there, when running the program. 12.1.2. ERPs: time windows of significant difference between two conditions. Non-paired design. Randomization tests. This program contains its own help window, which you must open there, when running the program. 12.2.1., 12.3.1., 12.4.1. Statistical non-parametric maps: comparing LORETAs. Paired design. Randomization tests. This program contains its own help window, which you must open there, when running the program. 12.2.2., 12.3.2., 12.4.2. Statistical non-parametric maps: comparing LORETAs. Non-paired design. Randomization tests. This program contains its own help window, which you must open there, when running the program. file:///E|/LORETA-30/010-Help/2003-06-10/05/LorHlp3.htm (2 of 4) [2003-06-10 12:27:45] LOW RESOLUTION BRAIN ELECTROMAGNETIC TOMOGRAPHY 12.5.1. Statistical non-parametric maps: comparing LORETAs in binary format. Paired design. Randomization tests. This program contains its own help window, which you must open there, when running the program. 12.5.2. Statistical non-parametric maps: comparing LORETAs in binary format. Nonpaired design. Randomization tests. This program contains its own help window, which you must open there, when running the program. 12.6. Statistical non-parametric maps: comparing ERPs/Cross-Spectra/LORETAs , any format, using 2-tailed tests with common variance. Paired design. Randomization tests. This program contains its own help window, which you must open there, when running the program. 13.1. ERP/LORETA averager This program contains its own help window, which you must open there, when running the program. 13.2. Baseline removal (for ERP/LORETA files). Relative power transformation. This program contains its own help window, which you must open there, when running the program. 13.3. Filter and Electrode deleter for EEG/ERP files. This program contains its own help window, which you must open there, when running the program. 13.4. Break long EEG files into pieces. This program contains its own help window, which you must open there, when running the program. 13.5. StatisticsInfoFileMaker This program helps you create the “info” file for running statistical tests. You can select the files you want to compare: 1. Specify (optional) a filter for the file names of interest (1). 2. Search for the folders containing your files (2). 3. Files contained in the selected folder, with names corresponding to the filter, appear in the green box (3). 4. Select desired files from green box (3) and drag/drop to the appropriate yellow list (4A or 4B). Note that file names will always be sorted alphabetically in (4A or 4B), so you should name your files taking this into account. Also note that you can “clear” a list (4A or 4B), but you cannot deselect single files. 5. Define the statistical design (5), the number of time frames (or of discrete frequencies) (6), the number of electrodes (or of voxels) (7), the time interval of interest in condition “A” (8), the time interval of interest in condition “B” (9), and the file name of the file which will contain the statistical analysis results (10). 6. Finally, save the “info” file (11). This file can be given to the statistical analysis modules previously described. NOTE: It is your responsibility to check and validate that the info file created with this program contains correct information, especially the list of file names for analysis! 13.6. Converting LORETA files (text ßàbinary) This program contains its own help window that can be viewed when running the program. 13.7. Cross-spectrum averager This program contains its own help window that can be viewed when running the program. iv. Misusing LORETA There are infinite ways to make an incorrect use of this software. This software computes LORETA from scalp electric potential differences (time domain EEG/ERP) or from EEG crossspectra (frequency domain). One particular very incorrect usage is to cheat LORETA with the input. You are not allowed to compute LORETA neither from power maps, nor from square-root-power-maps, nor from z-transformed maps of any kind. This is rigorously incorrect: 1. Inputting scalp electric potential spectral powers will not output LORETA (current density) spectral powers. 2. Inputting scalp electric potential square roots of spectral powers will not output LORETA (current density) square roots of spectral powers. 3. Inputting scalp z-maps will not output LORETA (current density) z’s. The three previous invalid inputs to LORETA violate the mathematics and the physics underlying all computations. Furthermore, they violate any correct usage of statistical analysis. The technical details can be found in: 1. For time domain computations: Pascual-Marqui RD: Review of methods for solving the EEG inverse problem. International Journal of Bioelectromagnetism 1: 75-86, 1999. 2. For frequency domain computations: Frei E, Gamma A, Pascual-Marqui R, Lehmann D, Hell D, Vollenweider FX: Localization of MDMA-induced brain activity in healthy volunteers using low resolution brain electromagnetic tomography (LORETA). Human Brain Mapping 14: 152-165, 2001. See text and equations on pages 154-155 therein. 3. See all the technical details here (Appendix). v. Installation requirements This has been tested with WinXP professional. Earlier versions, from Win98 upwards, also seem to work. You’ll need OPENGL for the 3D displays to run properly. This can be found either at Microsoft’s download homepages, or at your graphic-card’s homepage. Hardware requirements: 1GB free hard disk space, 256 MB RAM, 1024x768 graphics with 32768 colors, or better. For the software to display properly, you will need to use “Large size” (120 dpi, 125% normal size) in your “Display properties / Advanced”. This is usually accessible from the control panel à display properties à settings à advanced. vi.Montreal Neurological Institute (MNI) Brain to Talairach MNI coordinates are not exactly the same as Talairach coordinates. There is a slight mismatch in some brain regions. A correction should be used, as described in: 1. Brett M. Johnsrude IS. Owen AM. The problem of functional localization in the human brain. Nature Reviews Neuroscience. 3(3):243-249, 2002 Mar. 2. http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html Data from the Talairach Daemon is being used in LORETA to find quantitative neuroanatomical information. The Talairach Daemon is described in: 1. Lancaster JL, Woldorff MG, Parsons LM, Liotti M, Freitas CS, Rainey L, Kochunov PV, Nickerson D, Mikiten SA, Fox PT, "Automated Talairach Atlas labels for functional brain mapping". Human Brain Mapping 10:120-131, 2000. 2. http://biad73.uthscsa.edu/resources/talairachdaemon/talairachdaemon.html However, the Talairach Daemon needs as input Talairach coordinates. Up to now, the LORETA software has been using MNI coordinates. This may be imprecise. Let denote MNI coordinates, and denote Talairach coordinates. Then the following equations (Brett) convert: From MNI to Talairach: If then begin end If then begin end In the LORETA software, coordinates will always be reported in MNI space. However, from now on (2002-12-04), Talairach labels will correspond to the corrected MNIàTalairach coordinates. vii. Appendix on misusing LORETA (technical details and examples) Introduction The forward problem of EEG is formulated as: Eq. 1 In Eq. 1, is a vector containing scalp electric potentials measured at cephalic electrodes, with respect to a common, arbitrary reference electrode located anywhere on the body. Note: The “discrete” formulation in Eq. 1 is derived from the integral equation formulation. For example, the set of measured scalp electrode potential differences are collected into a vector. The primary (impressed) current density is defined as: Eq. 2 . At the lth voxel, for where contains the three unknown dipole moments. The cases considered here correspond to . The superscript “T” denotes transpose. has the following structure: The lead field Eq. 3 , for with , and for . Note that , where the scalp electric potential at the ith electrode, due to a unit strength X-oriented dipole at the lth voxel; electric potential at the ith electrode, due to a unit strength Y- oriented dipole at the lth voxel; and is is the scalp is the scalp electric potential at the ith electrode, due to a unit strength Z- oriented dipole at the lth voxel. In Eq. 1, c is an arbitrary constant which embodies the fact that the electric potential is determined up to an arbitrary is a vector of ones. The parameter c allows the use of any reference for the lead field and the constant; and measurements. The functional of interest here is: Eq. 4 where is a regularization parameter. This functional is to be minimized with respect to J and c, for given K, F, and a. In Eq. 4, the matrix B implements a discrete 3D Laplacian (for smoothness), and W normalizes the columns of the lead field. This is explained in detail in {Pascual-Marqui RD. Review of methods for solving the EEG inverse problem. International Journal of Bioelectromagnetism 1999, 1: 75-86.}. The explicit solution to this minimization problem is: Eq. 5 where: Eq. 6 Eq. 7 with denoting the centering matrix; the identity matrix; and is a vector of ones. For any matrix , denotes its Moore-Penrose pseudoinverse. The centering matrix H in Eq. 7 is the average reference operator. Note: The general form of Eq. 5 is valid for any discrete, distributed, linear inverse. The equation for T (e.g. Eq. 6) will change with the particular pseudo-inverse. The time domain inverse solution (LORETA) This corresponds to Eq. 5, which will now be written explicitly as: Eq. 8 where the subscript t signifies an instantaneous measurement at time instant t. For a time series, with , Eq. 8 is then generalized to: Eq. 9 , and where . and Note that the columns of correspond to all discrete time instants. The frequency domain inverse solution (LORETA) The discrete Fourier transform operator is denoted as the matrix . This holds, regardless of the “fast” algorithms used in practice. Fast algorithms implement multiplication with F in a fast way, nothing more. This operator gives the DFT: Eq. 10 or equivalently: Eq. 11 with: Eq. 12 Eq. 13 and Note that the columns of correspond to all discrete frequencies. For a single discrete frequency w, with , Eq. 11 is: Eq. 14 with , and Note: Although there are . discrete frequencies, there is redundancy in the fact that about half the discrete frequencies are conjugates of the other half. The exact relations can be found in classical FFT books. This is of no interest here. VERY IMPORTANT Note: Up to here, all transforms are linear. However, we are not yet dealing with spectra! The computation of spectral density for electric neuronal activity (LORETA spectral density) Let , for , denote the DFT at frequency w, for the ith EEG epoch. For example, an EEG epoch may contain 256 time frames (discrete time instants), sampled at 128 Hz, corresponding to 2 seconds worth of EEG per epoch. We typically use about N=20 such epochs. From Eq. 14, the cross-spectral matrices are constructed as follows. Eq. 15 Eq. 16 where: Eq. 17 and where the superscript “*” denotes transpose and complex conjugate. This is equivalent to: Eq. 18 where: Eq. 19 Eq. 20 In Eqs. 19 and 20, and denote the cross-spectral matrices for the current density and the scalp electric potential differences, respectively. These are Hermitian matrices. The concept of cross-spectral matrices can be found in {Brillinger DR (1981): Time series: data analysis and theory. New York: McGraw-Hill}. Note: The spectra at each voxel, i.e. the spectra of the “electric neuronal activity” time series estimated via LORETA at each voxel in cortical grey matter, corresponds to the diagonal elements of the matrix , obtained via Eq. 18. This means that at frequency w, we are concerned with: Eq. 21 where the “diag” operator takes a Hermitian matrix and returns a real diagonal matrix with elements corresponding to the diagonal elements of the original Hermitian matrix. VERY IMPORTANT Note: These transforms are not linear. Spectra (and cross-spectra) are second order moment statistics! VERY IMPORTANT Note: There is no way to obtain the LORETA spectra with only the spectra of the electric potentials. The following inequality holds: Eq. 22 This inequality holds in general, since the “diag” operator in Eq. 21 does not commute with matrix multiplication. If you don’t believe me, one example suffices to prove that the “equality” does not hold. This was confirmed empirically with randomly generated matrices. The following inequality holds: Eq. 23 Based on the inequality in Eq. 22, this one is even worse, i.e., it’s much more of an “inequality”. Let: Eq. 24 where “vdiag” is an operator such that, given a square Hermitian matrix M, V is a vector containing the diagonal elements of M. Using the notation in Eq. 24, note that the correct LORETA spectra can be written as: Eq. 25 The following inequality holds: Eq. 26 This inequality holds in general. If you don’t believe me, one example suffices to prove that the “equality” does not hold. This was confirmed empirically with randomly generated matrices. Misusing LORETA: EXAMPLES This software computes LORETA from scalp electric potential differences (time domain EEG/ERP) or from EEG crossspectra (frequency domain). One particular very incorrect usage is to cheat LORETA with the input. You are not allowed to compute LORETA neither from power maps, nor from square-root-power-maps, nor from z-transformed maps of any kind. This is rigorously incorrect: 1. Inputting scalp electric potential spectral powers will not output LORETA (current density) spectral powers. 2. Inputting scalp electric potential square roots of spectral powers will not output LORETA (current density) square roots of spectral powers. 3. Inputting scalp z-maps will not output LORETA (current density) z’s. The three previous invalid inputs to LORETA violate the mathematics and the physics underlying all computations. Furthermore, they violate any correct usage of statistical analysis. The technical details can be found in: 1. For time domain computations: Pascual-Marqui RD: Review of methods for solving the EEG inverse problem. International Journal of Bioelectromagnetism 1: 75-86, 1999. 2. For frequency domain computations: Frei E, Gamma A, Pascual-Marqui R, Lehmann D, Hell D, Vollenweider FX: Localization of MDMA-induced brain activity in healthy volunteers using low resolution brain electromagnetic tomography (LORETA). Human Brain Mapping 14: 152-165, 2001. See text and equations on pages 154-155 therein. 14. Troubleshooting 3D graphics (OpenGL) There are four programs that use OpenGL: 1. Electrodes viewer on 3D cortical surface ('3D Talairach electrode viewer'). 2. LORETA explorer for EEG/ERP ('LORETA Explorer 02'). 3. LORETA viewer ('LORETA-KEY Viewer 03'). 4. LORETA explorer for EEG cross-spectra ('Crs-LORETA Explorer 02'). OpenGL is a special graphics library provided by the operating system or by your graphics card producer. This library is used for displaying the cortical surface as a 3D object. If you run the first program above, you'll see immediately what this means. Some graphics cards or OpenGL implementations may have limited capabilities. If you click on the button 'Use low level OpenGL (safe)', then a version of these programs will be installed that use a safer (slower) version of OpenGL. This works on most graphics cards and OpenGL implementations. If you click on the button 'Use high level OpenGL (might not work on some graphics cards)', then a version of these programs will be installed that use a higher level version of OpenGL (much faster). Suggestion: Try using the unsafe, high level, programs. If the 3D cortical displays do not work, run this program again, and install the safer (slower) versions. If this doesn't work either, then you have a problem, possibly due to an old graphics card and/or an inappropriate version of the OpenGL library. viii. Developers Guide This section might be useful to people that: (1) are fully experienced with this LORETA software package; (2) are experienced programmers in Delphi PASCAL (or similar) under Windows; (3) want to make use of some of the programs from this LORETA software package from their own software. If you do not satisfy the above criteria, this section might be of no use to you. Suppose that you installed the loreta package into the default folder. In this case, for instance, it will all be under: c:\Program Files\LORETA\ In the following examples, it will be assumed that this is the case. If it is not, just substitute the previous folder for whatever you chose as the installation folder. ----------------------This part refers to the “Electrode coordinates maker (in Talairach space)”, “Based on extended 10/10 system template”. You may run: c:\Program Files\LORETA\030-ElCoord\TalElCM01.exe InFN OutFN where: InFN: file name (full stuff, path included, i.e. f:\kk1\kk2\lst.txt) of a text (ascii) file with a list of electrode names, one on each line. No blank lines allowed anywhere. Allowed electrode names are found in: c:\Program Files\LORETA\500-LorSysData\TCoord99.xyz and additionally, T7, T3, T8, T4, P7, T5, P8, T6. This file must follow the format explained above (go there). OutFN: File name (full stuff, path included, i.e. g:\kk3\kk4\TCoord49a.xyz) for output file containing Talairach electrodes. Note that path must exist. This program runs minimized, and then closes when finished. It is recommended to run this program in “Execute & Wait” style. ----------------------This part refers to the “Transformation matrix (LORETA operator)”. You may run: c:\Program Files\LORETA\070-TransfMat\LORETAoperator1.exe InFN OutFN [InReg] Where: InFN: File name (full stuff, path included, i.e. g:\kk3\kk4\TCoord49a.xyz) of a Talairach electrode coordinates file (see data format). OutFN: File name (full stuff, path included, i.e. g:\kk5\kk6\ttm49e.tm) for output file containing the LORETA transformation matrix. Note that path must exist. InReg: Optional. Regularization (smoothness) parameter. For example, 1.0e-4. If not included, then it takes value 0 (zero). (see more details) This program runs minimized, and then closes when finished. It is recommended to run this program in “Execute & Wait” style. ----------------------This part refers to the “EEG/ERP -> LORETA”. file:///E|/LORETA-30/010-Help/2003-06-10/05/LorHlp3.htm (3 of 4) [2003-06-10 12:27:45] LOW RESOLUTION BRAIN ELECTROMAGNETIC TOMOGRAPHY You may run: c:\Program Files\LORETA\081-Voltage2LORETA\Voltage2LORETA.exe InEegFN InTmFN OutLorbFN tf1 tf2 Where: InEegFN: File name (full stuff, path included, i.e. g:\kk7\kk8\eeg.txt) of some EEG/ERP file. InTmFN: File name (full stuff, path included, i.e. g:\kk9\kk10\ttm21e.tm) of the corresponding loreta transformation matrix. OutLorbFN: File name (full stuff, path included, i.e. g:\kk11\kk12\vep.lorb) for output file containing loreta. Note that path must exist. tf1: Desired start time frame (first is one, not zero). tf2: Desired end time frame. See more details This program runs minimized, and then closes when finished. It is recommended to run this program in “Execute & Wait” style. ----------------------This part refers to the “EEG cross-spectrum -> LORETA”. You may run: c:\Program Files\LORETA\103-VltCrsSpct2LORETA\EEGCRS2LOR.exe InFN InTmFN OutLorbFN tf1 tf2 DATATYPE There are two cases ************* First case, when DATATYPE is identical to the string: CrsSpectr Where: InFN: File name (full stuff, path included, i.e. g:\kk7\kk8\EC.crs) of some cross-spectrum with data structure as specified in the help file. InTmFN: File name (full stuff, path included, i.e. g:\kk9\kk10\ttm21e.tm) of the corresponding loreta transformation matrix. OutLorbFN: File name (full stuff, path included, i.e. g:\kk11\kk12\vep.lorb) for output file containing loreta. Note that path must exist. tf1: Desired start discrete frequency (first is one, not zero). tf2: Desired end discrete frequency. This program runs minimized, and then closes when finished. It is recommended to run this program in “Execute & Wait” style. ************* Second case when DATATYPE is identical to the string: VarCovar Where: InFN: File name (full stuff, path included, i.e. g:\kk7\kk8\EC.vcv) of a file containing one or many symmetric variancecovariance matrices based on EEG/ERPs. InTmFN: File name (full stuff, path included, i.e. g:\kk9\kk10\ttm21e.tm) of the corresponding loreta transformation matrix. OutLorbFN: File name (full stuff, path included, i.e. g:\kk11\kk12\vep.lorb) for output file containing loreta. Note that path must exist. tf1: Desired start variance-covariance matrix (first is one, not zero). tf2: Desired end variance-covariance matrix. This program runs minimized, and then closes when finished. It is recommended to run this program in “Execute & Wait” style. The structure of a variance-covariance file is: Type Vector = array[1..Ne] of double; Matrix = array[1..Ne] of Vector; f = File of Matrix; where Ne is number of electrodes; the matrices must be symmetric; they must not be diagonal (i.e., they must include covariances); and double is an 8-byte real (float). Note that there is no header for this type of file! In practice, an example follows. Suppose you have some EEG. Then filter it between 1.5 and 4 Hz. Then compute the Ne*Ne variance-covariance of the filtered EEG (over time). This is a single variance-covariance matrix. Now make another one for another frequency band, and so on. In this example, you've made a collection of matrices. Then, for each matrix you can compute LORETA, which corresponds to the generators of the frequency bands (as when using cross-spectra). This is only an example. ----------------------This part refers to the “LORETA viewer”. You may run: c:\Program Files\LORETA\091-LORETAviewer&3Dsurf\LORETA_KEY_Viewer02.exe LORETAfn where LORETAfn: File name (full stuff, path included, i.e. g:\kk9\kk10\vep.lorb) of a LORETA file that should be opened for viewing. However, each time you run the program, a new instance will open an remain open. This might not be very convenient. A solution follows. If this program is already running, then you may post a message to it using: const wm_MessStuff=wm_user+2003; The program will then look for the text file: c:\Program Files\LORETA\091-LORETAviewer&3Dsurf\!!LoretaFileName.txt which must have already been created by the user. This text file must contain a single line of text, corresponding to the file name (including path and all) of a LORETA file that the user desires to be opened and viewed. For example, the contents of the file should be the single line: c:\asd\fghj.lor If this file really exists, then the viewer will display it immediately. An example Delphi 7 PASCAL code for posting messages is under: c:\Program Files\LORETA\091-LORETAviewer&3Dsurf\01-Test-PostMess Alternatively, if the “LORETA viewer” program is already running, then you may SEND a message to it. The message must contain and specify two items: a string, and the length of the string. The string must correspond to a LORETA file name (with path and all). If the file really exists, then the viewer will display it immediately. An example Delphi 7 PASCAL code for sending messages is under: c:\Program Files\LORETA\091-LORETAviewer&3Dsurf\02-Test-SendMess ----------------------- file:///E|/LORETA-30/010-Help/2003-06-10/05/LorHlp3.htm (4 of 4) [2003-06-10 12:27:45]