Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions demos/CPP_getResponseDemo.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
end

fprintf('\n %s was %s at time %.3f seconds\n', ...
responseEvents(iEvent).keyName, ...
eventType, ...
responseEvents(iEvent).onset - startSecs);
responseEvents(iEvent).keyName, ...
eventType, ...
responseEvents(iEvent).onset - startSecs);

end

Expand Down
10 changes: 5 additions & 5 deletions dev/devSandbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@
InitializePsychSound(1);

cfg.audio.pahandle = PsychPortAudio('Open', ...
[], ...
[], ...
[], ...
cfg.audio.fs, ...
cfg.audio.channels);
[], ...
[], ...
[], ...
cfg.audio.fs, ...
cfg.audio.channels);

end
end
Expand Down
2 changes: 1 addition & 1 deletion manualTests/test_getResponse.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

for iEvent = 1:size(responseEvents, 1)
fprintf(' %s was pressed\n ', ...
responseEvents(iEvent).keyName);
responseEvents(iEvent).keyName);

if ~any(strcmp({responseEvents(iEvent).keyName}, cfg.keyboard.responseKey))
errorRestrictedKeysGetReponse();
Expand Down
61 changes: 31 additions & 30 deletions src/aperture/apertureTexture.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
cfg = apertureInit(cfg);

cfg.aperture.texture = Screen('MakeTexture', cfg.screen.win, ...
cfg.color.background(1) * ones(cfg.screen.winRect([3 3])));
cfg.color.background(1) * ...
ones(cfg.screen.winRect([3 3])));

case 'make'

Expand All @@ -29,9 +30,9 @@
end

Screen('DrawTexture', cfg.screen.win, cfg.aperture.texture, ...
cfg.screen.winRect, ...
CenterRect(cfg.screen.winRect * scalingFactor, cfg.screen.winRect), ...
rotationAngle);
cfg.screen.winRect, ...
CenterRect(cfg.screen.winRect * scalingFactor, cfg.screen.winRect), ...
rotationAngle);

end

Expand Down Expand Up @@ -64,8 +65,8 @@
cfg.ring.csFuncFact = ...
1 / ...
((cfg.ring.maxEcc + exp(1)) * ...
log(cfg.ring.maxEcc + exp(1)) - ...
(cfg.ring.maxEcc + exp(1)));
log(cfg.ring.maxEcc + exp(1)) - ...
(cfg.ring.maxEcc + exp(1)));
end

case 'bar'
Expand Down Expand Up @@ -115,8 +116,8 @@
end

Screen('FillOval', cfg.aperture.texture, TRANSPARENT, ...
CenterRectOnPoint([0, 0, repmat(diameter, 1, 2)], ...
xCenter, yCenter));
CenterRectOnPoint([0, 0, repmat(diameter, 1, 2)], ...
xCenter, yCenter));

case 'ring'

Expand All @@ -126,14 +127,14 @@
Screen('Fillrect', cfg.aperture.texture, cfg.color.background);

Screen('FillOval', cfg.aperture.texture, TRANSPARENT, ...
CenterRectOnPoint( ...
[0, 0, repmat(cfg.ring.outerRimPix, 1, 2)], ...
xCenter, yCenter));
CenterRectOnPoint( ...
[0, 0, repmat(cfg.ring.outerRimPix, 1, 2)], ...
xCenter, yCenter));

Screen('FillOval', cfg.aperture.texture, [cfg.color.background 255], ...
CenterRectOnPoint( ...
[0, 0, repmat(cfg.ring.innerRimPix, 1, 2)], ...
xCenter, yCenter));
CenterRectOnPoint( ...
[0, 0, repmat(cfg.ring.innerRimPix, 1, 2)], ...
xCenter, yCenter));

case 'wedge'

Expand All @@ -156,11 +157,11 @@
Screen('Fillrect', cfg.aperture.texture, cfg.color.background);

