Psychophysical task

The task should be run outside and inside the scanner. A complete staircase ~30 trials for the twoCues trials and ~90 trials for the oneCue and fourCues conditions. Outside the scanner, this is about 90 minutes per staircase. Inside the scanner, it will be about two days of data (15-20runs) per staircase.

Outside, a subject takes about one staircase to get used to the task. Two staircases are collected afterwards to get a good estimate of the thresholds. This estimate is saved as a 3×5 matrix as s###prelimScannerThresholds.mat and is used to initiate the staircase for the scanner runs.

Ideally, we have 2 staircases outside the scanner (3 days, excluding the first day's worth of data) and 2 staircases inside the scanner (5 days, 4 runs + 1 buffer) per subject. The total time required from each subject is, therefore, 8 days.

cuecon_scanner

Outside scanner

cuecon_scanner('subjectid=s###','scanner=0')

Inside scanner

cuecon_scanner('subjectid=s###')

Data will be saved in ~/data/cuecon/s###.

Initial threshold options

1) If you are passing in a 3×5 matrix of thresholds for each pedestal (3) x each cue condition (5), you can pass it in as:

'threshold',varname

To generate the threshold matrix, use the getCueconThreshold function, documented below.

Otherwise, the default is 0.2. A confirmation will print out on the screen before “OK to proceed?” dialog.

2) If you are continuing a staircase from a previous run, you can load the stimfile by specifying its name. The file will be pulled from ~/data/s### or if the 'subjectID' is not passed in, ~/data/default.

'stimFile=yyddmmstim##'

In general, we will load thresholds in the first scan of every staircase. If it seems to be a bad initial threshold staircase based on performance over from day 1 and 2 (=1 staircase) we may choose to load the last stimfile when we begin day 3 (=beginning of 2nd staircase).

processing pipeline

for each session

1) dofmrigru1, peak, mask, mrAlign. ~1 hour

2) mrLoadRet setup ~15 min – Check that motion comp worked by displaying epis. best NOT to set crop region during dofmrigru (we set these params in dofmrigru1).

– Load base anatomies: the hires volume, the left/right surfaces, then left/right flatmaps. save each of them.

– load ROIs from retinotopy. save them all.

2) run erAnal on concatenation (5min per erAnal, 20min total)

– concatenate all cuecon scans

– run eranal. the name of the analysis is erAnal_ped1,2,3, or 4. each location needs to be run separately (total of 4 times). varname is pedestalContrast1,2,3, or 4. phaseNum = 2.

– display the ped1,2,3,4 on flatmaps and click around and make sure activations are in V1-3,hV4.

4) localizers (~15 min)

– average cuecon localizers together (if you have only one, just go ahead and “averge” it to keep the folders consistent. (corAnals for “averaged” single image and non-averaged single image and results look the same [checked on 100930])

– run a correlation analysis on the averaged image. you should have 210 volumes, but junk 10. best not to junk before averaging.

– make sure that color patches make sense. 2 patches of different colors in V1, V2-V3 ventral and V2-V3 dorsal should have one color patch each… if that makes sense.

total process for one session = 3 hours including dofmrigru2

if you have time: 5) erAnal on EACH scan

– run erAnal_ped1,2,3,4 on each indiv scan.

– you HAVE to “concatentate” each scan to hipass the data.

for each subject

once you have a full set of data (4~5 scans, 2 staircases). Entire process takes about 3-4 hours, but we can run it in parallel with other processes.

1) makeEmptyMLR('subjectID'), description: all scans s###, subject name: s###

2) localizers (20min)

– make new group: localizers

– import localizers from each session. fromGroup=MotionComp, toGroup=localizers (update the cueconScanList while you do this)

– check that each scan has 210 volumes.

– display EPIs and make sure that the alignment is good. if you don't check 'warp' you won't see how good each session's alignment is relative to others… so check warp…

– average them (into directory 'Averages' by default)

– go to group Averages and run corAnal on the averaged localizers. junk 10 frames in edit Group. 10cycles/run.

3) draw ROIs (varies)

– draw rois on the averaged cuecon localizers. may want to use cueconDrawROIs… but maybe best to do by hand… idk.

a) co threshold cutoff at 0.5, look at phase and draw huge roi around loc1,2,3,4_all.
b) convert loc#_all roi to traverse all depth
c) combine rois (the top roi is the roi that gets manipulated) - intersect between rV1 (top) and loc1_all (bottom) and rename rois loc1_rV1, etc.
d) reload rV1~V4 and repeat for other locations

4) erAnal (15 minutes per location x 4 locations = 60minutes)

– make a new Group called 'cuecons' and go to that group.

