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
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. <a name='subfundoDotMo'></a>subfun/doDotMo

#### 3.3.1. <a name='Input:'></a>Input:
Expand Down
2 changes: 1 addition & 1 deletion lib/CPP_PTB
27 changes: 27 additions & 0 deletions subfun/postInitializationSetup.m
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.0.1
16 changes: 1 addition & 15 deletions visualLocTranslational.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down