***************************************************************************************** **General Tips*************************************************************************** ***************************************************************************************** ***Making*** * wireframes = meshes * get in the habit of keepng any eye on your filter pipeline if it varies * should be using non-default 0.0132 for skull//bone conductivity for source localization * save maps as "map data" format and not as "source map" * first create a "source estimate" (add to workspace; load) and then "map" it ... can use the display pane to toggle between "avg'ed across time" and "each successive timepoint" views * Window Average: All data in the interval will be averaged before the map is constructed (i.e., before the inverse matrix is applied). This is the default selection. * Average Map: Source maps will be constructed at each time slice before the maps are averaged. * volume conductor (3shell, fem, bem) always covers whole head; whereas source-space needn't (eg, ditch cerebellum)...make a mask of the cerebellum using visual edit-->exclude from GM (using image arithmetic) prior to creation of mesh for source space; * If Lattice is selected and an inner skull wireframe is loaded, the lattice is constrained to fill the inner skull wireframe. * Source Volume: This option becomes available if a 3D wireframe file (*.3fr) is currently loaded in the workspace. A FEM 3D wireframe file (*.3fr) can also be loaded, but cannot be used as a source volume. Note, however, that an FEM 3D wireframe file must be loaded to use an FEM forward model. * Forward Model: FEM is the volumetric (finite element method) solution to the forward problem. The use of this model requires that a 3D wireframe (*.3fr) containing conductivity values be loaded. ***Displaying*** * Left/Right Annotations: If this box is checked, an L and R will be displayed in the three axis views, to avoid confusion. ***PSD*** * must choose to compute covariances when computing psd in order to source localize * save map and open localizer module to view * note that the cov gets saved in the tree underneath the .bin file for the psd; you have to explicitly load it if you're working from a saved workspace and not creating it for the first time. ***Random*** * there seems to be some hack where you can use the permutation stats package to generate mean ERPs across multiple recordings (files) **************************************************************************************** **************************************************************************************** ***************** ******Day 1****** ***************** *************************************** ** 0900-1030 Introduction to EMSE and Time Series Analysis - I** *************************************** **Overview Stuff** * trial code = 001015354933 * beta releases @ ftp.sourcesignal.com /software *************************************************************** *********************Thursday AM Hands-On Component************ *************************************************************** ********************* **Data Editor Intro** ********************* * add data -- no softlinks unfortunately! * then load it (right click) * probe = sensor layout in 3d space * p3 example = 64chan * can create probe using emse 'locator' module * can use measured (polhemus) or canonical based on manufacturer's (egi/biosemi) library entry (what we typically do) ... .elp --> "electrode library probe"?? * emse will try to automatically detect any trigger or event channels and load them under the data entry in the workspace tree...loaded as an .evt extension...visually these are displayed as vertical blue lines if you click on the .evt * edit-->chan * chan state: "pass through" not used for source loc; eg, facial emg, eog etc.; "off" neither used nor displayed * edit-->copy to clipboard * useful for creating pub quality .bmp's w/o image degradation * edit --> load script (for scripts that have no GUI yet) * 1 = examining distribution of RTs * 2 = complex booleans for compound events * 3 = generate xml scripts * 4 = calc time-freq entropies * view --> reset display params to revert to defaults (NB: close and reboot will not fix revert as the setting s are autosaved) * analysis --> filter pipeline {***Standard ERP Data Reduction/Preprocessing***} * preprocessing function list * add * spatial filters * data whiten * montage * average ref * physl ref-->eg, make bipolar for eog or emg * ocular art correction via eog regression * ocular art correct = manual, cursor-based correction; **any** stationary artifact (ie, not "idiosyncratic" in makeig/jung terminology); * spatial component * spatial interp-->spline chan replacement * temporal (freqy) filters * iir w/ no phase shift (be careful to not erroneously apply to non-eeg chans) * polynomial detrend * rectifier-->eg, emg analyses or create trigger using a continuous physl chan such as emg * analysis --> estimate cov * analysis --> express ocular art correction (expects that data have already been avg ref'ed!) * Filtering * Ocular Artifact Correction-->click on "eye" radio button on tool bar * this will auto ocular art correct based on a canonical template * quasi-pca-based approach using uncorrelated pc's Event Review Radio Button * eg, use event no. 2 and -200 to +500ms * can use left arrow in buttefly plot to step through trials * if you click on any given blue event mark, turning it to magenta, you will not use that particular trial in averaging * should save new event file w/ a new name and unload the original event file to be safe * Segment Averaging (analysis --> averaging) * can turn off "cov" to save time, as not used exc. for beamformer * can use "magnitude limits" to eliminate residual artifact (eg, 50e-6 = 50uV) * likewise, can use "df/dt" to drop crazy slews * none of this will ditch flatlined channels (too small variance) (have to do manually earlier in emse 5.1.1) * use partial time series: to ignore epochs when applying data-exclusion rules * compound boolean events//conditional event selection: eg, want only seg offballs (event2) preceded by targets (event1) --> click helpfor detailed info on this * baseline detrending * eg, 0 (default) = baseline or DC offsets * Canonical Wireframes: C:\Program Files\Source Signal Imaging\EMSE Suite v5.1.1\Average Brain\Mesh\Biosemi\ * (for example dataset) * use egi at home * add scalp wireframe (aka mesh) to project workspace and load * use cursor to select an erp peak * click visualizer radio button on toolbar * scalp --> apply ... can now play w/ rendered head ... right click to zoom on head...left click to click across locations...can record animation... * sensors-->apply * "content" button is context sensitive depending on what's highlighted (eg sensors vs scalp) * can play with settings eg colortable * may need to shift to white background to see eg sensor labels or scalar bar * have to hit "apply" again after each change * to apply filter pipeline to many files --> copy .ppm file and save with new name apropos for each file (eg using perl script or the like) ***Running ICA*** * click on .bdf in tree to get focus back to continuous, unaveraged data * sobi-->event-->etc. (similar to proc for segmentation) * need seed value for sobi, so can use pca of grand mean avg * note that you can use ica for artifact correction if you run this on the non-averaged data, non-corrected data AND don't use front-end pca * "mdl" is info theoretic way of distinguishing useful components...does not work well for averaged data * "task onset mutual information" -- high = predictive of contents of trial * hit "sort" * go back to first tab * select a useful subset of components * next * finish * Should see lower display window with components laid out as timeseries (can choose alt view at prior step) ********************************************** ***if re-do, need to clear old ica's or sobi's from selected filter pipelines*** ********************************************** ********************************************* ***Thurs PM Hands On Session***************** ********************************************* ****Time-Frequency Analysis**** * can do on either raw data, segmented and avergaed data, or source-space data * today's example = component data to save time * can use wavelet display to change look of output ... must click apply after each change to change display!! * put cursor over it to read off freqy * if you click on "coherence" * click on ref tab in the wavelet display dialog * can chage which is the ref channel * the display shows how much the other components are coherent with the ref component (if you ran this on component data) * can change baseline-ing Baseline Control: None: No baseline processing will be applied. Absolute: The prestimulus interval values will be subtracted from all time points of the interval. Relative: All time points of the interval will be divided by the prestimulus interval values. *** MAY NEED TO RE-ADJUST SCALE ... TURN OFF AUTOSCALE ... +/-1*** ********************************* **** Thurs PM Hands On: ********* ********************************* **utilities-->macro recorder-->** ********************************* ********************************* **** Thurs PM Hands On: ********* ********************************* **MR Image Viewer *************** ********************************* * can typically use extant workspace, but for today's example we are gonna start from scratch * can read dicom, analyze or minc format mri data * ***XXX*** * new workspace * rightclikc on project-->new image data (we're gonna make a vmi/volumetric image) * "raw" = no header info * dicom-->browse-->YOU HAVE TO ENTER THE FILES IN THE CORRECT ORDER!! make sure you have the right total number of files!!! * emse always uses radiologic convention!! * we're gonna skip the wizard that allows you to clean up the mri image files (eg, remove background noise) ******************************************************************** *******Registration: Map MRI to Electrode (measurement) space******* ******************************************************************** * how to change image intensity: use contrast/brightness radiobuttons on the toolbar * "3-arrow" radiobutton on toolbar allows you to use locked x-hairs in 3 mri planes (like afni) * be careful that the xyz space of your electrode system is the same as your mri-space and as emse defaults * rightclick project-->grab probes * landmarking left/right periauricular points and nasion/inion * registration wizard-->second page of gui: click "use 3d" --> click arrow w/ red dot radiobutton-->set the two peri points and the nasion and then click "edit" pulldown and choose "detect scalp points" --> close--> next--> Weights: do "include scalp points" ... "penalize inside electrodes" (?????utility???) --> ******************** ***Segmentation**** ******************** * Seg wizard * Head2Ctx--> bounding box-->click and drag-->make a box that grabs whole head; too big is better; save your BB --> gradient correct: do it --> BET: do it --> BET second page: do it --> may need to do some hand-editing-->emphasize sulci: do it--> White Matter/WM: do it-->next-->next-->next-->next-->etc on the next's **Mesh Generation Wizard** * good to use "apply opening" * @ next step pick "reduce" twice ie get down to about 20k voxels * can view product by going to the visualizer and electing to display the cortex * may have to manually restore emse module from the toolbar (pick "restore") ****************** **Visual Editing** ****************** goto edit-->segmentation--> visual edit tab and "start edit" to bring up tool pallette-->etc. ************************************************** **Making a BEM (inner/outer skull segmentation)*** ************************************************** **Mesh Generation Wizard** * inner skull @ 12 --> 1 of 4 = Head2Cortex Segmentation **************************************************************************** ***Some General Tips******************************************************** * <> * edit-->goto position: enter coordinate and jump to that location in the brain * right click on image to zoom, change mouse functions, cap to file, etc. **************************************************************************** ******************* **Display Options** ******************* * general--> youcan change the slice thickness from the default 10 to 1 or 0 to look more exactly where a dipole is sitting or other things * edit-->gradient correction: can do GC piecewise in different regions of cortex if you have massive inhomogeneity (could also do using other software before importing structurals into emse) *************************************************************** *********************Friday AM Hands On Component******* *************************************************************** ***Dipole Modeling*** * note: if you click run more than once when estimating dipoles it will rerun beginning from the last simplex convergence point * note that "mirror" won't work with FEM b/c that volume is not bilaterally symmetric * "failed too many iterations" --> Controls Tab * These controls on acceptable dipole fits are only used with the Successive interval option. They do not apply to the Simultaneous or Average interval options. * Relative: (also known as relative tolerance) Using the simplex method of Nelder and Mead (see ECD algorithm), this is the maximum acceptable error in the mean of any two nodes of the simplex which will allow fitting convergence. The value is a percent error (e.g., 0.01 is a 1% error). If a fit "fails" (i.e., fails to converge), it may make sense to raise this limit slightly and to then try the fit again.. * Maximum: This is the maximum number of iterations allowed before the fit terminates. *************************************************************** ***Tomographic Modeling*** ********************************************* ***Friday PM Hands On Session**************** ********************************************* ***mark does beamformers and stats and i work on running sloreta on psd for the alpha, theta and gamma bands :) *************************************************************** *********************Thursday AM Lecture Based Component******* *************************************************************** * pca and ica deal with 'mixing matrix' differently * PCA * derives spatially independent vectors * can then rotate (eg, varimax) to show better correspondence w/ ERP observations * finds first pc that accounts for max var...then second that accounts for next biggest chunk...and so on to k-1 * ICA * special case of blind source separation (BSS; SOBI is another non-ica based BSS) * assumes that ic's are uncorrelated and non-gaussian * max likelihood estimation of mixing matrix space * infomax * ignores temporal structure of timeseries * rule of thumb for minimal number of timepoints?? * SOBI * unlike ica accounts for both spatial and temporal structure * does not assume statistical independence * faster to compute *************************************************************** *********************Thursday PM Lecture Based Component******* *************************************************************** *** time-frequency/wavelet analyses*** * uncertainty issue -- better est of time = worse est of freqy AND vice versa * morlet wavelet: exponent in freqy x exponent in time (sine x gaussian that are translated in time) * complex valued (phase info) * GET estimate of phase and amp at that time-freqy combo * low freqy: get poor estimate of time and good estimate of freqy * high freqy: get good temporal and poor freqy estimate * translate morlet in time and use set (basis set) across freqy ... decompose the whole freqy-time space ***wavelet transform from single trial erp data give you 2 types of things*** * total power = phase-locked power + induced power (cf. makeig; tallon-beaudry) * coherence = correlation across channels in the **freqy domain** **************************************************************** *************************************************************** *********************Friday AM Lecture Based Component********* *************************************************************** *** souce localization*** * The Forward Problem * given a known intracerebral source(s) * * The Inverse Problem * given a pattern of measures at the scalp, estimate the source(s) * no unique solution * approached using different kinds of physiological and physical/mathematical/statistical constraints * many more DFs on the solution space then measurement space [underdetermined] ... excepting the case of dipole models that are overdetermined (eg, BESA: only a few dipoles) * Forward Model ("operator") assumptions * 3-concentric spherical shells -- analytic solution * BEM -- (relaxes symmetry constraint but still homogeneous; more realistic anatomy) integral eq * FEM -- (allows inhomogeneity and anisotropy and asymmetry) diff eq * Regularized Pseudoinverses: 2 x 2 taxonomy * Discrete/Distributed x Global (variance at one location influences inferences about other locations owing to global solution; "one size fits all" spatial filter)/Local Model * Global-Discrete: eg, discrete max likelihood (besa); overdetermined * strength = precise and parsimonious * weakness = may overlook weak but important signals whose variance is mis-allocated to error and mis-modeled dipoles; subjective/requires a priori activation; in some ways kind of like building a qrre that has lots of items ("locations") that coalesce into a single strong component that explains much of the overall variance and a much smaller number of items that form a second component which explains little global variance; * Global-Distributed: distributed minimum norm (eg, minnorm, loreta, laura; dale's method; sloreta); underdetermined * strength = objective; provides estimate at every location * weakness = assumptions may not hold uniformly across the solution-space * Local-Discrete: eg, beamformer; linearly constrained minvar; underdetermined * strength = estimates at any given location in the solution space are uncorrelated with what's going on at any other location * weakness = localization via scanning may not be accurate owing to lack of reliability at any given location (ie, assumption of independence can work against you) * Local-Distributed: ie, optimally localized averaging (eg, sola or backus-gilbert); overdetermined; not yet implemented in emse. * strength = best of both worlds for roi based analyses? * weakness = ...may not buy much if data are inherently smooth owing to spatial averaging; * Lambda regularization parameter helps account for the fact that the algorithm wants to overfit the data which would be fine if the data were noise-free. lambda is used to lessen the influence of moise on overfitting. * bear in mind that in estimating sources you have the following parameters: voxels, 3 stationary dipoles (xyz) each with magnitude and orientation, and time * Kinds of Dipole Modeling * free - best location and orientation * mirror - homologous areas * moment - fixed location, but free orientation * fixed - * regional - free location and orientation * fixed-rotating - fixed location and free orientation *************************************************************** *********************Friday PM Lecture Based Component********* *************************************************************** *** inferential statistics: SnPM ****************************** * Plus/Minus Test: Grand Mean ERPs * Permutation Test: * Source Space SnPM: * Practical Considerations: ******************************************** ******************************************** ***Step by Step: FEM/BEM model LORETA*** ******************************************** Summary of steps: I. Create an FEM 3D Mesh. II. Create a source volume 3D mesh. III. Create a forward operator. IV. Run ECD (dipole fit), selecting "Source volume" as the forward model. Detailed steps: I. Create an FEM 3D Mesh. In MR Viewer, follow the FEM volume generation step by step procedure. If the mesh has already been created, the five regions required for a basic FEM volume should already be present: head, skull, CSF, Gray Matter and White Matter. Additional regions (e.g., eyes, air, fat, etc) may also have been created. Keep any of the regions that have been created which you may wish to use for the construction of the Source Volume. II. Create a source volume. In MR Viewer, follow the Source Volume generation step by step procedure. III. Create a forward operator. In EMSE, load the time series, probe, FEM 3D mesh and source volume files. Click Source Estimation > Forward Operator. In the Source Model tab page, select Source Volume as the model type. More info... Be sure not to select Lattice as the source model type. If a Lattice source model is chosen, use of the BEM or FEM forward models will produce a forward operator that currently cannot be used within the EMSE software. In the Forward Method tab page, select FEM as the model type. Save the resulting forward operator and add it to the workspace (it should be loaded automatically). IV. Run ECD (dipole fit), selecting "Source volume" as the forward model. Click Source Estimation > Equivalent Current Dipoles. In the Settings tab page, select Source volume as the forward model. Select the time series interval to fit and run the fit (click Run). BEM model ECD fitting Summary of steps: I. Create scalp, inner skull and outer skull meshes. II. Create a source volume 3D mesh. III. Create a forward operator. IV. Run ECD (dipole fit), selecting "Source Volume" as the forward model. Detailed steps: I. Create scalp, inner skull and outer skull meshes. In MR Viewer, follow the Segmentation Wizard to create these meshes. II. Create a source volume. In MR Viewer, follow the Source Volume generation step by step procedure. III. Create a forward operator. In EMSE, load the time series, probe, wireframe mesh (scalp, inner skull and outer skull) and source volume files. Click Source Estimation > Forward Operator. In the Source Model tab page, select Source Volume as the model type. More info... Be sure not to select Lattice as the source model type. If a Lattice source model is chosen, use of the BEM or FEM forward models will produce a forward operator that currently cannot be used within the EMSE software. In the Forward Method tab page, select BEM as the model type. Save the resulting forward operator and add it to the workspace (it should be loaded automatically). IV. Run loreta, selecting "Source volume" as the forward model. *************************************************** *************************************************** *** Correction for Multiple Comparisons in EMSE *** *************************************************** *************************************************** -----Original Message----- From: Alexander J. Shackman [mailto:ajshackman@gmail.com] Sent: Tuesday, November 21, 2006 7:42 AM To: mep@sourcesignal.com Cc: Jeffrey S. Maxwell; Larry L Greischar Subject: Fwd: Correction for multiple comparisons in EMSE hi mark - i just want to confirm that i understand your comments to max correctly...as i think that i DO follow them for "corrected", but DO NOT for the uncorrected case: 1. Global Correction for MCs * Correct for Time+Space * null distribution = t-max/min histogram with as many values as iterations * ie, one t per permutation, where max/min on a particular iteration is across time+space * corrects for all comparisons across time AND space 2. Marginal Correction for Time or Space for MCs * same as above but nested within a particular time-index (across spatial locations) or within a particular spatial location (across time-indices) * corrects for all comparisons nested within time OR space 3. "Uncorrected for MCs" * no correction for multiple comparisons * you say "we look at the NULL distribution of t itself (not t-max or t-min) for a single time-space point." * this led me to believe that you are using the "textbook" t-distribution (given a particular df), with no empirical (ie, permutation-based) estimation of the null distribution * you also say that "t-max doesn't apply here, considering that there's only one t per time-space point", which is also consistent with my interpretation that you're using the "textbook" distribution * BUT then you say "The uncorrected p is obtained by determining how the actually observed t (for that space-time point) stacks up against all of the NULL t's as distributed across the iterations (of random permutations)" * which makes me suspect that a permutation approach IS in fact being used to compute the uncorrected p, rather than referring the observed t to the "textbook" null distribution -- is this so, or am i misunderstanding? * if you are in fact using a permutation approach, can i assume that you are randomly permuting the 2 conditions (or groups)? * regardless of the null distribution ("textbook" or permutation), no correction for multiple comparisons would occur Thanks for your advice, Alex Shackman On 11/21/06, Mark E Pflieger < mep@sourcesignal.com> wrote: Thanks for your note, Alex. To confirm—yes—#1 and #2 clearly & correctly describe what EMSE does. Sorry for the confusion about the uncorrected case, #3: 3. "Uncorrected for MCs" * no correction for multiple comparisons * you say "we look at the NULL distribution of t itself (not t-max or t-min) for a single time-space point." In other words, each single time-space point (e.g., channel Cz at latency 200 ms post-stimulus) is treated separately. Suppose there are N = N1 + N2 items of data (e.g., single trials for one individual, or individual averages across subjects), where N1 items are for condition 1 and N2 items are for condition 2. A t-statistic (difference of means between condition 1 and condition 2 normalized by the pooled standard error) may be calculated for the non-permuted trials, and likewise after permuting the trials so that random crossovers between conditions 1 and 2 are permitted (in order to destroy any meaningful distinction between the labels "condition 1" and "condition 2"). The null distribution = t-statistic histogram with as many values as iterated permutations. We're ignoring the other time-space points, so we're not making a distribution of the max (or the min) across multiple time-space points at each iteration. Another way to put this is that each iteration produces only one number (the t-statistic) for each time-space point so (if you want to think of it this way), that number is both the max and the min for that iteration: It's the maximum over all space-time points considered (namely, just this one) and it's also the minimum. So you can see that it's really just a special case of the global and marginal correction procedures when each space-time point is considered in isolation. * this led me to believe that you are using the "textbook" t-distribution (given a particular df), with no empirical (ie, permutation-based) estimation of the null distribution I hope this is now more clear: we're not using the textbook/parametric t-distribution to obtain p-values. * you also say that "t-max doesn't apply here, considering that there's only one t per time-space point", which is also consistent with my interpretation that you're using the "textbook" distribution * BUT then you say "The uncorrected p is obtained by determining how the actually observed t (for that space-time point) stacks up against all of the NULL t's as distributed across the iterations (of random permutations)" * which makes me suspect that a permutation approach IS in fact being used to compute the uncorrected p, rather than referring the observed t to the "textbook" null distribution -- is this so, or am i misunderstanding? * if you are in fact using a permutation approach, can i assume that you are randomly permuting the 2 conditions (or groups)? FYI, the way we do the permutations is as follows (for the unpaired case). Enumerate the N = N1 + N2 items (single trials or individual averages) so that the N1 items assigned to condition (or group) 1 are numbered first, followed by the N2 items assigned to the other condition (or group). Now generate a purely random permutation of the numbers from 1 to N, and reassign the condition (or group) assignments according to the original rule (namely, the first N1 are condition/group 1, and the remaining N2 are condition/group2). Thus, each item has a N1/N chance of being mapped to condition (or group) 1, and an N2/N chance of being mapped to condition (or group) 2. Further, nothing about the new assignment depends on the original assignment. So the null hypothesis here is that the verbal distinction between the labels "condition 1" versus "condition 2" makes no difference in reality. * regardless of the null distribution ("textbook" or permutation), no correction for multiple comparisons would occur One other (perhaps small) point is that the normalization of the differences between means (using the pooled standard error) isn't really needed for the uncorrected case. This is because the standard error is pooled across both conditions or groups, and so it is invariant with respect to the permutations. Thus, the histogram of the raw (unnormalized) differences between means is simply rescaled by the normalization factor in order to obtain the t-histogram. But this doesn't change the rankings, and so the uncorrected p-values are unaltered. The normalization is really needed when correcting for multiple comparisons, because in that case we are comparing differences across multiple space-time points. I.e., the normalization "standardizes" all values so that they may be compared for the purpose of generating the distribution of the max (across space and time) or of the min. I hope this helps, Mark *************************************************** ***************************************************