You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running this script will show blocks of motion dots and static dots. Motion
15
+
blocks will show:
16
+
17
+
- dots moving in one of four directions (up-, down-, left-, and right-ward) (MT+
18
+
localizer)
19
+
- or dots moving inward and outward in the peripheral of the screen (MT/MST
20
+
localizer).
21
+
29
22
## Requirements
30
23
31
-
Make sure that the following toolboxes are installed and added to the matlab / octave path. See the next section on how to install the submodule toolboxes.
24
+
Make sure that the following toolboxes are installed and added to the matlab /
25
+
octave path. See the next section on how to install the submodule toolboxes.
32
26
33
27
For instructions see the following links:
34
28
@@ -42,129 +36,50 @@ For instructions see the following links:
42
36
43
37
## Installation
44
38
45
-
The CPP_BIDS and CPP_PTB dependencies are already set up as submodule to this repository.
46
-
You can install it all with git by doing.
39
+
The CPP_BIDS and CPP_PTB dependencies are already set up as submodules to this
40
+
repository. You can install it all with git by doing.
Running this script will show blocks of motion dots and static dots. Motion blocks will show dots moving in one of four directions (up-, down-, left-, and right-ward) (MT+ localizer) or dots moving inward and outward in the peripheral of the screen (MT/MST localizer).
57
-
58
-
Run in `Debug mode` (see `setParameters.m`) it does not care about subjID, run n., Eye Tracker (soon, at the moment it needs to be set off manually), etc..
59
-
60
-
Any details of the experiment can be changed in `setParameters.m` (e.g., experiment mode, motion stimuli details, exp. design, etc.)
46
+
## Set up and running
61
47
62
-
### setParameters
48
+
In the `main.m` script, you are meant
63
49
64
-
`setParameters.m` is the core engine of the experiment. It contains the following tweakable sections:
50
+
- to set your configuration (`cfg`)
51
+
- call `initEnv()` to add the relevant folders to the MATLAB path
52
+
- call `cfg = checkParameters(cfg)` to set up any default configuration you did
53
+
not set.
54
+
- call `visualMotionLocalizer(cfg)` to run the localizer.
65
55
66
-
- Debug mode setting
67
-
- MRI settings
68
-
- Engine parameters:
69
-
- Monitor parameters
70
-
- Monitor parameters for PsychToolBox
71
-
- Keyboards
72
-
- Experiment Design
73
-
- Visual Stimulation
74
-
- Task(s)
75
-
- Instructions
76
-
- Task #1 parameters
77
-
78
-
#### Let the scanner pace the experiment
79
-
80
-
Set `cfg.pacedByTriggers.do` to `true` and you can then set all the details in this `if` block
56
+
The minimalist script would thus look like:
81
57
82
58
```matlab
83
-
% Time is here in terms of `repetition time (TR)` (i.e. MRI volumes)
84
-
if cfg.pacedByTriggers.do
59
+
clc;
60
+
clear;
85
61
86
-
cfg.pacedByTriggers.quietMode = true;
87
-
cfg.pacedByTriggers.nbTriggers = 1;
62
+
%% Run MT+ localizer
88
63
89
-
cfg.timing.eventDuration = cfg.mri.repetitionTime / 2 - 0.04; % second
64
+
cfg.design.localizer = 'MT';
65
+
initEnv();
90
66
91
-
% Time between blocs in secs
92
-
cfg.timing.IBI = 0;
93
-
% Time between events in secs
94
-
cfg.timing.ISI = 0;
95
-
% Number of seconds before the motion stimuli are presented
96
-
cfg.timing.onsetDelay = 0;
97
-
% Number of seconds after the end all the stimuli before ending the run
98
-
cfg.timing.endDelay = 2;
67
+
cfg = checkParameters(cfg);
99
68
100
-
end
69
+
% Run
70
+
visualMotionLocalizer(cfg);
101
71
```
102
72
103
-
### subfun/doDotMo
104
-
105
-
Wrapper function that present the dot stimulation (static or motion) per event.
106
-
107
-
#### Input
108
-
109
-
-`cfg`: PTB/machine and experiment configurations returned by `setParameters` and `initPTB`
110
-
-`logFile`: structure that stores the experiment logfile to be saved
111
-
-`thisEvent`: structure that stores information about the event to present regarding the dots (static or motion, direction, etc.)
112
-
-`thisFixation`: structure that stores information about the fixation cross task to present
113
-
-`dots`: [...]
114
-
-`iEvent`: index of the event of the block at the moment of the presentation
115
-
116
-
#### Output
117
-
118
-
- Event `onset`
119
-
- Event `duration`
120
-
-`dots`: [...]
121
-
122
-
> NB: The dots are drawn on a square that contains the round aperture, then any dots outside of the aperture is turned into a NaN so effectively the actual number of dots on the screen at any given time is not the one that you input but a smaller number (nDots / Area of aperture) on average.
123
-
124
-
### subfun/design/expDesign
125
-
126
-
This function and its companions creates the sequence of blocks (static/motion) and the events (the single directions) for MT+ and MT/MST localizers. The conditions are consecutive static and motion blocks (fixed in this order gives better results than randomised).
127
-
128
-
It can be run as a stand alone without inputs and displays a visual example of the possible design. See `getMockConfig` to set up the mock configuration.
129
-
130
-
It computes the directions to display and the task(s), at the moment:
131
-
1. detection of change in the color of the fixation target
132
-
2. detection of different speed of the moving dots [ W I P - if selected as a task it will give the same null output as if not selected ie no difference in speed]
133
-
134
-
#### Events
135
-
136
-
The ``nbEventsPerBlock`` should be a multiple of the number of motion directions requested in ``motionDirections`` (which should be more than 1) e.g.:
137
-
- MT localizer: `cfg.design.motionDirections = [ 0 90 180 270 ]; % right down left up`
1. Directions are all presented in random orders in `numEventsPerBlock/nDirections` consecutive chunks. This evenly distribute the directions across the block.
144
-
2. No same consecutive direction
145
-
146
-
- Color change detection of the fixation cross:
147
-
1. If there are 2 targets per block we make sure that they are at least 2 events apart.
148
-
2. Targets cannot be on the first or last event of a block.
149
-
3. No less than 1 target per event position in the whole run
150
-
151
-
#### Input:
152
-
-`cfg`: parameters returned by setParameters
153
-
-`displayFigs`: a boolean to decide whether to show the basic design matrix of the design
73
+
Type `help checkParameters` and see the [README in docs](./docs/README.md) to
74
+
get more information about the configuration options.
154
75
155
-
#### Output:
156
-
-`cfg.design.blockNames`: cell array (nbBlocks, 1) with the condition name for each block
157
-
-`cfg.design.nbBlocks`: integer for th etotal number of blocks in the run
158
-
-`cfg.design.directions`: array (nbBlocks, nbEventsPerBlock) with the direction to present in a given event of a block.
159
-
- 0 90 180 270 indicate the angle for translational motion direction
160
-
- 666 -666 indicate in/out-ward direction in radial motion
161
-
- -1 indicates static
162
-
-`cfg.design.speeds`: array (nbBlocks, nbEventsPerBlock) indicate the dots speed in each event, the target is represented by a higher/lower value
163
-
-`cfg.design.fixationTargets`: array (nbBlocks, numEventsPerBlock) showing for each event if it should be accompanied by a target
76
+
Run in debug mode (set `cfg.debug.do = true`) it does not care about subjID, run
77
+
n., Eye Tracker...
164
78
165
79
## Contributors ✨
166
80
167
-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
0 commit comments