Skip to content

Commit d433b37

Browse files
committed
fix CI and mh
1 parent f9fae5e commit d433b37

File tree

5 files changed

+74
-40
lines changed

5 files changed

+74
-40
lines changed

README.md

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
1+
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/localizer_auditory_motion/actions)
2+
![](https://github.com/cpp-lln-lab/localizer_auditory_motion/workflows/CI/badge.svg)
3+
4+
[![codecov](https://codecov.io/gh/cpp-lln-lab/localizer_auditory_motion/branch/master/graph/badge.svg)](https://codecov.io/gh/cpp-lln-lab/localizer_auditory_motion)
5+
6+
[![Build Status](https://travis-ci.com/cpp-lln-lab/localizer_auditory_motion.svg?branch=master)](https://travis-ci.com/cpp-lln-lab/localizer_auditory_motion)
7+
8+
19
# Auditory Translational Motion
210

3-
## Requirements
11+
<!-- vscode-markdown-toc -->
12+
13+
- 1. [Requirements](#Requirements)
14+
- 2. [Installation](#Installation)
15+
- 3. [Structure and function details](#Structureandfunctiondetails)
16+
_ 3.1. [audioLocTranslational](#audioLocTranslational)
17+
_ 3.2. [setParameters](#setParameters)
18+
_ 3.3. [subfun/expDesign](#subfunexpDesign)
19+
_ 3.3.1. [EVENTS](#EVENTS)
20+
_ 3.3.2. [TARGETS:](#TARGETS:)
21+
_ 3.3.3. [Input:](#Input:)
22+
_ 3.3.4. [Output:](#Output:)
23+
_ 3.4. [subfun/eyeTracker](#subfuneyeTracker) \* 3.5. [subfun/wait4Trigger](#subfunwait4Trigger)
24+
25+
<!-- vscode-markdown-toc-config
26+
numbering=true
27+
autoSave=true
28+
/vscode-markdown-toc-config -->
29+
<!-- /vscode-markdown-toc -->
30+
31+
## 1. <a name='Requirements'></a>Requirements
432

533
Make sure that the following toolboxes are installed and added to the matlab / octave path.
634

735
For instructions see the following links:
836

937
| Requirements | Used version |
10-
|----------------------------------------------------------|--------------|
38+
| -------------------------------------------------------- | ------------ |
1139
| [PsychToolBox](http://psychtoolbox.org/) | >=3.0.14 |
1240
| [Matlab](https://www.mathworks.com/products/matlab.html) | >=2017b |
1341
| or [octave](https://www.gnu.org/software/octave/) | >=4.? |
1442

15-
## Installation
43+
## 2. <a name='Installation'></a>Installation
1644

1745
The CPP_BIDS and CPP_PTB dependencies are already set up as submodule to this repository.
1846
You can install it all with git by doing.
@@ -21,18 +49,17 @@ You can install it all with git by doing.
2149
git clone --recurse-submodules https://github.com/cpp-lln-lab/localizer_auditory_motion.git
2250
```
2351

24-
## Structure and function details
25-
52+
## 3. <a name='Structureandfunctiondetails'></a>Structure and function details
2653

27-
### audioLocTranslational
54+
### 3.1. <a name='audioLocTranslational'></a>audioLocTranslational
2855

2956
Running this script will play blocks of motion/static sounds. Motion blocks will play sounds moving in one of four directions (up-, down-, left-, and right-ward)
3057

3158
By default it is run in `Debug mode` meaning that it does not care about subjID, run n., fMRI triggers, Eye Tracker, etc..
3259

3360
Any details of the experiment can be changed in `setParameters.m` (e.g., experiment mode, motion stimuli details, exp. design, etc.)
3461

35-
### setParameters
62+
### 3.2. <a name='setParameters'></a>setParameters
3663

3764
`setParameters.m` is the core engine of the experiment. It contains the following tweakable sections:
3865

@@ -49,30 +76,37 @@ Any details of the experiment can be changed in `setParameters.m` (e.g., experim
4976
- Instructions
5077
- Task #1 parameters
5178

52-
### subfun/expDesign
79+
### 3.3. <a name='subfunexpDesign'></a>subfun/expDesign
80+
5381
Creates the sequence of blocks and the events in them. The conditions are consecutive static and motion blocks (Gives better results than randomised). It can be run as a stand alone without inputs to display a visual example of a possible design.
5482

55-
#### EVENTS
83+
#### 3.3.1. <a name='EVENTS'></a>EVENTS
84+
5685
The `numEventsPerBlock` should be a multiple of the number of "base" listed in the `motionDirections` and `staticDirections` (4 at the moment).
5786

58-
#### TARGETS:
87+
#### 3.3.2. <a name='TARGETS:'></a>TARGETS:
88+
5989
- If there are 2 targets per block we make sure that they are at least 2 events apart.
6090
- Targets cannot be on the first or last event of a block
6191

62-
#### Input:
92+
#### 3.3.3. <a name='Input:'></a>Input:
93+
6394
- `expParameters`: parameters returned by `setParameters`
6495
- `displayFigs`: a boolean to decide whether to show the basic design matrix of the design
6596

66-
#### Output:
97+
#### 3.3.4. <a name='Output:'></a>Output:
98+
6799
- `expParameters.designBlockNames` is a cell array `(nr_blocks, 1)` with the name for each block
68100
- `expParameters.designDirections` is an array `(nr_blocks, numEventsPerBlock)` with the direction to present in a given block
69101
- `0 90 180 270` indicate the angle
70102
- `-1` indicates static
71103
- `expParameters.designSpeeds` is an array `(nr_blocks, numEventsPerBlock) * speedEvent`
72104
- `expParameters.designFixationTargets` is an array `(nr_blocks, numEventsPerBlock)` showing for each event if it should be accompanied by a target
73105

74-
### subfun/eyeTracker
106+
### 3.4. <a name='subfuneyeTracker'></a>subfun/eyeTracker
107+
75108
Eyetracker script, still to be debugged. Will probably moved in the CPP_PTB package. It deals with the calibration (dufault or custom), eye movements recording and saving the files.
76109

77-
### subfun/wait4Trigger
110+
### 3.5. <a name='subfunwait4Trigger'></a>subfun/wait4Trigger
111+
78112
Simple functions that counts the triggers sent by the MRI computer to the stimulation computer to sync brain volume recordings and stimulation.

audioLocTranslational.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
[cfg] = initPTB(cfg);
4141

4242
[el] = eyeTracker('Calibration', cfg);
43-
43+
4444
[cfg] = expDesign(cfg);
4545

4646
% Prepare for the output logfiles with all
4747
logFile.extraColumns = cfg.extraColumns;
4848
logFile = saveEventsFile('open', cfg, logFile);
4949

50-
% disp(cfg);
50+
% disp(cfg);
5151

5252
% Show experiment instruction
5353
standByScreen(cfg);
@@ -84,7 +84,7 @@
8484
thisEvent.direction = cfg.design.directions(iBlock, iEvent);
8585
% thisEvent.speed = cfg.design.speeds(iBlock, iEvent);
8686
thisEvent.target = cfg.design.fixationTargets(iBlock, iEvent);
87-
87+
8888
% we wait for a trigger every 2 events
8989
if cfg.pacedByTriggers.do && mod(iEvent, 2) == 1
9090
waitForTrigger( ...

setParameters.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
% MRI settings
3333
cfg = setMRI(cfg);
34-
34+
3535
cfg.pacedByTriggers.do = true;
3636

3737
%% Experiment Design
@@ -41,7 +41,7 @@
4141
cfg.design.motionType = 'translation';
4242
cfg.design.names = {'static'; 'motion'};
4343
cfg.design.motionDirections = [-1 -1 1 1];
44-
cfg.design.nbRepetitions = 14;
44+
cfg.design.nbRepetitions = 14;
4545
cfg.design.nbEventsPerBlock = 12;
4646

4747
%% Timing
@@ -130,10 +130,10 @@
130130

131131
function cfg = setKeyboards(cfg)
132132
cfg.keyboard.escapeKey = 'ESCAPE';
133-
cfg.keyboard.responseKey = {...
133+
cfg.keyboard.responseKey = { ...
134134
'r', 'g', 'y', 'b', ...
135135
'd', 'n', 'z', 'e', ...
136-
't'}; %dnze rgyb
136+
't'}; % dnze rgyb
137137
cfg.keyboard.keyboard = [];
138138
cfg.keyboard.responseBox = [];
139139

subfun/doAuditoryMotion.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function [onset, duration] = doAuditoryMotion(cfg, thisEvent)
2-
2+
33
% Play the auditopry stimulation of moving in 4 directions or static noise bursts
44
%
55
% DIRECTIONS
@@ -14,15 +14,15 @@
1414
% - onset in machine time
1515
% - duration in seconds
1616
%
17-
17+
1818
%% Get parameters
19-
19+
2020
direction = thisEvent.direction(1);
2121
isTarget = thisEvent.target(1);
2222
targetDuration = cfg.target.duration;
23-
23+
2424
soundData = cfg.soundData;
25-
25+
2626
switch direction
2727
case -1
2828
fieldName = 'S';
@@ -35,18 +35,18 @@
3535
case 180
3636
fieldName = 'L';
3737
end
38-
38+
3939
if isTarget == 1
4040
fieldName = [fieldName '_T'];
4141
end
42-
42+
4343
sound = soundData.(fieldName);
44-
44+
4545
% Start the sound presentation
4646
PsychPortAudio('FillBuffer', cfg.audio.pahandle, sound);
4747
PsychPortAudio('Start', cfg.audio.pahandle);
4848
onset = GetSecs;
49-
49+
5050
% draw first fixation and get a first visual time stamp
5151
% ideally we would want to synch that first time stamp and the sound start
5252
thisFixation.fixation = cfg.fixation;
@@ -56,29 +56,29 @@
5656
end
5757
drawFixation(thisFixation);
5858
vbl = Screen('Flip', cfg.screen.win);
59-
59+
6060
while 1
61-
61+
6262
% set default cross cross color but update if target time is not
6363
% finished
6464
thisFixation.fixation.color = cfg.fixation.color;
6565
if GetSecs < (onset + targetDuration) && isTarget == 1
6666
thisFixation.fixation.color = cfg.fixation.colorTarget;
6767
end
68-
68+
6969
drawFixation(thisFixation);
7070
vbl = Screen('Flip', cfg.screen.win, vbl + cfg.screen.ifi);
71-
71+
7272
status = PsychPortAudio('GetStatus', cfg.audio.pahandle);
7373
if ~status.Active
74-
break;
74+
break
7575
end
76-
76+
7777
end
78-
78+
7979
% Get the end time
8080
waitForEndOfPlayback = 1; % hard coding that will need to be moved out
8181
[onset, ~, ~, estStopTime] = PsychPortAudio('Stop', cfg.audio.pahandle, ...
8282
waitForEndOfPlayback);
83-
83+
8484
duration = estStopTime - onset;

subfun/expDesign.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
if nargin < 1 || isempty(cfg)
6060
error('give me something to work with');
6161
end
62-
63-
fprintf('\n\nCreating design.\n\n')
62+
63+
fprintf('\n\nCreating design.\n\n');
6464

6565
[NB_BLOCKS, NB_REPETITIONS, NB_EVENTS_PER_BLOCK, MAX_TARGET_PER_BLOCK] = getInput(cfg);
6666
[~, STATIC_INDEX, MOTION_INDEX] = assignConditions(cfg);

0 commit comments

Comments
 (0)