Commit 5ad83a85 authored by Julian Kosciessa's avatar Julian Kosciessa
Browse files

Commit 170707

parents
*.mat
\ No newline at end of file
% 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)
% 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 = [];
dotInfo = createDotInfo_JQK_170704;
dotInfo.dataDir = subjectsPath;
DEBUG = 1; opacity = 1;
cursubj = [subj, '_MAT_Practice'];
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, '_MAT_Pre'];
DEBUG = 1; opacity = 1;
MAT_experiment_170704(dotInfo, cursubj, DEBUG, opacity)
%% practice checkerboard task
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;
setup.subjectsPath = subjectsPath;
checkerBoard_Practice_Threshold_170705(checkerInfo_practice, setup);
%% set up and run checkerboard
setup = [];
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);
setup.outputName = 'Task';
setup.subjectsPath = subjectsPath;
checkerContrastComp_170706(checkerInfo, setup)
%% run MAT Task (post-CB)
dotInfo = [];
dotInfo = createDotInfo_JQK_170704(thresholds);
dotInfo.dataDir = subjectsPath;
cursubj = [subj, '_MAT_Post'];
DEBUG = 1; opacity = 1;
MAT_experiment_170704(dotInfo, cursubj, DEBUG, opacity)
%% add paths
% add PTB
addpath(genpath('/Users/Shared/Psychtoolbox'));
% add dotsx functions
pn.workingFolder = '/Volumes/fb-lip/LNDG/Julian/Projects/DYNSAT/C_Paradigm/MAT_V2/';
addpath(genpath([pn.workingFolder, 'functions/']));
addpath(genpath([pn.workingFolder, 'dotsx/']));
addpath(genpath('/Volumes/fb-lip/LNDG/Julian/Projects/DYNSAT/C_Paradigm/Z_tools/'));
%% set up and run RDM experiment
Screen('Preference', 'SkipSyncTests', 1);
%OSXCompositorIdiocyTest()
%oldLevel = Screen('Preference', 'Verbosity', 4); % output debugging info
%PsychDebugWindowConfiguration(0,0.3)
dotInfo = createDotInfo_JQK_170327;
dotInfo.dataDir = [pn.workingFolder, 'data/']; %mkdir(dotInfo.dataDir);
subj = 'JQK_Test_170626_01';
DEBUG = 1;
opacity = 1;
dotsExperiment_JQK_170327(dotInfo, subj, 0, DEBUG, opacity)
\ No newline at end of file
%MAT_TrainingEstimation_170626_WIP
subj = 'JQK_Test_170704_v1';
%% add PTB
addpath(genpath('/Users/Shared/Psychtoolbox/'));
%% practice MAT task
pn.workingFolder = '/Volumes/fb-lip/LNDG/Julian/Projects/DYNSAT/C_Paradigm/MAT_V2/';
addpath(genpath([pn.workingFolder, 'functions/']));
addpath(genpath([pn.workingFolder, 'dotsx/']));
addpath(genpath('/Volumes/fb-lip/LNDG/Julian/Projects/DYNSAT/C_Paradigm/Z_tools/'));
% 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 = 30;
P.PM.gamma = 0.5; % assumed chance level
P.PM.priorLambdaRange = .2;
Screen('Preference', 'SkipSyncTests', 1);
dotInfo = createDotInfo_JQK_170327;
dotInfo.dataDir = [pn.workingFolder, 'data/'];
cursubj = [subj, '_practice'];
DEBUG = 1; opacity = 1;
%MAT_practice_170626_WIP(dotInfo, cursubj, 0, DEBUG, opacity, P)
MAT_practice_CompleteOnly_170704_WIP(dotInfo, cursubj, 0, DEBUG, opacity, P)
\ No newline at end of file
% Pipeline including practice, MAT pre, checkerboard and MAT post assessment
%% enter subject info
subj = 'Sub01_v1';
%% add PTB
addpath(genpath('/Users/Shared/Psychtoolbox/'));
%% practice checkerboard task
experimentFolder = '/Volumes/MyPassport3TB/RDM_Distract/CheckerContrastComp_V11/';
addpath(genpath(experimentFolder));
cd(experimentFolder);
% set up experiment
Screen('Preference', 'SkipSyncTests', 1);
oldLevel = Screen('Preference', 'Verbosity', 4); % output debugging info
PsychDebugWindowConfiguration(0,0.3)
subjectsPath = [subj '_' datestr(now, 'dd-mm-yyyy_HH-MM-SS') '/']; mkdir(subjectsPath);
checkerInfo = [];
[checkerInfo] = checkerParameters_170213;
DEBUG = 1; opacity = 1;
checkerBoard_Practice_170328(subjectsPath, checkerInfo, DEBUG, opacity)
%% practice MAT task
pn.workingFolder = '/Volumes/MyPassport3TB/RDM_Distract/MAT_V2/';
addpath(genpath([pn.workingFolder, 'functions/']));
addpath(genpath([pn.workingFolder, 'dotsx/']));
Screen('Preference', 'SkipSyncTests', 1);
dotInfo = createDotInfo_JQK_170327;
dotInfo.dataDir = [pn.workingFolder, 'data/'];
cursubj = [subj, '_practice'];
DEBUG = 1; opacity = 1;
MAT_practice_170328(dotInfo, cursubj, 0, DEBUG, opacity)
%% run MAT Task (Pre-CB)
% add dotsx functions
pn.workingFolder = '/Volumes/MyPassport3TB/RDM_Distract/MAT_V2/';
addpath(genpath([pn.workingFolder, 'functions/']));
addpath(genpath([pn.workingFolder, 'dotsx/']));
Screen('Preference', 'SkipSyncTests', 1);
dotInfo = createDotInfo_JQK_170327;
dotInfo.dataDir = [pn.workingFolder, 'data/']; mkdir(dotInfo.dataDir);
cursubj = [subj, '_PreMAT'];
DEBUG = 1; opacity = 1;
dotsExperiment_JQK_170327(dotInfo, cursubj, 0, DEBUG, opacity)
%% set up and run checkerboard
experimentFolder = '/Volumes/MyPassport3TB/RDM_Distract/CheckerContrastComp_V11/';
addpath(genpath(experimentFolder));
cd(experimentFolder);
% set up experiment
Screen('Preference', 'SkipSyncTests', 1);
oldLevel = Screen('Preference', 'Verbosity', 4); % output debugging info
PsychDebugWindowConfiguration(0,0.3)
subjectsPath = [subj '_' datestr(now, 'dd-mm-yyyy_HH-MM-SS') '/']; mkdir(subjectsPath);
checkerInfo = [];
[checkerInfo] = checkerParameters_170213;
DEBUG = 1; verbosity = 1;
checkerContrastComp_JQK_170213(checkerInfo, subjectsPath, DEBUG, verbosity)
%% run MAT Task (post-CB)
pn.workingFolder = '/Volumes/MyPassport3TB/RDM_Distract/MAT_V2/';
addpath(genpath([pn.workingFolder, 'functions/']));
addpath(genpath([pn.workingFolder, 'dotsx/']));
cd(pn.workingFolder);
Screen('Preference', 'SkipSyncTests', 1);
dotInfo = createDotInfo_JQK_170327;
dotInfo.dataDir = [pn.workingFolder, 'data/'];
cursubj = [subj, '_PostMAT'];
DEBUG = 1; opacity = 1;
dotsExperiment_JQK_170327(dotInfo, cursubj, 0, DEBUG, opacity)
\ No newline at end of file
% timing is fixed according to this vector
% let's also fix coherence for now (e.g. Kelly & O'Connell, 2014)
% 6 of each direction-coherence level
dotInfo.cohLevels = [0.25, 0.35, 0.5, 0.7];
dotInfo.directions = [0 180]; % 1 - left, 2 - right
% TO DO: set random seed
distrib = repmat([1:8],1,6);
tmp_rand = randperm(numel(distrib));
distrib_rand = distrib(tmp_rand);
dotInfo.coh = NaN(1,numel(distrib_rand));
dotInfo.dir = NaN(1,numel(distrib_rand));
for indDis = 1:8
if indDis <= 4
indDir = 1;
indCoh = indDis;
else
indDir = 2;
indCoh = indDis-4;
end;
curDis = find(distrib_rand==indDis);
dotInfo.coh(curDis) = dotInfo.cohLevels(indCoh);
dotInfo.dir(curDis) = dotInfo.directions(indDir);
end;
dotInfo.timeTarget = 1.9; % target time in s
dotInfo.timeNontarget = [3.6, 6.6, 8.4]; % target time in s
tmp = []; tmp2 = [];
for indCoh = 1:numel(dotInfo.coh)
tmp = [tmp, 0, dotInfo.coh(indCoh)];
tmp2 = [tmp2, NaN, dotInfo.dir(indCoh)];
end;
% tmp = [tmp, 0];
% tmp2 = [tmp2, NaN];
dotInfo.coh = tmp;
dotInfo.dir = tmp2;
nonTargets = find(dotInfo.coh == 0);
Targets = find(dotInfo.coh ~= 0);
nontargetDur = repmat([1:3], 1, 16); % create vector for non-target duration
tmp_rand = randperm(numel(nontargetDur));
targetDur_rand = nontargetDur(tmp_rand);
dotInfo.presTime = NaN(1,numel(dotInfo.coh));
dotInfo.presTime(nonTargets) = dotInfo.timeNontarget(targetDur_rand);
dotInfo.presTime(Targets) = dotInfo.timeTarget;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment