Skip to content

Commit a5f6efa

Browse files
authored
Merge pull request #62 from cpp-lln-lab/dev
[REL] v0.2.4
2 parents ee4c7a2 + 0c1f41c commit a5f6efa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+216
-149
lines changed

.github/workflows/miss_hit_quality.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- dev
78
pull_request:
89
branches: ['*']
910

.github/workflows/miss_hit_style.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- dev
78
pull_request:
89
branches: ['*']
910

.github/workflows/moxunit.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- dev
78
pull_request:
89
branches: ['*']
910

@@ -15,17 +16,22 @@ jobs:
1516
with:
1617
submodules: true
1718
fetch-depth: 1
19+
1820
- name: MOxUnit Action
19-
uses: joergbrech/moxunit-action@v1.1
21+
uses: joergbrech/moxunit-action@v1.2.0
2022
with:
2123
tests: tests
2224
src: subfun
25+
# add CPP_PTB to the path but don't include it the coverage
26+
ext: lib/CPP_PTB/src
27+
# Octave packages needed
28+
pkg: statistics
2329
with_coverage: true
2430
cover_xml_file: coverage.xml
31+
2532
- name: Code coverage
2633
uses: codecov/codecov-action@v1
2734
with:
28-
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
2935
file: coverage.xml # optional
3036
flags: unittests # optional
3137
name: codecov-umbrella # optional

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
*.tsv
77
*.mat
88

9+
% tests and coverage
10+
coverage*
11+
test_report.log
12+
913
output
1014

1115
## virtual env

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[submodule "lib/CPP_PTB"]
22
path = lib/CPP_PTB
33
url = https://github.com/cpp-lln-lab/CPP_PTB.git
4-
branch = master
4+
branch = dev
55
[submodule "lib/CPP_BIDS"]
66
path = lib/CPP_BIDS
77
url = https://github.com/cpp-lln-lab/CPP_BIDS.git
8-
branch = master
8+
branch = dev

README.md

