Skip to content

Commit e337d51

Browse files
authored
Merge pull request #103 from Remi-Gau/misc
[DOC & INFRA] Misc
2 parents f6e87eb + 3cbd375 commit e337d51

35 files changed

+215
-60
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ venv/
1616
## visual studio code
1717
.vscode
1818

19+
# exclude temp files from tests and coverage
20+
test_report.log
21+
*coverage*
22+
1923
## MATLAB / OCTAVE gitignore template
2024

2125
# From : https://github.com/github/gitignore/blob/master/Global/MATLAB.gitignore

CITATION.cff

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
cff-version: 1.2.0
2+
3+
title: "CPP localizer visual motion"
4+
5+
version: 0.4.0dev
6+
7+
abstract: A localizer for visual motion sensitive brain regions using RDK.
8+
9+
message: "If you use this software, please cite it as below."
10+
11+
repository-code: "https://github.com/cpp-lln-lab/localizer_visual_motion.git"
12+
13+
identifiers:
14+
- description: This is the collection of archived snapshots of all releases
15+
type: doi
16+
value: "10.5281/zenodo.4007674"
17+
18+
contact:
19+
- affiliation: "Université catholique de Louvain"
20+
21+
family-names: Gau
22+
given-names: Rémi
23+
24+
authors:
25+
- family-names: "Gau"
26+
given-names: "Rémi"
27+
orcid: "https://orcid.org/0000-0002-1535-9767"
28+
affiliation: "Université catholique de Louvain"
29+
30+
- family-names: "Barilari"
31+
given-names: "Marco"
32+
orcid: "https://orcid.org/0000-0002-3313-3120"
33+
affiliation: "Université catholique de Louvain"
34+
35+
- family-names: "Battal"
36+
given-names: "Ceren"
37+
orcid: "https://orcid.org/0000-0002-9844-7630"
38+
affiliation: "Université catholique de Louvain"
39+
40+
- family-names: "Rezk"
41+
given-names: "Mohamed"
42+
orcid: "https://orcid.org/0000-0002-1866-8645"
43+
affiliation: "Université catholique de Louvain"
44+
45+
- family-names: "Shahzad"
46+
given-names: "Iqra"
47+
orcid: "https://orcid.org/0000-0002-8724-7668"
48+
affiliation: "Université catholique de Louvain"
49+
50+
license: MIT license
51+
52+
keywords:
53+
- BIDS
54+
- brain imaging data structure
55+
- neuroscience
56+
- MATLAB
57+
- Octave

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# TODO make more general to use the local matlab version
2+
MATLAB = /usr/local/MATLAB/R2017a/bin/matlab
3+
ARG = -nodisplay -nosplash -nodesktop
4+
5+
.PHONY: clean manual fix_submodule
6+
clean: clean
7+
rm -rf version.txt
8+
9+
fix_submodule:
10+
git submodule update --init --recursive && git submodule update --recursive
11+
12+
lint:
13+
mh_style --fix && mh_metric --ci && mh_lint
14+
15+
test:
16+
$(MATLAB) $(ARG) -r "runTests; exit()"
17+
18+
version.txt: CITATION.cff
19+
grep -w "^version" CITATION.cff | sed "s/version: /v/g" > version.txt
20+
21+
validate_cff: CITATION.cff
22+
cffconvert --validate

README.md