– import all cuecon scans and warp to scan 1.

– usually, if the cueconLocs were aligned, the cuecons would be too… you can check by displaying epis and checking 'warp'

– concatenate all motioncomped cuecons.

– run erAnal_ped1,2,3,4. takes a while since this is a huge concatenation.

– note how many trials we have for each pedestal contrast by clicking “Plot the time series” in interrogator.

– interrogate by ROIs

In general, it takes one afternoon to get all the basic analysis done, and one afternoon to draw good rois. We end up redrawing ROIs… making the entire process about 2-3 days.

Psychophysical data processing documentary

Data organization

- psycho directory is ~/data/cuecon/{insideScanner outsideScanner allTrials}/s###.

- insideScanner should contain all stimfiles copied from the concatenated time courses in ~/data/Experiments/cuecon/s###/Etc. all subjects expects s001 and s007 only did one staircase, so take the last non-localizer stim.

- outsideScanner should contain all stims from psycho room sessions. should keep a good note of final stims…

- allTrials contains a copy of final stims from folders insideScanner and outsideScanner. allTrials should be used for the model fit.

Averaging psycho across subjects

1. create subject dir s### in either insideScanner, outsideScanner, or allTrials, copy relevant stims. cd into it. (cd ~/data/cuecon/{whatever}/s###)

2. run cueconPlotTwoCue('stimfile',{'stim_blah'},'doBootstrap=1','saveVariable=1'). takes overnight. in allTrials, you can combine all the psycho to run

3. move the output file cueconPlotTwoCue_bootstrap.mat (contains 'p') to finalBootstrap.mat if we want to use these values for the final subject averages.

4. once you have finalBootstrap.mat for all subject dirs in {whatever}, cd .. or cd ~/data/cuecon/{whatever} and run averageFitsAcrossSubjects2. For now, the code chooses to include 4 subjects s001 s006 s007 s012 but you can pass in whatever you want.

5. this will output a nice graph as well as 3 structures: mean for the inter-subject means of twoCueWeibullMean, and mean3two for the inter-subject means of the three different types of two cue conditions, and ttest for pvals. save them as n4.mat or n(number of subjects).mat in ~/data/cuecon/{whatever}.

Psycho functions

cueconPsycho

- does all the low level processing. edit this code if we need to calculate new SEMs, etc.

- look at staircases for each ped x cueCondition. two cue conditions are still split into 3 types (LR,UL,kittyCorners) at first, then they are combined and a twoCueWeibullMean is calculated (magenta)

cueconPlotTwoCue

- (if you want to see ALL the different plots, an older function called cueconPlot will output every possible graph)

- this will only output one graph, if doBootStrap=1, bootstrap bounds will be printed, if doBootStrap=0, SEM will be error bars.

- a bar graph of the 3 different types of two cue conditions will also print.

cueconPlotSubjectAvgs2 (cueconPlotSubjectAvgs is obsolete)

- this needs manual programming. so far, set up for s001, s007, s015 for pedestal contrasts 6.25%, 12.5%, 25%… but we will need to do this for 12.5% 25%. 50%.

- now plots based on cueconPlotTwoCue outputs. Rename the output from cueconPlotTwoCue('doBootstrap=1') to finalBootstrap.mat and place in subject folder. then run from outside… see above.

- calculates SEM for display (error bars) and outputs pvals based on ttest and anova in a separate output called ttest.

- output is mean, mean3two, ttest. see above.

getCueconThreshold

- pass in stimfile

- save a matrix of threshold values pedsxcue (3 by 5) called yymmddstim##threshold.mat

cueconHighestContrast (and cueconHighestContrast_ScatterPlot)

- sorts trials by whether the target was the highest contrast shown during the trial, lowest contrast shown, etc, and calculates separate discrimination thresholds for each.

- in the process this functions looks at every single stim then concatenates theoretical thresholds (not what was actually shown on screen), not just the last stim! may be useful later?

- for lowest contrast shown, we will have very few 25% and no 50% contrast points. same for highest contrast shown, etc. so this is really to just see if thresholds are heavily influenced by “distractors”

- _ScatterPlot will print all the weibull fits in a scatter plot compared to non-highest contrast estimates. in general, performance is better if target was the highest contrast shown. now sure how significant yet.

cueconPsycho_otherContrasts

- does all the low level processing for cueconHighestContrast

===

fMRI data processing documentary

fMRI Functions

cueconDrawROI (obsolete better by hand...)

- cuts off at threshold co = 0.2 and draws 4 phase rois for each roi you select (lV1 selected, then we will end up with lV1_loc1,2,3,4.)

- we need to manually rename these rois by the relevant locations later.