Screen('FillArc', cfg.aperture.texture, TRANSPARENT, ...
CenterRect( ...
cfg.destinationRect, ...
cfg.screen.winRect), ...
thisEvent.angle, ... % start angle
cfg.aperture.width); % arc angle
CenterRect( ...
cfg.destinationRect, ...
cfg.screen.winRect), ...
thisEvent.angle, ... % start angle
cfg.aperture.width); % arc angle

case 'bar'

Expand All @@ -169,25 +170,25 @@

% We let the stimulus through
Screen('FillOval', cfg.aperture.texture, TRANSPARENT, ...
CenterRect( ...
[0, 0, repmat(cfg.screen.winRect(4), 1, 2)], ...
cfg.screen.winRect));
CenterRect( ...
[0, 0, repmat(cfg.screen.winRect(4), 1, 2)], ...
cfg.screen.winRect));

% Then we add the position of the bar aperture

% which one is the right and which one is the left??

Screen('FillRect', cfg.aperture.texture, cfg.color.background, ...
[0, ...
0, ...
thisEvent.barPosPix - cfg.aperture.barWidthPix / 2, ...
cfg.screen.winRect(4)]);
[0, ...
0, ...
thisEvent.barPosPix - cfg.aperture.barWidthPix / 2, ...
cfg.screen.winRect(4)]);

Screen('FillRect', cfg.aperture.texture, cfg.color.background, ...
[thisEvent.barPosPix + cfg.aperture.barWidthPix / 2, ...
0, ...
cfg.screen.winRect(3), ...
cfg.screen.winRect(4)]);
[thisEvent.barPosPix + cfg.aperture.barWidthPix / 2, ...
0, ...
cfg.screen.winRect(3), ...
cfg.screen.winRect(4)]);

otherwise

Expand Down
2 changes: 1 addition & 1 deletion src/aperture/eccenLogSpeed.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

% near-exp visual angle
newOuterRimVA = ((outerRimVA + exp(1)) * log(outerRimVA + exp(1)) - ...
(outerRimVA + exp(1))) * maxEcc * csFuncFact;
(outerRimVA + exp(1))) * maxEcc * csFuncFact;
outerRimPix = newOuterRimVA * cfg.screen.ppd; % in pixel

% width of apperture changes logarithmically with eccentricity of inner ring
Expand Down
2 changes: 1 addition & 1 deletion src/dot/computeCartCoord.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function cartesianCoordinates = computeCartCoord(positions, cfg)
cartesianCoordinates = ...
[positions(:, 1) + cfg.dot.matrixWidth, ... % x coordinate
positions(:, 2) + cfg.dot.matrixWidth]; % y coordinate
positions(:, 2) + cfg.dot.matrixWidth]; % y coordinate

% cartesianCoordinates = positions;
end
12 changes: 6 additions & 6 deletions src/dot/dotTexture.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

case 'init'
cfg.dot.texture = Screen('MakeTexture', cfg.screen.win, ...
cfg.color.background(1) * ones(cfg.screen.winRect([4 3])));
cfg.color.background(1) * ones(cfg.screen.winRect([4 3])));

case 'make'

dotType = 2;

Screen('FillRect', cfg.dot.texture, cfg.color.background);
Screen('DrawDots', cfg.dot.texture, ...
thisEvent.dot.positions, ...
cfg.dot.sizePix, ...
cfg.dot.color, ...
cfg.screen.center, ...
dotType);
thisEvent.dot.positions, ...
cfg.dot.sizePix, ...
cfg.dot.color, ...
cfg.screen.center, ...
dotType);

case 'draw'

Expand Down
12 changes: 6 additions & 6 deletions src/dot/reseedDots.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
% - has been been picked to be killed

N = any([ ...
dots.positions > cfg.dot.matrixWidth, ...
dots.positions < 0, ...
dots.time > dots.lifeTime, ...
radius - cfg.dot.sizePix < fixationWidthPix / 2, ...
rand(cfg.dot.number, 1) < cfg.dot.proportionKilledPerFrame ...
], 2);
dots.positions > cfg.dot.matrixWidth, ...
dots.positions < 0, ...
dots.time > dots.lifeTime, ...
radius - cfg.dot.sizePix < fixationWidthPix / 2, ...
rand(cfg.dot.number, 1) < cfg.dot.proportionKilledPerFrame ...
], 2);