Lines changed: 65 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/localizer_visual_motion/actions)
22
![](https://github.com/cpp-lln-lab/localizer_visual_motion/workflows/CI/badge.svg)
33
[![codecov](https://codecov.io/gh/cpp-lln-lab/localizer_visual_motion/branch/master/graph/badge.svg)](https://codecov.io/gh/cpp-lln-lab/localizer_visual_motion)
4-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
54
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
6-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
75

8-
<!-- TOC -->
96
- [fMRI localizers for visual motion](#fmri-localizers-for-visual-motion)
107
- [Requirements](#requirements)
118
- [Installation](#installation)
@@ -22,13 +19,13 @@
2219
- [Input:](#input-1)
2320
- [Output:](#output-1)
2421
- [Contributors ✨](#contributors-)
25-
<!-- TOC -->
2622

2723
# fMRI localizers for visual motion
2824

2925
## Requirements
3026

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.
27+
Make sure that the following toolboxes are installed and added to the matlab /
28+
octave path. See the next section on how to install the submodule toolboxes.
3229

3330
For instructions see the following links:
3431

@@ -42,8 +39,8 @@ For instructions see the following links:
4239

4340
## Installation
4441

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.
42+
The CPP_BIDS and CPP_PTB dependencies are already set up as submodule to this
43+
repository. You can install it all with git by doing.
4744

4845
```bash
4946
git clone --recurse-submodules https://github.com/cpp-lln-lab/localizer_visual_motion.git
@@ -53,15 +50,21 @@ git clone --recurse-submodules https://github.com/cpp-lln-lab/localizer_visual_m
5350

5451
### visualMotionLocalizer
5552

56-
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).
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).
5757

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..
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..
5960

60-
Any details of the experiment can be changed in `setParameters.m` (e.g., experiment mode, motion stimuli details, exp. design, etc.)
61+
Any details of the experiment can be changed in `setParameters.m` (e.g.,
62+
experiment mode, motion stimuli details, exp. design, etc.)
6163

6264
### setParameters
6365

64-
`setParameters.m` is the core engine of the experiment. It contains the following tweakable sections:
66+
`setParameters.m` is the core engine of the experiment. It contains the
67+
following tweakable sections:
6568

6669
- Debug mode setting
6770
- MRI settings
@@ -77,7 +80,8 @@ Any details of the experiment can be changed in `setParameters.m` (e.g., experim
7780

7881
#### Let the scanner pace the experiment
7982

80-
Set `cfg.pacedByTriggers.do` to `true` and you can then set all the details in this `if` block
83+
Set `cfg.pacedByTriggers.do` to `true` and you can then set all the details in
84+
this `if` block
8185

8286
```matlab
8387
% Time is here in terms of `repetition time (TR)` (i.e. MRI volumes)
@@ -106,10 +110,13 @@ Wrapper function that present the dot stimulation (static or motion) per event.
106110

107111
#### Input
108112

109-
- `cfg`: PTB/machine and experiment configurations returned by `setParameters` and `initPTB`
113+
- `cfg`: PTB/machine and experiment configurations returned by `setParameters`
114+
and `initPTB`
110115
- `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
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
113120
- `dots`: [...]
114121
- `iEvent`: index of the event of the block at the moment of the presentation
115122

@@ -119,52 +126,78 @@ Wrapper function that present the dot stimulation (static or motion) per event.
119126
- Event `duration`
120127
- `dots`: [...]
121128

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.
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.
123133
124134
### subfun/design/expDesign
125135

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).
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).
127140

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.
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.
129143

130144
It computes the directions to display and the task(s), at the moment:
145+
131146
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]
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]
133150

134151
#### Events
135152

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`
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`
138158
- MT_MST localizer: `cfg.design.motionDirections = [666 -666]; % outward inward`
139159

140160
#### Pseudorandomization rules:
141161

142162
- Directions:
143-
1. Directions are all presented in random orders in `numEventsPerBlock/nDirections` consecutive chunks. This evenly distribute the directions across the block.
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.
144167
2. No same consecutive direction
145168

146169
- 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.
170+
171+
1. If there are 2 targets per block we make sure that they are at least 2 events
172+
apart.
148173
2. Targets cannot be on the first or last event of a block.
149174
3. No less than 1 target per event position in the whole run
150175

151176
#### Input:
177+
152178
- `cfg`: parameters returned by setParameters
153-
- `displayFigs`: a boolean to decide whether to show the basic design matrix of the design
179+
- `displayFigs`: a boolean to decide whether to show the basic design matrix of
180+
the design
154181

155182
#### Output:
156-
- `cfg.design.blockNames`: cell array (nbBlocks, 1) with the condition name for each block
183+
184+
- `cfg.design.blockNames`: cell array (nbBlocks, 1) with the condition name for
185+
each block
157186
- `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.
187+
- `cfg.design.directions`: array (nbBlocks, nbEventsPerBlock) with the direction
188+
to present in a given event of a block.
159189
- 0 90 180 270 indicate the angle for translational motion direction
160190
- 666 -666 indicate in/out-ward direction in radial motion
161191
- -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
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
164196

165197
## Contributors ✨
166198

167-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
199+
Thanks goes to these wonderful people
200+
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
168201

169202
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
170203
<!-- prettier-ignore-start -->
@@ -184,4 +217,6 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
184217

185218
<!-- ALL-CONTRIBUTORS-LIST:END -->
186219

187-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
220+
This project follows the
221+
[all-contributors](https://github.com/all-contributors/all-contributors)
222+
specification. Contributions of any kind welcome!

docs/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

initEnv.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% (C) Copyright 2020 Agah Karakuzu
2-
% (C) Copyright 2019 CPP visual motion localizer developpers
2+
% (C) Copyright 2019 CPP visual motion localizer developers
33

44
function initEnv
55
% 1 - Check if version requirements

lib/CPP_BIDS

Submodule CPP_BIDS updated 78 files

miss_hit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ regex_script_name: "[a-z]+(([A-Z]){1}[A-Za-z]+)*"
88
exclude_dir: "lib"
99
copyright_entity: "Mohamed Rezk"
1010
copyright_entity: "Agah Karakuzu"
11-
copyright_entity: "CPP visual motion localizer developpers"
11+
copyright_entity: "CPP visual motion localizer developers"
1212

1313
# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html)
1414
metric "cnest": limit 4

runTests.m

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
function runTests()
2+
%
3+
% (C) Copyright 2022 CPP visual motion localizer developers
4+
5+
% Elapsed time is ??? seconds.
6+
7+
tic;
8+
9+
initEnv();
10+
11+
if bids.internal.is_github_ci
12+
fprintf(1, '\nThis is github CI\n');
13+
else
14+
fprintf(1, '\nThis is not github CI\n');
15+
end
16+
17+
fprintf('\nHome is %s\n', getenv('HOME'));
18+
19+
warning('OFF');
20+
21+
folderToCover = fullfile(pwd, 'subfun');
22+
testFolder = fullfile(pwd, 'tests');
23+
24+
success = moxunit_runtests(testFolder, ...
25+
'-verbose', '-recursive', '-with_coverage', ...
26+
'-cover', folderToCover, ...
27+
'-cover_xml_file', 'coverage.xml', ...
28+
'-cover_html_dir', fullfile(pwd, 'coverage_html'));
29+
30+
if success
31+
system('echo 0 > test_report.log');
32+
else
33+
system('echo 1 > test_report.log');
34+
end
35+
36+
toc;
37+
38+
end

0 commit comments

Comments
 (0)