diff --git a/README.md b/README.md index e665d8a..fda12ab 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,17 @@ For instructions see the following links: | [CPP_BIDS](https://github.com/cpp-lln-lab/CPP_BIDS) | ? | | [CPP_PTB](https://github.com/cpp-lln-lab/CPP_PTB) | ? | | [PsychToolBox](http://psychtoolbox.org/) | >=3.0.14 | -| [Matlab](https://www.mathworks.com/products/matlab.html) | >=2017 | +| [Matlab](https://www.mathworks.com/products/matlab.html) | >=2017 | | or [octave](https://www.gnu.org/software/octave/) | >=4.? | ## Installation -git clone --recurse-submodules https://github.com/Remi-Gau/repo_with_submod.git -cd repo_with_submod/ -git submodule update --remote +The CPP_BIDS and CPP_PTB dependencies are already set up as submodule to this repository. +You can install it all with git by doing. + +```bash +git clone --recurse-submodules https://github.com/cpp-lln-lab/localizer_visual_motion.git +``` ## Structure and function details diff --git a/lib/CPP_PTB b/lib/CPP_PTB index 197c4d4..46f990f 160000 --- a/lib/CPP_PTB +++ b/lib/CPP_PTB @@ -1 +1 @@ -Subproject commit 197c4d4ce68da1c40d0f5f504e509582301e3087 +Subproject commit 46f990f18fe320984f71ae6ec1b02c12f604ad40 diff --git a/setParameters.m b/setParameters.m index e7f93d7..93aa334 100644 --- a/setParameters.m +++ b/setParameters.m @@ -55,8 +55,8 @@ % Coherence Level (0-1) cfg.dot.coherence = 1; % nb dots per visual angle square. - cfg.dot.density = .25; - + cfg.dot.density = .25; + % Dot life time in seconds cfg.dot.lifeTime = 10; @@ -70,7 +70,7 @@ % Diameter/length of side of aperture in Visual angles cfg.aperture.type = 'circle'; cfg.aperture.width = []; % if left empty it will take the screen height - cfg.aperture.xPos = -30; + cfg.aperture.xPos = 0; %% Task(s) @@ -85,7 +85,7 @@ cfg.fixation.color = cfg.color.white; cfg.fixation.width = 1; cfg.fixation.lineWidthPix = 2; - cfg.fixation.xDisplacement = 30; + cfg.fixation.xDisplacement = 0; cfg.fixation.yDisplacement = 0; cfg.target.maxNbPerBlock = 2; diff --git a/subfun/doDotMo.m b/subfun/doDotMo.m index 6223e1e..1ba4ce3 100644 --- a/subfun/doDotMo.m +++ b/subfun/doDotMo.m @@ -13,39 +13,39 @@ % The dots are drawn on a square with a width equals to the width of the % screen % We then draw an aperture on top to hide the certain dots. - + %% Get parameters - + dots = initializeDots(cfg, thisEvent); - + % Set for how many frames this event will last framesLeft = floor(cfg.eventDuration / cfg.screen.ifi); - + %% Start the dots presentation vbl = Screen('Flip', cfg.screen.win); onset = vbl; - + while framesLeft - + [dots] = updateDots(dots, cfg); - + %% Center the dots % We assumed that zero is at the top left, but we want it to be % in the center, so shift the dots up and left, which just means % adding half of the screen width in pixel to both the x and y direction. thisEvent.dot.positions = (dots.positions - cfg.screen.winWidth / 2)'; - + %% make textures dotTexture('make', cfg, thisEvent); - + apertureTexture('make', cfg, thisEvent); - + %% draw evetything and flip screen - + dotTexture('draw', cfg, thisEvent); - + apertureTexture('draw', cfg, thisEvent); - + % If this frame shows a target we change the color thisFixation.fixation = cfg.fixation; thisFixation.screen = cfg.screen; @@ -53,26 +53,26 @@ thisFixation.fixation.color = cfg.fixation.colorTarget; end drawFixation(thisFixation); - + Screen('DrawingFinished', cfg.screen.win); - + vbl = Screen('Flip', cfg.screen.win, vbl + cfg.screen.ifi); - + %% Update counters - + % Check for end of loop framesLeft = framesLeft - 1; - + end - + %% Erase last dots - + drawFixation(cfg); - + Screen('DrawingFinished', cfg.screen.win); - + vbl = Screen('Flip', cfg.screen.win, vbl + cfg.screen.ifi); - + duration = vbl - onset; - + end diff --git a/subfun/expDesign.m b/subfun/expDesign.m index c7c5c6c..2d77451 100644 --- a/subfun/expDesign.m +++ b/subfun/expDesign.m @@ -39,7 +39,7 @@ % Set directions for static and motion condition motionDirections = [0 90 180 270]; staticDirections = [0 90 180 270]; -% staticDirections = [-1 -1 -1 -1]; + % staticDirections = [-1 -1 -1 -1]; %% Check inputs diff --git a/visualLocTanslational.m b/visualLocTanslational.m index 4012f09..e14fd4c 100644 --- a/visualLocTanslational.m +++ b/visualLocTanslational.m @@ -36,12 +36,12 @@ % Convert some values from degrees to pixels cfg.dot = degToPix('size', cfg.dot, cfg); cfg.dot = degToPix('speed', cfg.dot, cfg); - + % Get dot speeds in pixels per frame cfg.dot.speedPixPerFrame = cfg.dot.speedPix / cfg.screen.monitorRefresh; - + cfg.aperture = degToPix('xPos', cfg.aperture, cfg); - + % dots are displayed on a square with a length in visual angle equal to the % field of view cfg.dot.number = round(cfg.dot.density * (cfg.screen.winWidth / cfg.screen.ppd)^2); @@ -55,15 +55,15 @@ % Prepare for the output logfiles with all logFile.extraColumns = cfg.extraColumns; logFile = saveEventsFile('open', cfg, logFile); - + % prepare textures cfg = apertureTexture('init', cfg); cfg = dotTexture('init', cfg); - + disp(cfg); - + standByScreen(cfg); - + % prepare the KbQueue to collect responses getResponse('init', cfg.keyboard.responseBox, cfg); getResponse('start', cfg.keyboard.responseBox); @@ -148,7 +148,7 @@ WaitSecs(cfg.endDelay); cfg = getExperimentEnd(cfg); - + % Close the logfiles saveEventsFile('close', cfg, logFile); @@ -166,7 +166,7 @@ else save(matFile, '-v7.3'); end - + farewellScreen(cfg); cleanUp();