cueconAverageTimeSeriesByROI

- make fits for time series for each ROI.

- need to specify locations (plural) or else it will default to running fits for 4 locations PER roi.

- should set verbose=1 if we want to use this program to find out which location an ROI is associated with.

cueconAvgAcrossROIs

- takes outputs from cueconAverageTimeSeriesByROI, letting you specify what location each roi links to.

- must specify style = [1 2 3 4 5 6 7] where styleNames = {'pedOnly' 'cueOnly' 'pedCue' 'cue2Only' 'pedCue2' 'pedCue2targ' 'pedCue2wasCued'}

- the max number of rois you can average is four, assuming you have one roi per location.

- you CAN average up to 4 rois for ONE location… idk if you want to do that though…

- the name variable will be the name of the eps file you want all these graphs stored to.

- output graphs are (so far, only works for style=6 and style=7):

– 1) fitTimeCourse HDR response curves separated out by condition

– 2) amplitudes vs. pedestal contrast line graphs (to see how each condition stacks)

– 3) mean amplitude vs. pedestal contrast line graph of all the rois you processed.

averageFitsAcrossSubjects

averageFitsAcrossSubjects('visualArea=1','subjectID',{'s001' 's006' 's007'},'style=7','verbose=0','concatROIs=1','hdrlen=15','figNum=[35 45]')

- this is the main function to average across subjects. works for visualArea=[1 2 3].

- style6 = cuedTarg. will show difference plots between cue1 and cue2 conditions. does linear interpolation to get points at 12.5, 25 and 50% contrast (before shifts).

- style7 = cuedUncued. will show cued>uncued responses.

- saves all eps and before/after mean variables in a folder under ~/data/Experiments/cuecon/averageFitsAcrossSubjects_outputFigures. the files will be named V#_n#_y{After Before}Meanbackup_style#.mat. concentrate on AfterMean.

cueconRunTtestOnFits

- pass in filename=V#_n#_yAfterMeanbackup_style# to calculate pvals.

- style7 will output ttest and ANOVA pvals for cued vs. uncued. all variables are saved with extension _test.mat

- style6 will output the pvals for the (non-)difference between cuetarg-uncued for cuecondition 1 and 2.

Stimfiles Log

Outside scanner

s001 (?)

1) 2)

s007 (2)

1) 100916_stim02,03,04,05,06,07

2) 101007_stim01…05

100916_stim07 and 101007_stim05

s006 (2)

0) 100917_stim01,02 training.

- two cue and four cue flipped (no eye tracker)

1) 100921_stim01,02,03 (no eye tracker)

- reduced threshold. may want to make this the FIRST staircase

2) 100924_stim01,02,03 (yes eye tracker)

- thresholds look more stabilized. looks good with averaging of 21 and 24 (not 17th), although thresholds DECLINE rather than incline. may be ok as long as we average across subjects

100921_stim03 and 100924_stim03

Inside scanner

s001 (~520 trials per pedestal contrast)

1.1) 100622_stimX

1.2) 100624_stimX

1.3e) 100625_stim11

2.1) 100629_stimX

2.2) 100630_stimX

3.1) 100812_stimX

3.2e) 100813_stim12

100625_stim11 and 100813_stim12

s007 (~370 trials per pedestal)

1.1) 100916_stim02…10

(1.2OMIT)100917_stim03…12 decreasing confidence from last scans. best to omit.

2.1) 100921_stim02…10

2.2e) 100924_stim3…9

1.2e) 100927_stim02…9

100924_stim09 and 100927_stim09

s006

20100929 first scan cancelled due to pain in back of head. no epis taken. we tried to fit eye tracker… but perhaps it was best to skip it. readjusted, and looks like non-eye tracker with white velcro, bumpy foam rather than smooth foam may be ok. the coils should be taped. see scanlog for more comments.

1.1) 100930_stim02…9

1.2) 101005_stim02…03 wrong nv, twice as much data, unprocessed http://www.cbm.brain.riken.jp/~mri/cgi-bin/forum/index.php?topic=69.0, but 101005_stim04..5 normal

1.3) 101006_stim02…09

1.4e) 101008_stim02…09

1.5e) 101015_stim0x…0x Kenji and Takeshi running this scan!

1.6e) 101020_stim0x…0x Yuko and Chisato running this scan!

1.7e) 101201_stim0x…0x

1.8e) 101203_stim0x…0x

s012

s01220101207

s01220101210 (terminated)

s01220101215

s01220101217

s01220101221

s016

s01620101208

s01620101209

s01620101215

s01620101217

s01620101220

s012

s016

s006

s005

s001

s007