diff --git a/src/aperture/apertureTexture.m b/src/aperture/apertureTexture.m index 80078dd..001010f 100644 --- a/src/aperture/apertureTexture.m +++ b/src/aperture/apertureTexture.m @@ -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); @@ -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 @@ -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 - + % 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) diff --git a/src/checkPtbVersion.m b/src/checkPtbVersion.m index 45904d2..7a42ab7 100644 --- a/src/checkPtbVersion.m +++ b/src/checkPtbVersion.m @@ -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', ... diff --git a/src/degToPix.m b/src/degToPix.m index 367d07a..90d6072 100644 --- a/src/degToPix.m +++ b/src/degToPix.m @@ -8,6 +8,6 @@ deg = getfield(structure, fieldName); %#ok structure = setfield(structure, [fieldName 'Pix'], ... - floor(deg * cfg.screen.ppd)) ; %#ok + floor(deg * cfg.screen.ppd)); %#ok end diff --git a/src/dot/reseedDots.m b/src/dot/reseedDots.m index 19dfa5e..b6bd6e7 100644 --- a/src/dot/reseedDots.m +++ b/src/dot/reseedDots.m @@ -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 diff --git a/src/printCreditsCppPtb.m b/src/printCreditsCppPtb.m index 97a4021..e39e0ac 100644 --- a/src/printCreditsCppPtb.m +++ b/src/printCreditsCppPtb.m @@ -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', ... diff --git a/src/waitForTrigger.m b/src/waitForTrigger.m index 061b326..c80d1cd 100644 --- a/src/waitForTrigger.m +++ b/src/waitForTrigger.m @@ -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); diff --git a/tests/test_reseedDots.m b/tests/test_reseedDots.m index a291dde..ae7c5b6 100644 --- a/tests/test_reseedDots.m +++ b/tests/test_reseedDots.m @@ -34,7 +34,7 @@ function test_reseedDotsBasic() dots.time = [ ... 6; ... OK - 4 ; ... OK + 4; ... OK 56; ... OK 300; ... % exceeded its life time 50]; % OK diff --git a/tests/test_utils.m b/tests/test_utils.m new file mode 100644 index 0000000..22ac268 --- /dev/null +++ b/tests/test_utils.m @@ -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 diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..60453e6 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +v1.0.0 \ No newline at end of file