% If there is any such dot we relocate it to a new random position
% and change its lifetime to 1
Expand Down
12 changes: 6 additions & 6 deletions src/drawFieldOfVIew.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ function drawFieldOfVIew(cfg)
fov = cfg.screen.effectiveFieldOfView;

fov = CenterRect( ...
[0, 0, fov(1), fov(2)], ...
cfg.screen.winRect);
[0, 0, fov(1), fov(2)], ...
cfg.screen.winRect);

Screen('FrameRect', ...
cfg.screen.win, ...
RED, ...
fov, ...
penWidth);
cfg.screen.win, ...
RED, ...
fov, ...
penWidth);
end

end
6 changes: 3 additions & 3 deletions src/errors/errorDistanceToScreen.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function errorDistanceToScreen(cfg)

errorStruct.message = sprintf([
'Distance to monitor seems too small.\n' ...
'It should be in centimeters.\n' ...
'cfg.screen.monitorDistance = %f'], cfg.screen.monitorDistance);
'Distance to monitor seems too small.\n' ...
'It should be in centimeters.\n' ...
'cfg.screen.monitorDistance = %f'], cfg.screen.monitorDistance);

errorStruct.identifier = 'computeFOV:wrongDistanceToScreen';

Expand Down
30 changes: 15 additions & 15 deletions src/eyeTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,21 @@
Eyelink('Command', 'calibration_samples = 6');
Eyelink('Command', 'calibration_sequence = 0,1,2,3,4,5');
Eyelink('Command', 'calibration_targets = %d,%d %d,%d %d,%d %d,%d %d,%d', ...
640, 512, ... % width/2,height/2
640, 102, ... % width/2,height*0.1
640, 614, ... % width/2,height*0.6
128, 341, ... % width*0.1,height*1/3
1152, 341); % width-width*0.1,height*1/3
640, 512, ... % width/2,height/2
640, 102, ... % width/2,height*0.1
640, 614, ... % width/2,height*0.6
128, 341, ... % width*0.1,height*1/3
1152, 341); % width-width*0.1,height*1/3

% Validation target locations
Eyelink('Command', 'validation_samples = 5');
Eyelink('Command', 'validation_sequence = 0,1,2,3,4,5');
Eyelink('Command', 'validation_targets = %d,%d %d,%d %d,%d %d,%d %d,%d', ...
640, 512, ... % width/2,height/2
640, 102, ... % width/2,height*0.1
640, 614, ... % width/2,height*0.6
128, 341, ... % width*0.1,height*1/3
1152, 341); % width-width*0.1,height*1/3
640, 512, ... % width/2,height/2
640, 102, ... % width/2,height*0.1
640, 614, ... % width/2,height*0.6
128, 341, ... % width*0.1,height*1/3
1152, 341); % width-width*0.1,height*1/3

end

Expand Down Expand Up @@ -177,9 +177,9 @@

% Set the edf file path + name.
edfFileName = fullfile( ...
cfg.dir.outputSubject, ...
cfg.fileName.modality, ...
cfg.fileName.eyetracker);
cfg.dir.outputSubject, ...
cfg.fileName.modality, ...
cfg.fileName.eyetracker);

Eyelink('Command', 'set_idle_mode');

Expand All @@ -203,8 +203,8 @@
if exist(edfFileName, 'file') == 2

fprintf('Data file ''%s'' can be found in ''%s''\n', ...
cfg.fileName.eyetracker, ...
fullfile(cfg.dir.outputSubject, 'eyetracker'));
cfg.fileName.eyetracker, ...
fullfile(cfg.dir.outputSubject, 'eyetracker'));

end

Expand Down
Loading