Transcript
Page 1: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Source activation single trial analysis

I. The excel file

Open your Psyscope data file with Excel:

This Excel workbook should be where you store all the information you extract from the .sqd MEG file, as well as all the calculations you perform on the behavioral data. One page of the workbook should be used for the “variables” that will be input to the statistical analysis of your results. Each column of this page will have values for variable, both “independent” (properties of the subjects and properties of the stimuli that you manipulated) and “dependent” (what you measured, including RT and MEG measures). To begin creating this page from your initial import from the Psyscope data file, remove the header information (keeping column labels), remove irrelevant columns, and add “subject” as the first column, giving this variable a single value of the subject number for the whole column.

1

Page 2: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

The column that indicates which button the subject pushed should be recoded to indicate whether or not the subject was correct (we’ll remove error trials from all statistical analyses). Use zero for error, one for correct. Select all the columns and Data Sort first by Event Tag and second by State. Given what you know about the correct responses, overwrite correct responses with “1” and incorrect responses with “0”. When you’re done, Sort again by Trial.

2

Page 3: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

II. Preparing the .sqd file for analysis

Open your .sqd file in MEG160.

Under “Edit” do “Noise Reduction” using the parameters shown. Say “no” about the possibility of undoing the operation.

3

Page 4: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Using “Select Channels” (it’s the last button on the top row of buttons), select “All MEG” channels before the next step. THIS IS IMPORTANT.

Then, under Edit, choose “Moving Average” with the parameters shown. Reply “no” to being able to undo the operation.

4

Page 5: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

If your file is too big for MatLab to handle, you may need to downsample (for example, down from 1kHz to 500Hz sampling rate). Choose “Thin Out” under the edit menu, with these parameters.

5

Page 6: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

III. Creating the “weights” file for a source analysis.

A. Create a Grand Average

For the Grand Average, you want to get triggers for all of the relevant stimulus types (for the M350, all words and nonwords would be averaged together). If you’ve triggered on one channel for all stimuli, you can just search on that trigger line. If you have different triggers for different stimuli that will go into the Grand Average, you should use “Add Mode” in the Trigger List frame and search for triggers one after the other.

First, hit the Set button for “Level Rejection.” When the Level Rejection window appears, first hit “All MEG,” then set the parameters as shown, for +/-.4% rejection.

6

Page 7: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

With the parameters as shown in the Offline Averaging box (from Edit Average), Search for triggers. (You could use a different epoch size, depending on where the activity of interest occurs. For example, for an M100, a range from –100ms prestimulus to 250ms post-stimulus might be sufficient.)

7

Page 8: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Execute and save the averaged file.

Select Channels All MEG Channels and change the vertical scale to reveal the components of the averaged response. For visual word presentation, the M170 should be clearly visible as shown.

8

Page 9: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Next do Baseline Correct (under Edit) with the parameters shown.

9

Page 10: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Then do LPF (Low Pass Filter) under Edit with the parameters shown.

10

Page 11: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

You should be ready for M350 localization at this point. Not every file will allow you to find a localizable M350. In fact, the one we’ve been working on in this example fails to show an M350 field pattern in the time window between 300 and 400ms post stimulus onset.

11

Page 12: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

The good M350 field pattern will be positive – red – at the bottom left and negative – blue – at the top left.

12

Page 13: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

This field pattern should resemble that for the auditory M100 response from the same subject.

13

Page 14: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Choose the sensors that cover this field pattern in the left hemisphere. Make sure that you save the set of sensors you’ve chosen by choosing “save” under the “file” menu in the “Select Channels” pop-up box.

Choose from the MRI menu Create MRI file from Digitizer Data.

14

Page 15: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

“Search” for the .hsp headshape file and then the .elp marker coil file. Hit OK and save the .mri file, answering yes to all the questions that pop up.

Now under the MRI menu, choose MRI Marker Positioning and Search for the marker .sqd file. Hit OK.

15

Page 16: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Now under MRI do MRI/MEG coregistration. Hit “Exec Coregistration” then OK to accept (hopefully, the coregistration will give an average error of less than 5mm).

16

