diff --git a/README.md b/README.md index b38f56c..44a5abf 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,31 @@ Any details of the experiment can be changed in `setParameters.m` (e.g., experim - Instructions - Task #1 parameters +#### Let the scanner pace the experiment + +Set `cfg.pacedByTriggers.do` to `true` and you can then set all the details in this `if` block + +```matlab +% Time is here in in terms of number repetition time (i.e MRI volumes) +if cfg.pacedByTriggers.do + + cfg.pacedByTriggers.quietMode = true; + cfg.pacedByTriggers.nbTriggers = 1; + + cfg.timing.eventDuration = cfg.mri.repetitionTime / 2 - 0.04; % second + + % Time between blocs in secs + cfg.timing.IBI = 0; + % Time between events in secs + cfg.timing.ISI = 0; + % Number of seconds before the motion stimuli are presented + cfg.timing.onsetDelay = 0; + % Number of seconds after the end all the stimuli before ending the run + cfg.timing.endDelay = 2; + +end +``` + ### 3.3. subfun/doDotMo #### 3.3.1. Input: diff --git a/lib/CPP_PTB b/lib/CPP_PTB index cf1d8d2..e7be247 160000 --- a/lib/CPP_PTB +++ b/lib/CPP_PTB @@ -1 +1 @@ -Subproject commit cf1d8d2740cfe668f994ed0ad9664bb905ca9c2e +Subproject commit e7be247a039cfe5ed95122d5045328f770023935 diff --git a/subfun/postInitializationSetup.m b/subfun/postInitializationSetup.m new file mode 100644 index 0000000..1bbaa4e --- /dev/null +++ b/subfun/postInitializationSetup.m @@ -0,0 +1,27 @@ +function varargout = postInitializationSetup(varargin) + % varargout = postInitializatinSetup(varargin) + + % generic function to finalize some set up after psychtoolbox has been + % initialized + + cfg = deal(varargin{:}); + + cfg.dot.matrixWidth = cfg.screen.winWidth; + + % 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.dot.matrixWidth / cfg.screen.ppd)^2); + + varargout = cfg; + +end diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..95e94cd --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +v0.0.1 \ No newline at end of file diff --git a/visualLocTranslational.m b/visualLocTranslational.m index 984979a..0951228 100644 --- a/visualLocTranslational.m +++ b/visualLocTranslational.m @@ -33,21 +33,7 @@ %% Init the experiment [cfg] = initPTB(cfg); - cfg.dot.matrixWidth = cfg.screen.winWidth; - - % 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.dot.matrixWidth / cfg.screen.ppd)^2); + cfg = postInitializationSetup(cfg); [el] = eyeTracker('Calibration', cfg);