From e96dc7dfc6f3cd46c41ab5dab8aba612d03fd507 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 8 Sep 2020 14:04:56 +0200 Subject: [PATCH 1/4] update README --- README.md | 25 +++++++++++++++++++++++++ lib/CPP_PTB | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) 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 From acda14a6a5f8e214bc0809a7a8c3f0dc9f0cfecc Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 8 Sep 2020 14:06:10 +0200 Subject: [PATCH 2/4] add version.txt --- version.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 version.txt 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 From 23199f888fd2b50d089f3af0c84528bdcc21cc0d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 9 Sep 2020 11:37:05 +0200 Subject: [PATCH 3/4] create a post-initialization function - this is where we set all the parameters that can not be set up till we PTB returns some info about the system --- subfun/postInitializationSetup.m | 27 +++++++++++++++++++++++++++ visualLocTranslational.m | 16 +--------------- 2 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 subfun/postInitializationSetup.m diff --git a/subfun/postInitializationSetup.m b/subfun/postInitializationSetup.m new file mode 100644 index 0000000..b07a44d --- /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 \ 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); From 87c3c04f57df9cfb07fb35e25cc7b1efd9d80d4d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 9 Sep 2020 11:45:37 +0200 Subject: [PATCH 4/4] mh fix --- subfun/postInitializationSetup.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/subfun/postInitializationSetup.m b/subfun/postInitializationSetup.m index b07a44d..1bbaa4e 100644 --- a/subfun/postInitializationSetup.m +++ b/subfun/postInitializationSetup.m @@ -1,27 +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 \ No newline at end of file + +end