Skip to content

Commit 87e4bd4

Browse files
committed
update after set up in liege
1 parent 6f43b87 commit 87e4bd4

File tree

5 files changed

+42
-30
lines changed

5 files changed

+42
-30
lines changed

initEnv.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
function initEnv
1616

1717
octaveVersion = '4.0.3';
18-
matlabVersion = '9.1.0';
18+
matlabVersion = '8.6.0';
1919

2020
if isOctave
2121

@@ -88,7 +88,7 @@ function addDependencies()
8888
pth = fileparts(mfilename('fullpath'));
8989
addpath(genpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src')));
9090
addpath(fullfile(pth, 'lib', 'CPP_PTB'));
91-
addpath(genpath(fullfile(pth, 'lib', 'CPP_PTB', 'src')));
91+
% addpath(genpath(fullfile(pth, 'lib', 'CPP_PTB', 'src')));
9292
addpath(fullfile(pth, 'subfun'));
9393

9494
end

lib/CPP_PTB

setParameters.m

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212

1313
%% Debug mode settings
1414

15-
cfg.debug.do = true; % To test the script out of the scanner, skip PTB sync
15+
cfg.debug.do = false; % To test the script out of the scanner, skip PTB sync
1616
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
17-
cfg.debug.transpWin = true; % To test with trasparent full size screen
17+
cfg.debug.transpWin = false; % To test with trasparent full size screen
1818

1919
cfg.verbose = false;
2020

2121
%% Engine parameters
2222

23-
cfg.testingDevice = 'pc';
24-
cfg.eyeTracker.do = false;
23+
cfg.testingDevice = 'mri';
24+
cfg.eyeTracker.do = true;
2525
cfg.audio.do = false;
2626

2727
cfg = setMonitor(cfg);
@@ -38,7 +38,7 @@
3838
% cfg.design.motionType = 'radial';
3939
cfg.design.motionType = 'translation';
4040
cfg.design.names = {'static'; 'motion'};
41-
cfg.design.nbRepetitions = 4;
41+
cfg.design.nbRepetitions = 10;
4242
cfg.design.nbEventsPerBlock = 12; % DO NOT CHANGE
4343

4444
%% Timing
@@ -50,15 +50,15 @@
5050
% block length = (cfg.eventDuration + cfg.ISI) * cfg.design.nbEventsPerBlock
5151

5252
% Time between blocs in secs
53-
cfg.timing.IBI = 1.8 * 3; % 8;
53+
cfg.timing.IBI = 1.8;
5454
% Time between events in secs
55-
cfg.timing.ISI = 0.1;
55+
cfg.timing.ISI = 0;
5656
% Number of seconds before the motion stimuli are presented
57-
cfg.timing.onsetDelay = .1;
57+
cfg.timing.onsetDelay = 0;
5858
% Number of seconds after the end all the stimuli before ending the run
59-
cfg.timing.endDelay = .1;
59+
cfg.timing.endDelay = 3.6;
6060

61-
cfg.timing.eventDuration = 0.8; % second
61+
cfg.timing.eventDuration = 0.9; % second
6262

6363
%% Visual Stimulation
6464

@@ -67,17 +67,17 @@
6767
% Coherence Level (0-1)
6868
cfg.dot.coherence = 1;
6969
% Number of dots per visual angle square.
70-
cfg.dot.density = .1;
70+
cfg.dot.density = 1;
7171
% Dot life time in seconds
7272
cfg.dot.lifeTime = 10;
7373
% proportion of dots killed per frame
7474
cfg.dot.proportionKilledPerFrame = 0;
7575
% Dot Size (dot width) in visual angles.
76-
cfg.dot.size = 1;
76+
cfg.dot.size = .2;
7777
cfg.dot.color = cfg.color.white;
7878

7979
% Diameter/length of side of aperture in Visual angles
80-
cfg.aperture.type = 'circle';
80+
cfg.aperture.type = 'none';
8181
cfg.aperture.width = []; % if left empty it will take the screen height
8282
cfg.aperture.xPos = 0;
8383

@@ -92,12 +92,12 @@
9292
cfg.fixation.type = 'cross';
9393
cfg.fixation.colorTarget = cfg.color.red;
9494
cfg.fixation.color = cfg.color.white;
95-
cfg.fixation.width = 1;
96-
cfg.fixation.lineWidthPix = 2;
95+
cfg.fixation.width = .5;
96+
cfg.fixation.lineWidthPix = 3;
9797
cfg.fixation.xDisplacement = 0;
9898
cfg.fixation.yDisplacement = 0;
9999

100-
cfg.target.maxNbPerBlock = 2;
100+
cfg.target.maxNbPerBlock = 1;
101101
cfg.target.duration = 0.05; % In secs
102102

103103
cfg.extraColumns = {'direction', 'speed', 'target', 'event', 'block', 'keyName'};
@@ -106,7 +106,10 @@
106106

107107
function cfg = setKeyboards(cfg)
108108
cfg.keyboard.escapeKey = 'ESCAPE';
109-
cfg.keyboard.responseKey = {'space', 't'};
109+
cfg.keyboard.responseKey = {...
110+
'r', 'g', 'y', 'b', ...
111+
'd', 'n', 'z', 'e', ...
112+
't'}; %dnze rgyb
110113
cfg.keyboard.keyboard = [];
111114
cfg.keyboard.responseBox = [];
112115

@@ -119,7 +122,7 @@
119122
function cfg = setMRI(cfg)
120123
% letter sent by the trigger to sync stimulation and volume acquisition
121124
cfg.mri.triggerKey = 't';
122-
cfg.mri.triggerNb = 4;
125+
cfg.mri.triggerNb = 0;
123126

124127
cfg.mri.repetitionTime = 1.8;
125128

@@ -143,7 +146,7 @@
143146
cfg.screen.monitorDistance = 40; % distance from the screen in cm
144147

145148
if strcmpi(cfg.testingDevice, 'mri')
146-
cfg.screen.monitorWidth = 50;
147-
cfg.screen.monitorDistance = 40;
149+
cfg.screen.monitorWidth = 25;
150+
cfg.screen.monitorDistance = 95;
148151
end
149152
end

subfun/expDesign.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@
5858
% Set variables here for a dummy test of this function
5959
if nargin < 1 || isempty(cfg)
6060
% cfg.design.motionType = 'translation';
61-
cfg.design.motionType = 'radial';
61+
cfg.design.motionType = 'translation';
6262
cfg.design.names = {'static'; 'motion'};
63-
cfg.design.nbRepetitions = 4;
63+
cfg.design.nbRepetitions = 10;
6464
cfg.design.nbEventsPerBlock = 12;
6565
cfg.dot.speedPixPerFrame = 4;
66-
cfg.target.maxNbPerBlock = 2;
66+
cfg.target.maxNbPerBlock = 1;
6767
displayFigs = 1;
6868
end
69+
70+
fprintf('\n\nCreating design.\n\n')
6971

7072
[NB_BLOCKS, NB_REPETITIONS, NB_EVENTS_PER_BLOCK, MAX_TARGET_PER_BLOCK] = getInput(cfg);
7173
[~, STATIC_INDEX, MOTION_INDEX] = assignConditions(cfg);
@@ -104,7 +106,7 @@
104106

105107
targetDifference = 0;
106108

107-
while any(targetDifference <= 2)
109+
while abs(targetDifference) <= 2
108110
chosenTarget = randsample(2:NB_EVENTS_PER_BLOCK - 1, tmpTarget, false);
109111
targetDifference = diff(chosenTarget);
110112
end
@@ -192,7 +194,7 @@
192194

193195
switch cfg.design.motionType
194196
case 'translation'
195-
MOTION_DIRECTIONS = [0 90 180 270];
197+
MOTION_DIRECTIONS = [0 0 180 180];
196198
case 'radial'
197199
STATIC_DIRECTIONS = [666 -666 666 -666];
198200
MOTION_DIRECTIONS = [666 -666 666 -666];

visualLocTranslational.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
%% Init the experiment
3434
[cfg] = initPTB(cfg);
3535

36-
cfg.dot.matrixWidth = cfg.screen.winHeight;
36+
cfg.dot.matrixWidth = cfg.screen.winWidth;
3737

3838
% Convert some values from degrees to pixels
3939
cfg.dot = degToPix('size', cfg.dot, cfg);
@@ -107,7 +107,14 @@
107107
thisEvent.keyName = 'n/a';
108108
thisEvent.duration = duration;
109109
thisEvent.onset = onset - cfg.experimentStart;
110-
110+
111+
% % this value should be in degrees / second in the log file
112+
% % highlights that the way speed is passed around could be
113+
% % simplified.
114+
% %
115+
% thisEvent.speed
116+
% %
117+
111118
% Save the events txt logfile
112119
% we save event by event so we clear this variable every loop
113120
thisEvent.fileID = logFile.fileID;

0 commit comments

Comments
 (0)