TaskPipeline_v2.m 3.38 KB
Newer Older
Julian Kosciessa's avatar
Julian Kosciessa committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
% Pipeline including task practice/threshold estimation, MAT pre, checkerboard and MAT post assessment

%%%%%%%%%%%%%%%%%%%%%%
%% enter subject ID %%
%%%%%%%%%%%%%%%%%%%%%%

subj = 'TEST_v1';

%% add required paths

pn.root = '/Volumes/LNDG-1/Julian/Projects/DYNSAT/C_Paradigm/';
pn.CB = [pn.root, 'checker/'];
pn.MAT = [pn.root, 'dotsx/'];

addpath(genpath([pn.root, 'functions/']));
addpath(pn.CB);
addpath(pn.MAT);

addpath(genpath('/Users/Shared/Psychtoolbox/')); % PTB 3.0.13 (160606)

%% create results directory

subjectsPath = [pn.root, '/data/', subj '_' datestr(now, 'yymmdd_HHMM') '/']; mkdir(subjectsPath);

%% set up PTB

Screen('Preference', 'SkipSyncTests', 1);
oldLevel = Screen('Preference', 'Verbosity', 4); % output debugging info
PsychDebugWindowConfiguration(0,0.3)

%% practice MAT task

cd(pn.root);

% staircase parameters
P.PM.priorAlphaRange = .5:.02:.8;
P.PM.stimRange = .5:.01:.8;         % only allow values in range from 50 to 80%
P.PM.numtrials = 32;                % (numtrials/2) needs to be round
P.PM.gamma = 0.5;                   % assumed chance level
P.PM.priorLambdaRange = .2;

dotInfo = createDotInfo_JQK_170704;
dotInfo.dataDir = subjectsPath;

cursubj = [subj, '_practice'];
DEBUG = 1; opacity = 1;
thresholds = MAT_practice_170704(dotInfo, cursubj, DEBUG, opacity, P);

disp(thresholds); disp('Please check whether they are reasonable.')

%% run MAT Task (Pre-CB) 

dotInfo = createDotInfo_JQK_170704(thresholds);
dotInfo.dataDir = [pn.root, 'data/'];

cursubj = [subj, '_PreMAT'];
DEBUG = 1; opacity = 1;
MAT_experiment_170704(dotInfo, cursubj, DEBUG, opacity)

%% practice checkerboard task

subjectsPath = [pn.root, '/data/', subj '_' datestr(now, 'yymmdd_HHMM') '/']; mkdir(subjectsPath);

setup.subj          = subj;
setup.design        = 1;
setup.ET            = 0;
setup.in_scanner    = 0;
setup.dummyScans    = 0;
setup.add_display   = 0; % if not in scanner: additional display connected?
setup.test_trigger  = 0; % test scanner trigger (1) or not (0)
setup.DEBUG         = 1; % debug mode?
setup.transparency  = .99; % only relevant if DEBUG == 1
setup.verbosity     = 4; % magnitude of PTB output
setup.EPI           = 0;
setup.BGmode        = 'black'; % black/grey mode
setup.mode          = 'task';

[checkerInfo_practice, setup] = PureCheckerParameters_Practice_170403(setup);
setup.catchPractice = 0;
checkerBoard_Practice_Threshold_170705(checkerInfo_practice, subjectsPath, setup);

%% set up and run checkerboard

subjectsPath = [pn.root, '/data/', subj '_' datestr(now, 'yymmdd_HHMM') '/']; mkdir(subjectsPath);

setup.subj          = subj;
setup.design        = 1;
setup.ET            = 0;
setup.in_scanner    = 0;
setup.dummyScans    = 0;
setup.add_display   = 0; % if not in scanner: additional display connected?
setup.test_trigger  = 0; % test scanner trigger (1) or not (0)
setup.DEBUG         = 1; % debug mode?
setup.transparency  = .99; % only relevant if DEBUG == 1
setup.verbosity     = 4; % magnitude of PTB output
setup.EPI           = 0;
setup.BGmode        = 'black'; % black/grey mode
setup.mode          = 'task';

[checkerInfo, setup] = PureCheckerParameters_170403(setup);
checkerContrastComp_170705(checkerInfo, [subjectsPath, 'CB_Task_'], setup)

%% run MAT Task (post-CB)

dotInfo = createDotInfo_JQK_170704(thresholds);
dotInfo.dataDir = [pn.root, 'data/'];

cursubj = [subj, '_PostMAT'];
DEBUG = 1; opacity = 1;
MAT_experiment_170704(dotInfo, cursubj, DEBUG, opacity)