Skip to content

Commit 8af2db0

Browse files
committed
fix markdown
1 parent 2210b07 commit 8af2db0

File tree

3 files changed

+121
-77
lines changed

3 files changed

+121
-77
lines changed

README.md

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**Unit tests and coverage**
66

77
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/CPP_BIDS/actions)
8-
![](https://github.com/cpp-lln-lab/CPP_BIDS/workflows/CI/badge.svg)
8+
![](https://github.com/cpp-lln-lab/CPP_BIDS/workflows/CI/badge.svg)
99

1010
[![codecov](https://codecov.io/gh/cpp-lln-lab/CPP_BIDS/branch/master/graph/badge.svg)](https://codecov.io/gh/cpp-lln-lab/CPP_BIDS)
1111

@@ -15,64 +15,79 @@
1515

1616
**Contributors**
1717

18-
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
18+
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
1919

2020
---
21-
21+
2222
# CPP_BIDS
2323

2424
<!-- vscode-markdown-toc -->
25-
* 1. [Output format](#Outputformat)
26-
* 1.1. [Modality agnostic aspect](#Modalityagnosticaspect)
27-
* 2. [Documentation](#Documentation)
28-
* 3. [Contributing](#Contributing)
29-
* 3.1. [Guidestyle](#Guidestyle)
30-
* 3.2. [BIDS naming convention](#BIDSnamingconvention)
31-
* 3.3. [Contributors ✨](#Contributors)
25+
26+
- 1. [Output format](#Outputformat)
27+
- 1.1. [Modality agnostic aspect](#Modalityagnosticaspect)
28+
- 2. [Documentation](#Documentation)
29+
- 3. [Contributing](#Contributing)
30+
- 3.1. [Guidestyle](#Guidestyle)
31+
- 3.2. [BIDS naming convention](#BIDSnamingconvention)
32+
- 3.3. [Contributors ✨](#Contributors)
3233

3334
<!-- vscode-markdown-toc-config
3435
numbering=true
3536
autoSave=true
3637
/vscode-markdown-toc-config -->
3738
<!-- /vscode-markdown-toc -->
3839

39-
A set of function for matlab and octave to create [BIDS-compatible](https://bids-specification.readthedocs.io/en/stable/) folder structure and filenames for the output of behavioral, EEG, fMRI, eyetracking studies.
40+
A set of function for matlab and octave to create
41+
[BIDS-compatible](https://bids-specification.readthedocs.io/en/stable/) folder
42+
structure and filenames for the output of behavioral, EEG, fMRI, eyetracking
43+
studies.
4044

41-
## 1. <a name='Outputformat'></a>Output format
45+
## 1. <a name='Outputformat'></a>Output format
4246

43-
### 1.1. <a name='Modalityagnosticaspect'></a>Modality agnostic aspect
47+
### 1.1. <a name='Modalityagnosticaspect'></a>Modality agnostic aspect
4448

45-
Subjects, session and run number labels will be numbers with zero padding up to 3 values (e.g subject 1 will become `sub-001`).
49+
Subjects, session and run number labels will be numbers with zero padding up to
50+
3 values (e.g subject 1 will become `sub-001`).
4651

47-
A session folder will ALWAYS be created even if not requested (default will be `ses-001`).
52+
A session folder will ALWAYS be created even if not requested (default will be
53+
`ses-001`).
4854

4955
Task labels will be printed in camelCase in the filenames.
5056

51-
Time stamps are added directly in the filename by adding a suffix `_date-YYYYMMDDHHMM` which makes the file name non-BIDS compliant. This was added to prevent overwriting files in case a certain run needs to be done a second time because of a crash (Some of us are paranoid about keeping even cancelled runs during my experiments). This suffix should be removed to make the data set BIDS compliant. See `convertSourceToRaw.m` for more details.
57+
Time stamps are added directly in the filename by adding a suffix
58+
`_date-YYYYMMDDHHMM` which makes the file name non-BIDS compliant. This was
59+
added to prevent overwriting files in case a certain run needs to be done a
60+
second time because of a crash (Some of us are paranoid about keeping even
61+
cancelled runs during my experiments). This suffix should be removed to make the
62+
data set BIDS compliant. See `convertSourceToRaw.m` for more details.
5263

5364
For example:
5465

5566
```
5667
sub-090/ses-003/sub-090_ses-003_task-auditoryTask_run-023_events_date-202007291536.tsv
5768
```
5869

59-
## 2. <a name='Documentation'></a>Documentation
70+
## 2. <a name='Documentation'></a>Documentation
6071

61-
- [Installation](./docs/installation.md)
62-
- [How to use it: jupyter notebooks](./notebooks)
63-
- [Functions description](./docs/functions_description.md)
72+
- [Installation](./docs/installation.md)
73+
- [How to use it: jupyter notebooks](./notebooks)
74+
- [Functions description](./docs/functions_description.md)
6475

65-
## 3. <a name='Contributing'></a>Contributing
76+
## 3. <a name='Contributing'></a>Contributing
6677

6778
Feel free to open issues to report a bug and ask for improvements.
6879

69-
### 3.1. <a name='Guidestyle'></a>Guidestyle
80+
### 3.1. <a name='Guidestyle'></a>Guidestyle
7081

7182
- We use camelCase.
72-
- We keep the McCabe complexity as reported by the [check_my_code function](https://github.com/Remi-Gau/check_my_code) below 15.
73-
- We use the [MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html) to automatically fix some linting issues.
83+
- We keep the McCabe complexity as reported by the
84+
[check_my_code function](https://github.com/Remi-Gau/check_my_code)
85+
below 15.
86+
- We use the
87+
[MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html)
88+
to automatically fix some linting issues.
7489

75-
### 3.2. <a name='BIDSnamingconvention'></a>BIDS naming convention
90+
### 3.2. <a name='BIDSnamingconvention'></a>BIDS naming convention
7691

7792
Here are the naming templates used.
7893

@@ -104,16 +119,13 @@ The format used by the MATLAB toolbox EEGLAB (Each recording consisting of a .se
104119
105120
Biosemi data format (Each recording consisting of a .bdf file) -->
106121

107-
108-
109122
- MEG
110123

111124
???
112125

113126
- Eyetracker
114127

115-
current format
116-
`<matches>_recording-eyetracking_physio.tsv.gz`
128+
current format `<matches>_recording-eyetracking_physio.tsv.gz`
117129

118130
future BEP format in a dedicated eyetracker folder
119131
`sub-<participant_label>[_ses-<label>][_acq-<label>]_task-<task_label>_eyetrack.<manufacturer_specific_extension>`
@@ -129,9 +141,10 @@ future BEP format in a dedicated eyetracker folder
129141

130142
<!-- 93b4c584bf22883a3c4f8b9031b70e381deef272 -->
131143

132-
### 3.3. <a name='Contributors'></a>Contributors ✨
144+
### 3.3. <a name='Contributors'></a>Contributors ✨
133145

134-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
146+
Thanks goes to these wonderful people
147+
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
135148

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

147160
<!-- markdownlint-enable -->
148161
<!-- prettier-ignore-end -->
162+
149163
<!-- ALL-CONTRIBUTORS-LIST:END -->
150164

151-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
165+
This project follows the
166+
[all-contributors](https://github.com/all-contributors/all-contributors)
167+
specification. Contributions of any kind welcome!

docs/functions_description.md

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,73 @@
11
# functions description
22

33
<!-- vscode-markdown-toc -->
4-
* 1. [userInputs](#userInputs)
5-
* 2. [createFilename](#createFilename)
6-
* 3. [saveEventsFile](#saveEventsFile)
7-
* 4. [checkCFG](#checkCFG)
8-
* 4.1. [CFG content](#CFGcontent)
9-
* 5. [createBoldJson](#createBoldJson)
4+
5+
- 1. [userInputs](#userInputs)
6+
- 2. [createFilename](#createFilename)
7+
- 3. [saveEventsFile](#saveEventsFile)
8+
- 4. [checkCFG](#checkCFG)
9+
- 4.1. [CFG content](#CFGcontent)
10+
- 5. [createBoldJson](#createBoldJson)
1011

1112
<!-- vscode-markdown-toc-config
1213
numbering=true
1314
autoSave=true
1415
/vscode-markdown-toc-config -->
1516
<!-- /vscode-markdown-toc -->
1617

17-
## 1. <a name='userInputs'></a>userInputs
18+
## 1. <a name='userInputs'></a>userInputs
1819

19-
Get subject, run and session number and make sure they are positive integer values.
20+
Get subject, run and session number and make sure they are positive integer
21+
values.
2022

21-
By default this will return `cfg.subject.session = 1` even if you asked it to omit enquiring about sessions. This means
22-
that the folder tree will always include a session folder.
23+
By default this will return `cfg.subject.session = 1` even if you asked it to
24+
omit enquiring about sessions. This means that the folder tree will always
25+
include a session folder.
2326

2427
```matlab
2528
[cfg] = userInputs(cfg)
2629
```
2730

28-
If you use it with `cfg.subject.askGrpSess = [0 0]`, it won't ask you about group or session.
29-
30-
If you use it with `cfg.subject.askGrpSess = [1]`, it will only ask you about group
31+
If you use it with `cfg.subject.askGrpSess = [0 0]`, it won't ask you about
32+
group or session.
3133

32-
If you use it with `cfg.subject.askGrpSess = [0 1]`, it will only ask you about session
34+
If you use it with `cfg.subject.askGrpSess = [1]`, it will only ask you about
35+
group
3336

34-
If you use it with `cfg.subject.askGrpSess = [1 1]`, it will ask you about both. This is the default behavior.
37+
If you use it with `cfg.subject.askGrpSess = [0 1]`, it will only ask you about
38+
session
3539

40+
If you use it with `cfg.subject.askGrpSess = [1 1]`, it will ask you about both.
41+
This is the default behavior.
3642

37-
## 2. <a name='createFilename'></a>createFilename
43+
## 2. <a name='createFilename'></a>createFilename
3844

39-
Create the BIDS compliant directories and filenames (but not the files) for the behavioral output for this subject / session / run.
45+
Create the BIDS compliant directories and filenames (but not the files) for the
46+
behavioral output for this subject / session / run.
4047

4148
The folder tree will always include a session folder.
4249

43-
It will also create the right filename for the eye-tracking data file if you ask it.
50+
It will also create the right filename for the eye-tracking data file if you ask
51+
it.
4452

4553
For the moment the date of acquisition is appended to the filename
54+
4655
- can work for behavioral experiment if `cfg.testingDevice` is set to `pc`,
4756
- can work for fMRI experiment if `cfg.testingDevice` is set to `mri`,
4857
- can work for simple eyetracking data if `cfg.eyeTracker.do` is set to 1.
4958

50-
## 3. <a name='saveEventsFile'></a>saveEventsFile
59+
## 3. <a name='saveEventsFile'></a>saveEventsFile
5160

5261
Function to save output files for events that will be BIDS compliant.
5362

54-
If the user DOES NOT provide `onset`, `trial_type`, this events will be skipped. `duration` will be set to `n/a` if no value is provided.
63+
If the user DOES NOT provide `onset`, `trial_type`, this events will be skipped.
64+
`duration` will be set to `n/a` if no value is provided.
5565

56-
## 4. <a name='checkCFG'></a>checkCFG
66+
## 4. <a name='checkCFG'></a>checkCFG
5767

5868
Check that we have all the fields that we need in the experiment parameters.
5969

60-
### 4.1. <a name='CFGcontent'></a>CFG content
70+
### 4.1. <a name='CFGcontent'></a>CFG content
6171

6272
```matlab
6373
% The following can be modified by users but their effect might
@@ -123,22 +133,33 @@ cfg.fileName.datasetDescription
123133
124134
```
125135

126-
## 5. <a name='createBoldJson'></a>createBoldJson
136+
## 5. <a name='createBoldJson'></a>createBoldJson
127137

128138
```
129139
createBoldJson(cfg)
130140
```
131141

132-
This function creates a very light-weight version of the side-car JSON file for a BOLD functional run.
142+
This function creates a very light-weight version of the side-car JSON file for
143+
a BOLD functional run.
133144

134-
This will only contain the minimum BIDS requirement and will likely be less complete than the info you could from DICOM conversion.
145+
This will only contain the minimum BIDS requirement and will likely be less
146+
complete than the info you could from DICOM conversion.
135147

136-
If you put the following line at the end of your experiment script, it will dump the content of the `extraInfo` structure in the json file.
148+
If you put the following line at the end of your experiment script, it will dump
149+
the content of the `extraInfo` structure in the json file.
137150

138151
```
139152
createBoldJson(cfg, extraInfo)
140153
```
141154

142-
This allows to add all the parameters that you used to run your experiment in a human readable format: so that when you write your methods sections 2 years later ("the reviewer asked me for the size of my fixation cross... FML"), the info you used WHEN you ran the experiment is saved in an easily accessible text format. For the love of the flying spaghetti monster do not save all your parameters in a `.mat` file: think of the case when you won't have matlab or octave installed on a computer (plus not everyone uses those).
143-
144-
Also to reading your experiment parameters, you won't have to read it from the `setParameters.m` file and wonder if those might have been modified when running the experiment and you did not commit and tagged that change with git.
155+
This allows to add all the parameters that you used to run your experiment in a
156+
human readable format: so that when you write your methods sections 2 years
157+
later ("the reviewer asked me for the size of my fixation cross... FML"), the
158+
info you used WHEN you ran the experiment is saved in an easily accessible text
159+
format. For the love of the flying spaghetti monster do not save all your
160+
parameters in a `.mat` file: think of the case when you won't have matlab or
161+
octave installed on a computer (plus not everyone uses those).
162+
163+
Also to reading your experiment parameters, you won't have to read it from the
164+
`setParameters.m` file and wonder if those might have been modified when running
165+
the experiment and you did not commit and tagged that change with git.

docs/installation.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# Installation
22

33
<!-- vscode-markdown-toc -->
4-
* 1. [Download with git](#Downloadwithgit)
5-
* 2. [Add as a submodule](#Addasasubmodule)
6-
* 2.1. [Example for submodule usage](#Exampleforsubmoduleusage)
7-
* 3. [Direct download](#Directdownload)
4+
5+
- 1. [Download with git](#Downloadwithgit)
6+
- 2. [Add as a submodule](#Addasasubmodule)
7+
- 2.1. [Example for submodule usage](#Exampleforsubmoduleusage)
8+
- 3. [Direct download](#Directdownload)
89

910
<!-- vscode-markdown-toc-config
1011
numbering=true
1112
autoSave=true
1213
/vscode-markdown-toc-config -->
1314
<!-- /vscode-markdown-toc -->
1415

15-
## 1. <a name='Downloadwithgit'></a>Download with git
16+
## 1. <a name='Downloadwithgit'></a>Download with git
1617

17-
``` bash
18+
```bash
1819
cd fullpath_to_directory_where_to_install
1920

2021
# use git to download the code
@@ -28,22 +29,25 @@ matlab -nojvm -nosplash -r "addpath(fullfile(pwd, 'src')); savepath ();"
2829
```
2930

3031
Then get the latest commit:
32+
3133
```bash
3234
# from the directory where you downloaded the code
3335
git pull origin master
3436
```
3537

36-
To work with a specific version, create a branch at a specific version tag number
38+
To work with a specific version, create a branch at a specific version tag
39+
number
40+
3741
```bash
3842
# creating and checking out a branch that will be called version1 at the version tag v0.0.1
3943
git checkout -b version1 v0.0.1
4044
```
4145

42-
## 2. <a name='Addasasubmodule'></a>Add as a submodule
46+
## 2. <a name='Addasasubmodule'></a>Add as a submodule
4347

4448
Add it as a submodule in the repo you are working on.
4549

46-
``` bash
50+
```bash
4751
cd fullpath_to_directory_where_to_install
4852

4953
# use git to download the code
@@ -56,17 +60,21 @@ cd CPP_BIDS
5660
matlab -nojvm -nosplash -r "addpath(fullfile(pwd, 'src'))"
5761
```
5862

59-
To get the latest commit you then need to update the submodule with the information
60-
on its remote repository and then merge those locally.
63+
To get the latest commit you then need to update the submodule with the
64+
information on its remote repository and then merge those locally.
65+
6166
```bash
6267
git submodule update --remote --merge
6368
```
6469

6570
Remember that updates to submodules need to be committed as well.
6671

67-
### 2.1. <a name='Exampleforsubmoduleusage'></a>Example for submodule usage
72+
### 2.1. <a name='Exampleforsubmoduleusage'></a>Example for submodule usage
73+
74+
So say you want to clone a repo that has some nested submodules, then you would
75+
type this to get the content of all the submodules at once (here with assumption
76+
that you want to clone my experiment repo):
6877

69-
So say you want to clone a repo that has some nested submodules, then you would type this to get the content of all the submodules at once (here with assumption that you want to clone my experiment repo):
7078
```bash
7179
# clone the repo
7280
git clone https://github.com/user_name/myExperiment.git
@@ -83,8 +91,7 @@ git submodule foreach --recursive 'git submodule init'
8391
git submodule foreach --recursive 'git submodule update'
8492
```
8593

86-
87-
## 3. <a name='Directdownload'></a>Direct download
94+
## 3. <a name='Directdownload'></a>Direct download
8895

8996
Download the code. Unzip. And add to the matlab path.
9097

@@ -94,4 +101,4 @@ https://github.com/cpp-lln-lab/CPP_BIDS/releases
94101

95102
Or take the latest commit (NOT RECOMMENDED):
96103

97-
https://github.com/cpp-lln-lab/CPP_BIDS/archive/master.zip
104+
https://github.com/cpp-lln-lab/CPP_BIDS/archive/master.zip

0 commit comments

Comments
 (0)