Page 17: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Under the Analysis menu, choose Sphere Model, then hit the Auto button (with “Two End Points” chosen). Using the arrows with the x y and z and Radius indicators, you can expand or move the sphere to cover much of the head

17

Page 18: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Hit OK to accept.

Place the cursor at the beginning of the time region that you would like to analyze for the M350 and shift click and drag to highlight the region from that point to the end of the time region.

18

Page 19: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Click back at the beginning of the time region (exactly) and choose Dipole Fitting from the Analysis menu.

19

Page 20: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Unclick the “Confirm” Box and hit Estimate #1. Close the Dipole Fitting box.

20

Page 21: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Under the Property menu, choose Magnetic Source Info. Examine the file and find the Intensity peak latency in ms. that also shows a reasonable GOF (goodness of fit) – over 90% is fine. SAVE THIS FILE using the save command under the File menu.

21

Page 22: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Close the Info window and click on the time slice of the Intensity peak. Note in this example that the dipole at the intensity peak is medial and inferior to where we would expect the M350 source (the localization toward the beginning of the time windows is closer to what we expect).

22

Page 23: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Save the file before the next step. Now choose under the Edit menu, Forward Problem and agree to overwriting measured data with data computed from the dipole.

23

Page 24: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

Under the Property menu, choose Measured Data Info. Select Channels and select only the MEG channels 0-157. Under the File menu in the Measured Data Info window, Save this info as a .txt file.

24

Page 25: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

You’re now done with MEG160. The “Measured Data” file you saved will be used to create a weights file for source analysis.

Open the Measured Data file you saved in Excel, copy just the column of 157 numbers corresponding to the measured data in fTs, paste this column into a Word file and save as a plain .txt file. This is the basis of the weights file you’ll create in MatLab.

Load your text file into MatLab:

wgtsft = load('weightsft.txt');

Now you’ll normalize the weights vector.>> for i=1:length(wgtsft)weight(i)=(wgtsft(i)-mean(wgtsft))/std(wgtsft);end;

Save the weight file as a text file:

save weight.txt weight –ASCII

25

Page 26: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

(this puts the file under the MATLAB7 folder – you may want then to move it into your working folder, with the other files relevant to the analysis)

Now the mean(weight) = 0 and the stn(weight)=1

IV. Using MatLab

Here’s what MatLab looks like after you start the program up. The “Array Editor” may not be open until you double click on a matrix or vector variable in the Workspace.

A. Load your MEG file

The MatLab command is “get_trials”:

>> [triggers, datastack, smpr] = get_trials('2830_TAFTFORSTERfran', [160:167], [0:157], -100, 450);

The variables returned by this function are “triggers” “datastack” and “smpr”. “triggers” has two columns. The first indicates the time of each trigger in milliseconds; the second gives the trigger code for each trigger. “datastack” is the MEG data divided into epochs around each trigger and stacked. Each level of the stack is a two dimensional array of MEG sensor values, with sensor number one dimension and time the other. “smpr” relates to the sampling rate of the file and is used by further functions.

26

Page 27: Source activation single trial analysisweb.mit.edu/marantz/Public/Download/AnalysisInstruc.doc  · Web viewSource activation single trial analysis. I. The excel file. Open your Psyscope

The input to this function are (1) the file name of the .sqd data file that you prepared in the first step of these instructions, (2) the trigger channels (use what’s shown for Mac experiments, use [184:191] (3) the MEG channels (use all channels [0:157]), (4) the prestimulus interval (negative values for pre-trigger values, so –100 for 100ms pre-trigger) (5) the post-stimulus interval (here 450ms).

The program will return the following information about your .sqd file when it is done loading datastack and finding triggers:

Sqdhandle object properties: ---------------------------Version : 2Revision : 1SystemID : 31SystemName : Massachusetts Institute of Technology160-channel MEG System

ModelName : EQ1160RFileName : 2830_TAFTFORSTERfranInputGain : 2OutputGain : 50ChannelCount : 192Channels : [1x192] Channel arrayComment : PatientInfo : SampleRate : 1000AcquisitionType : 1RawOffset : 58236Datatype : int16SamplesAcquired : 1000000ActSamplesAcquired : 405000SamplesAvailable : 405000

B. Get Activations

27


Recommended