66- [ fMRI localizers for visual motion] ( #fmri-localizers-for-visual-motion )
77 - [ Requirements] ( #requirements )
88 - [ Installation] ( #installation )
9- - [ Structure and function details] ( #structure-and-function-details )
10- - [ visualMotionLocalizer] ( #visualmotionlocalizer )
11- - [ setParameters] ( #setparameters )
12- - [ Let the scanner pace the experiment] ( #let-the-scanner-pace-the-experiment )
13- - [ subfun/doDotMo] ( #subfundodotmo )
14- - [ Input] ( #input )
15- - [ Output] ( #output )
16- - [ subfun/design/expDesign] ( #subfundesignexpdesign )
17- - [ Events] ( #events )
18- - [ Pseudorandomization rules:] ( #pseudorandomization-rules )
19- - [ Input:] ( #input-1 )
20- - [ Output:] ( #output-1 )
9+ - [ Set up and running] ( #set-up-and-running )
2110 - [ Contributors ✨] ( #contributors- )
2211
2312# fMRI localizers for visual motion
2413
14+ 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+
2522## Requirements
2623
2724Make sure that the following toolboxes are installed and added to the matlab /
@@ -39,160 +36,45 @@ For instructions see the following links:
3936
4037## Installation
4138
42- The CPP_BIDS and CPP_PTB dependencies are already set up as submodule to this
39+ The CPP_BIDS and CPP_PTB dependencies are already set up as submodules to this
4340repository. You can install it all with git by doing.
4441
4542``` bash
4643git clone --recurse-submodules https://github.com/cpp-lln-lab/localizer_visual_motion.git
4744```
4845
49- ## Structure and function details
50-
51- ### visualMotionLocalizer
52-
53- Running this script will show blocks of motion dots and static dots. Motion
54- blocks will show dots moving in one of four directions (up-, down-, left-, and
55- right-ward) (MT+ localizer) or dots moving inward and outward in the peripheral
56- of the screen (MT/MST localizer).
57-
58- Run in ` Debug mode ` (see ` setParameters.m ` ) it does not care about subjID, run
59- n., Eye Tracker (soon, at the moment it needs to be set off manually), etc..
60-
61- Any details of the experiment can be changed in ` setParameters.m ` (e.g.,
62- experiment mode, motion stimuli details, exp. design, etc.)
46+ ## Set up and running
6347
64- ### setParameters
48+ In the ` main.m ` script, you are meant
6549
66- ` setParameters.m ` is the core engine of the experiment. It contains the
67- 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.
6855
69- - Debug mode setting
70- - MRI settings
71- - Engine parameters:
72- - Monitor parameters
73- - Monitor parameters for PsychToolBox
74- - Keyboards
75- - Experiment Design
76- - Visual Stimulation
77- - Task(s)
78- - Instructions
79- - Task #1 parameters
80-
81- #### Let the scanner pace the experiment
82-
83- Set ` cfg.pacedByTriggers.do ` to ` true ` and you can then set all the details in
84- this ` if ` block
56+ The minimalist script would thus look like:
8557
8658``` matlab
87- % Time is here in terms of `repetition time (TR)` (i.e. MRI volumes)
88- if cfg.pacedByTriggers.do
59+ clc;
60+ clear;
8961
90- cfg.pacedByTriggers.quietMode = true;
91- cfg.pacedByTriggers.nbTriggers = 1;
62+ %% Run MT+ localizer
9263
93- cfg.timing.eventDuration = cfg.mri.repetitionTime / 2 - 0.04; % second
64+ cfg.design.localizer = 'MT';
65+ initEnv();
9466
95- % Time between blocs in secs
96- cfg.timing.IBI = 0;
97- % Time between events in secs
98- cfg.timing.ISI = 0;
99- % Number of seconds before the motion stimuli are presented
100- cfg.timing.onsetDelay = 0;
101- % Number of seconds after the end all the stimuli before ending the run
102- cfg.timing.endDelay = 2;
67+ cfg = checkParameters(cfg);
10368
104- end
69+ % Run
70+ visualMotionLocalizer(cfg);
10571```
10672
107- ### subfun/doDotMo
108-
109- Wrapper function that present the dot stimulation (static or motion) per event.
110-
111- #### Input
112-
113- - ` cfg ` : PTB/machine and experiment configurations returned by ` setParameters `
114- and ` initPTB `
115- - ` logFile ` : structure that stores the experiment logfile to be saved
116- - ` thisEvent ` : structure that stores information about the event to present
117- regarding the dots (static or motion, direction, etc.)
118- - ` thisFixation ` : structure that stores information about the fixation cross
119- task to present
120- - ` dots ` : [ ...]
121- - ` iEvent ` : index of the event of the block at the moment of the presentation
122-
123- #### Output
124-
125- - Event ` onset `
126- - Event ` duration `
127- - ` dots ` : [ ...]
128-
129- > NB: The dots are drawn on a square that contains the round aperture, then any
130- > dots outside of the aperture is turned into a NaN so effectively the actual
131- > number of dots on the screen at any given time is not the one that you input
132- > but a smaller number (nDots / Area of aperture) on average.
133-
134- ### subfun/design/expDesign
135-
136- This function and its companions creates the sequence of blocks (static/motion)
137- and the events (the single directions) for MT+ and MT/MST localizers. The
138- conditions are consecutive static and motion blocks (fixed in this order gives
139- better results than randomised).
140-
141- It can be run as a stand alone without inputs and displays a visual example of
142- the possible design. See ` getMockConfig ` to set up the mock configuration.
143-
144- It computes the directions to display and the task(s), at the moment:
145-
146- 1 . detection of change in the color of the fixation target
147- 2 . detection of different speed of the moving dots [ W I P - if selected as a
148- task it will give the same null output as if not selected ie no difference in
149- speed]
150-
151- #### Events
152-
153- The ` nbEventsPerBlock ` should be a multiple of the number of motion directions
154- requested in ` motionDirections ` (which should be more than 1) e.g.:
155-
156- - MT localizer:
157- ` cfg.design.motionDirections = [ 0 90 180 270 ]; % right down left up `
158- - MT_MST localizer: ` cfg.design.motionDirections = [666 -666]; % outward inward `
159-
160- #### Pseudorandomization rules:
161-
162- - Directions:
163-
164- 1 . Directions are all presented in random orders in
165- ` numEventsPerBlock/nDirections ` consecutive chunks. This evenly distribute
166- the directions across the block.
167- 2 . No same consecutive direction
168-
169- - Color change detection of the fixation cross:
170-
171- 1 . If there are 2 targets per block we make sure that they are at least 2 events
172- apart.
173- 2 . Targets cannot be on the first or last event of a block.
174- 3 . No less than 1 target per event position in the whole run
175-
176- #### Input:
177-
178- - ` cfg ` : parameters returned by setParameters
179- - ` displayFigs ` : a boolean to decide whether to show the basic design matrix of
180- the design
181-
182- #### Output:
73+ Type ` help checkParameters ` and see the [ README in docs] ( ./docs/README.md ) to
74+ get more information about the configuration options.
18375
184- - ` cfg.design.blockNames ` : cell array (nbBlocks, 1) with the condition name for
185- each block
186- - ` cfg.design.nbBlocks ` : integer for th etotal number of blocks in the run
187- - ` cfg.design.directions ` : array (nbBlocks, nbEventsPerBlock) with the direction
188- to present in a given event of a block.
189- - 0 90 180 270 indicate the angle for translational motion direction
190- - 666 -666 indicate in/out-ward direction in radial motion
191- - -1 indicates static
192- - ` cfg.design.speeds ` : array (nbBlocks, nbEventsPerBlock) indicate the dots
193- speed in each event, the target is represented by a higher/lower value
194- - ` cfg.design.fixationTargets ` : array (nbBlocks, numEventsPerBlock) showing for
195- 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...
19678
19779## Contributors ✨
19880
0 commit comments