Lines changed: 32 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/localizer_auditory_motion/actions)
2-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
32
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
4-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
53
![](https://github.com/cpp-lln-lab/localizer_auditory_motion/workflows/CI/badge.svg)
6-
74
[![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)
8-
95
[![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)
106

11-
127
# Auditory Translational Motion
138

14-
<!-- vscode-markdown-toc -->
9+
- [Auditory Translational Motion](#auditory-translational-motion)
10+
- [`audioLocTranslational`](#audioloctranslational)
11+
- [`setParameters`](#setparameters)
12+
- [Requirements](#requirements)
13+
- [Installation](#installation)
14+
- [Contributors ✨](#contributors-)
15+
16+
## `audioLocTranslational`
17+
18+
Running this script will play blocks of motion/static sounds. Motion blocks will
19+
play sounds moving in one of four directions (up-, down-, left-, and right-ward)
1520

16-
- 1. [Requirements](#Requirements)
17-
- 2. [Installation](#Installation)
18-
- 3. [Structure and function details](#Structureandfunctiondetails)
19-
_ 3.1. [audioLocTranslational](#audioLocTranslational)
20-
_ 3.2. [setParameters](#setParameters)
21-
_ 3.3. [subfun/expDesign](#subfunexpDesign)
22-
_ 3.3.1. [EVENTS](#EVENTS)
23-
_ 3.3.2. [TARGETS:](#TARGETS:)
24-
_ 3.3.3. [Input:](#Input:)
25-
_ 3.3.4. [Output:](#Output:)
26-
_ 3.4. [subfun/eyeTracker](#subfuneyeTracker) \* 3.5. [subfun/wait4Trigger](#subfunwait4Trigger)
21+
By default it is run in `Debug mode` meaning that it does not care about subjID,
22+
run n., fMRI triggers, Eye Tracker, etc..
2723

28-
<!-- vscode-markdown-toc-config
29-
numbering=true
30-
autoSave=true
31-
/vscode-markdown-toc-config -->
32-
<!-- /vscode-markdown-toc -->
24+
Any details of the experiment can be changed in `setParameters.m` (e.g.,
25+
experiment mode, motion stimuli details, exp. design, etc.)
3326

34-
## 1. <a name='Requirements'></a>Requirements
27+
### `setParameters`
3528

36-
Make sure that the following toolboxes are installed and added to the matlab / octave path.
29+
`setParameters.m` is the core engine of the experiment. See
30+
[docs/configuration](.docs/../docs/configuration.md) for more information.
31+
32+
## Requirements
33+
34+
Make sure that the following toolboxes are installed and added to the matlab /
35+
octave path.
3736

3837
For instructions see the following links:
3938

@@ -43,99 +42,19 @@ For instructions see the following links:
4342
| [Matlab](https://www.mathworks.com/products/matlab.html) | >=2017b |
4443
| or [octave](https://www.gnu.org/software/octave/) | >=4.? |
4544

46-
## 2. <a name='Installation'></a>Installation
45+
## Installation
4746

48-
The CPP_BIDS and CPP_PTB dependencies are already set up as submodule to this repository.
49-
You can install it all with git by doing.
47+
The CPP_BIDS and CPP_PTB dependencies are already set up as submodule to this
48+
repository. You can install it all with git by doing.
5049

5150
```bash
5251
git clone --recurse-submodules https://github.com/cpp-lln-lab/localizer_auditory_motion.git
5352
```
5453

55-
## 3. <a name='Structureandfunctiondetails'></a>Structure and function details
56-
57-
### 3.1. <a name='audioLocTranslational'></a>audioLocTranslational
58-
59-
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)
60-
61-
By default it is run in `Debug mode` meaning that it does not care about subjID, run n., fMRI triggers, Eye Tracker, etc..
62-
63-
Any details of the experiment can be changed in `setParameters.m` (e.g., experiment mode, motion stimuli details, exp. design, etc.)
64-
65-
### 3.2. <a name='setParameters'></a>setParameters
66-
67-
`setParameters.m` is the core engine of the experiment. It contains the following tweakable sections:
68-
69-
- Debug mode setting
70-
- Engine parameters:
71-
- Devices parameters
72-
- Monitor parameters
73-
- Keyboard parameters
74-
- MRI parameters
75-
- Experiment Design
76-
- Timing
77-
- Auditory Stimulation
78-
- Task(s)
79-
- Instructions
80-
- Task #1 parameters
81-
82-
#### Let the scanner pace the experiment
83-
84-
Set `cfg.pacedByTriggers.do` to `true` and you can then set all the details in this `if` block
85-
86-
```matlab
87-
% Time is here in in terms of number repetition time (i.e MRI volumes)
88-
if cfg.pacedByTriggers.do
89-
90-
cfg.pacedByTriggers.quietMode = true;
91-
cfg.pacedByTriggers.nbTriggers = 1;
92-
93-
cfg.timing.eventDuration = cfg.mri.repetitionTime / 2 - 0.04; % second
94-
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;
103-
104-
end
105-
```
106-
107-
### 3.3. <a name='subfunexpDesign'></a>subfun/expDesign
108-
109-
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.
110-
111-
#### 3.3.1. <a name='EVENTS'></a>EVENTS
112-
113-
The `numEventsPerBlock` should be a multiple of the number of "base" listed in the `motionDirections` and `staticDirections` (4 at the moment).
114-
115-
#### 3.3.2. <a name='TARGETS:'></a>TARGETS:
116-
117-
- If there are 2 targets per block we make sure that they are at least 2 events apart.
118-
- Targets cannot be on the first or last event of a block
119-
120-
#### 3.3.3. <a name='Input:'></a>Input:
121-
122-
- `expParameters`: parameters returned by `setParameters`
123-
- `displayFigs`: a boolean to decide whether to show the basic design matrix of the design
124-
125-
#### 3.3.4. <a name='Output:'></a>Output:
126-
127-
- `expParameters.designBlockNames` is a cell array `(nr_blocks, 1)` with the name for each block
128-
- `expParameters.designDirections` is an array `(nr_blocks, numEventsPerBlock)` with the direction to present in a given block
129-
- `0 90 180 270` indicate the angle
130-
- `-1` indicates static
131-
- `expParameters.designSpeeds` is an array `(nr_blocks, numEventsPerBlock) * speedEvent`
132-
- `expParameters.designFixationTargets` is an array `(nr_blocks, numEventsPerBlock)` showing for each event if it should be accompanied by a target
133-
134-
135-
13654
## Contributors ✨
13755

138-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
56+
Thanks goes to these wonderful people
57+
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
13958

14059
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
14160
<!-- prettier-ignore-start -->
@@ -150,6 +69,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
15069

15170
<!-- markdownlint-enable -->
15271
<!-- prettier-ignore-end -->
72+
15373
<!-- ALL-CONTRIBUTORS-LIST:END -->
15474

155-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
75+
This project follows the
76+
[all-contributors](https://github.com/all-contributors/all-contributors)
77+
specification. Contributions of any kind welcome!

audioLocTranslational.m

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@
8888

8989
thisEvent.isStim = logFile.isStim;
9090

91-
% we wait for a trigger every 2 events
92-
if cfg.pacedByTriggers.do && mod(iEvent, 2) == 1
93-
waitForTrigger( ...
94-
cfg, ...
91+
% we wait for a trigger every events
92+
if cfg.pacedByTriggers.do
93+
waitForTrigger(cfg, ...
9594
cfg.keyboard.responseBox, ...
9695
cfg.pacedByTriggers.quietMode, ...
9796
cfg.pacedByTriggers.nbTriggers);
@@ -133,6 +132,15 @@
133132

134133
waitFor(cfg, cfg.timing.IBI);
135134

135+
% IBI trigger paced
136+
if cfg.pacedByTriggers.do
137+
waitForTrigger( ...
138+
cfg, ...
139+
cfg.keyboard.responseBox, ...
140+
cfg.pacedByTriggers.quietMode, ...
141+
cfg.timing.triggerIBI);
142+
end
143+
136144
% trigger monitoring
137145
triggerEvents = getResponse('check', cfg.keyboard.responseBox, cfg, ...
138146
getOnlyPress);

docs/configuration.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
## Structure and function details
2+
3+
`setParameters.m` is the core engine of the experiment. It contains the
4+
following tweakable sections. See
5+
[docs/configuration](.docs/../docs/configuration.md) for more information.
6+
7+
- Debug mode setting
8+
- Engine parameters:
9+
- Devices parameters
10+
- Monitor parameters
11+
- Keyboard parameters
12+
- MRI parameters
13+
- Experiment Design
14+
- Timing
15+
- Auditory Stimulation
16+
- Task(s)
17+
- Instructions
18+
- Task #1 parameters
19+
20+
#### Let the scanner pace the experiment
21+
22+
Set `cfg.pacedByTriggers.do` to `true` and you can then set all the details in
23+
this `if` block
24+
25+
```matlab
26+
% Time is here in in terms of number repetition time (i.e MRI volumes)
27+
if cfg.pacedByTriggers.do
28+
29+
cfg.pacedByTriggers.quietMode = true;
30+
cfg.pacedByTriggers.nbTriggers = 1;
31+
32+
cfg.timing.eventDuration = cfg.mri.repetitionTime / 2 - 0.04; % second
33+
34+
% Time between blocs in secs
35+
cfg.timing.IBI = 0;
36+
% Time between events in secs
37+
cfg.timing.ISI = 0;
38+
% Number of seconds before the motion stimuli are presented
39+
cfg.timing.onsetDelay = 0;
40+
% Number of seconds after the end all the stimuli before ending the run
41+
cfg.timing.endDelay = 2;
42+
43+
end
44+
```
45+
46+
### subfun/expDesign
47+
48+
Creates the sequence of blocks and the events in them. The conditions are
49+
consecutive static and motion blocks (Gives better results than randomised). It
50+
can be run as a stand alone without inputs to display a visual example of a
51+
possible design.
52+
53+
#### EVENTS
54+
55+
The `numEventsPerBlock` should be a multiple of the number of "base" listed in
56+
the `motionDirections` and `staticDirections` (4 at the moment).
57+
58+
#### TARGETS
59+
60+
- If there are 2 targets per block we make sure that they are at least 2 events
61+
apart.
62+
- Targets cannot be on the first or last event of a block
63+
64+
#### Input
65+
66+
- `expParameters`: parameters returned by `setParameters`
67+
- `displayFigs`: a boolean to decide whether to show the basic design matrix of
68+
the design
69+
70+
#### Output
71+
72+
- `expParameters.designBlockNames` is a cell array `(nr_blocks, 1)` with the
73+
name for each block
74+
- `expParameters.designDirections` is an array `(nr_blocks, numEventsPerBlock)`
75+
with the direction to present in a given block
76+
- `0 90 180 270` indicate the angle
77+
- `-1` indicates static
78+
- `expParameters.designSpeeds` is an array
79+
`(nr_blocks, numEventsPerBlock) * speedEvent`
80+
- `expParameters.designFixationTargets` is an array
81+
`(nr_blocks, numEventsPerBlock)` showing for each event if it should be
82+
accompanied by a target
586 KB
Binary file not shown.
586 KB
Binary file not shown.

0 commit comments

Comments
 (0)