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
16 changes: 8 additions & 8 deletions src/aperture/apertureTexture.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
% Draw aperture and we rotate to match the required condition
Screen('DrawTexture', cfg.screen.win, cfg.aperture.texture, ...
cfg.screen.winRect, ...
CenterRect(...
CenterRect( ...
cfg.screen.winRect * cfg.magnify.scalingFactor, ...
cfg.screen.winRect), ...
thisEvent.condition - 90);
Expand Down Expand Up @@ -154,18 +154,18 @@
cfg.ring.maxEcc = ...
cfg.screen.FOV / 2 + ...
cfg.aperture.width + ...
log(cfg.screen.FOV / 2 + 1) ;
log(cfg.screen.FOV / 2 + 1);
% ring.CsFuncFact is used to expand with log increasing speed so
% that ring is at ring.maxEcc at end of cycle
cfg.ring.csFuncFact = ...
1 / ...
((cfg.ring.maxEcc + exp(1)) * ...
log(cfg.ring.maxEcc + exp(1)) - ...
(cfg.ring.maxEcc + exp(1))) ;
(cfg.ring.maxEcc + exp(1)));
end

case 'bar'

extraPositons = 0;
if cfg.magnify.do
% we add some extra bar positions that we remove afterwards to
Expand All @@ -175,18 +175,18 @@

% Set parameters drifting bars
cfg.aperture.barWidthPix = cfg.stimRect(3) / (cfg.volsPerCycle + extraPositons);

barPosPix = ...
[0:cfg.aperture.barWidthPix:cfg.stimRect(3) - cfg.aperture.barWidthPix] + ...
(cfg.screen.winRect(3) / 2 - cfg.stimRect(3) / 2) + ...
cfg.aperture.barWidthPix / 2; %#ok<NBRAK>

% Those positions are removed because they are actually outside of
% the screen when magnification (fit to windows width) is on
if cfg.magnify.do
barPosPix([1:6, end-5:end]) = [];
barPosPix([1:6, end - 5:end]) = [];
end

cfg.aperture.barPosPix = barPosPix;

% Width of bar in degrees of VA (needed for saving)
Expand Down
2 changes: 1 addition & 1 deletion src/checkPtbVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function checkPtbVersion()
if any([ ...
versionStruc.major < PTB.major, ...
versionStruc.minor < PTB.minor, ...
versionStruc.point < PTB.point, ...
versionStruc.point < PTB.point ...
])

str = sprintf('%s %i.%i.%i %s.\n%s', ...
Expand Down
2 changes: 1 addition & 1 deletion src/degToPix.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
deg = getfield(structure, fieldName); %#ok<GFLD>

structure = setfield(structure, [fieldName 'Pix'], ...
floor(deg * cfg.screen.ppd)) ; %#ok<SFLD>
floor(deg * cfg.screen.ppd)); %#ok<SFLD>

end
4 changes: 2 additions & 2 deletions src/dot/reseedDots.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
dots.positions < 0, ...
dots.time > dots.lifeTime, ...
radius - cfg.dot.sizePix < fixationWidthPix / 2, ...
rand(cfg.dot.number, 1) < cfg.dot.proportionKilledPerFrame, ...
], 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
7 changes: 6 additions & 1 deletion src/printCreditsCppPtb.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
function printCreditsCppPtb()

version = '0.0.1';
try
version = fileread(fullfile(fileparts(mfilename('fullpath')), ...
'..', '..', 'version.txt'));
catch
version = 'v1.0.0';
end

contributors = { ...
'Rémi Gau', ...
Expand Down
2 changes: 1 addition & 1 deletion src/waitForTrigger.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function waitForTrigger(varargin)

if strcmp(KbName(keyCode), cfg.mri.triggerKey)

triggerCounter = triggerCounter + 1 ;
triggerCounter = triggerCounter + 1;

msg = sprintf(' Trigger %i', triggerCounter);

Expand Down
2 changes: 1 addition & 1 deletion tests/test_reseedDots.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function test_reseedDotsBasic()

dots.time = [ ...
6; ... OK
4 ; ... OK
4; ... OK
56; ... OK
300; ... % exceeded its life time
50]; % OK
Expand Down
13 changes: 13 additions & 0 deletions tests/test_utils.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function test_suite = test_utils %#ok<*STOUT>
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
test_functions = localfunctions(); %#ok<*NASGU>
catch % no problem; early Matlab versions can use initTestSuite fine
end
initTestSuite;
end

function test_utilsBasic()

printCreditsCppPtb();

end
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.0.0