Skip to content

Commit 1d889f5

Browse files
committed
finish refactoring design
1 parent bc14611 commit 1d889f5

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

setParameters.m

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'output');
1212

1313
%% Debug mode settings
14+
1415
cfg.debug.do = true; % To test the script out of the scanner, skip PTB sync
1516
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
1617
cfg.debug.transpWin = true; % To test with trasparent full size screen
@@ -32,10 +33,14 @@
3233
cfg = setMRI(cfg);
3334

3435
%% Experiment Design
35-
cfg.names = {'static', 'motion'};
36-
cfg.possibleDirections = [-1 1]; % 1 motion , -1 static
37-
cfg.numBlocks = size(cfg.possibleDirections, 2);
38-
cfg.numRepetitions = 1; % AT THE MOMENT IT IS NOT SET IN THE MAIN SCRIPT
36+
37+
cfg.design.names = {'static'; 'motion'};
38+
cfg.design.nbRepetitions = 4;
39+
cfg.design.nbEventsPerBlock = 12; % DO NOT CHANGE
40+
41+
%% Timing
42+
43+
% Time between blocs in secs
3944
cfg.IBI = .5; % 8;
4045
% Time between events in secs
4146
cfg.ISI = 0.5;
@@ -44,18 +49,16 @@
4449
% Number of seconds after the end all the stimuli before ending the run
4550
cfg.endDelay = .1;
4651

47-
%% Visual Stimulation
48-
49-
% Number of events per block (should not be changed)
50-
cfg.numEventsPerBlock = 12;
5152
cfg.eventDuration = 1; % second
53+
54+
%% Visual Stimulation
5255

5356
% Speed in visual angles / second
5457
cfg.dot.speed = 15;
5558
% Coherence Level (0-1)
5659
cfg.dot.coherence = 1;
5760
% Number of dots per visual angle square.
58-
cfg.dot.density = .05;
61+
cfg.dot.density = .1;
5962
% Dot life time in seconds
6063
cfg.dot.lifeTime = 10;
6164
% proportion of dots killed per frame
@@ -89,6 +92,7 @@
8992
cfg.target.duration = 0.05; % In secs
9093

9194
cfg.extraColumns = {'direction', 'speed', 'target', 'event', 'block'};
95+
9296
end
9397

9498
function cfg = setKeyboards(cfg)

subfun/expDesign.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,15 @@
119119
%% Now we do the easy stuff
120120
cfg.design.blockNames = assignConditions(cfg);
121121

122+
cfg.design.nbBlocks = NB_BLOCKS;
123+
122124
cfg = setDirections(cfg);
123-
directions = cfg.design.directions;
124-
directions = directions';
125125

126126
speeds = ones(NB_BLOCKS, NB_EVENTS_PER_BLOCK) * cfg.dot.speedPixPerFrame;
127127
cfg.design.speeds = speeds;
128-
speeds = speeds';
129128

130129
cfg.design.fixationTargets = fixationTargets;
131-
fixationTargets = fixationTargets';
132-
133-
cfg.design.trialList = [directions(:) speeds(:) fixationTargets(:)];
130+
134131

135132
%% Plot
136133
diplayDesign(cfg, displayFigs)

visualLocTanslational.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@
4848

4949
[el] = eyeTracker('Calibration', cfg);
5050

51-
% % % REFACTOR THIS FUNCTION
5251
[cfg] = expDesign(cfg);
53-
% % %
5452

5553
% Prepare for the output logfiles with all
5654
logFile.extraColumns = cfg.extraColumns;
@@ -78,20 +76,20 @@
7876

7977
%% For Each Block
8078

81-
for iBlock = 1:cfg.numBlocks
79+
for iBlock = 1:cfg.design.nbBlocks
8280

8381
fprintf('\n - Running Block %.0f \n', iBlock);
8482

8583
eyeTracker('StartRecording', cfg);
8684

8785
% For each event in the block
88-
for iEvent = 1:cfg.numEventsPerBlock
86+
for iEvent = 1:cfg.design.nbEventsPerBlock
8987

9088
% Check for experiment abortion from operator
9189
checkAbort(cfg, cfg.keyboard.keyboard);
9290

9391
% set direction, speed of that event and if it is a target
94-
thisEvent.trial_type = 'dummy';
92+
thisEvent.trial_type = cfg.design.blockNames{iBlock};
9593
thisEvent.direction = cfg.design.directions(iBlock, iEvent);
9694
thisEvent.speed = cfg.design.speeds(iBlock, iEvent);
9795
thisEvent.target = cfg.design.fixationTargets(iBlock, iEvent);

0 commit comments

Comments
 (0)