Skip to content

Commit

Permalink
Merge pull request #157 from cpp-lln-lab/release_candidate_2.0
Browse files Browse the repository at this point in the history
Release candidate 2.0
  • Loading branch information
Remi-Gau authored Dec 25, 2020
2 parents 57738dc + d3164c4 commit 3455032
Show file tree
Hide file tree
Showing 107 changed files with 3,961 additions and 1,262 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
34 changes: 34 additions & 0 deletions .github/workflows/check_markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check Markdown

on:
push:
branches:
- master
pull_request:
branches: '*'

jobs:
build:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1

- uses: actions/setup-node@v2
with:
node-version: '10'

- name: Install dependencies and check markdown
run: |
npm install `cat npm-requirements.txt`
npx remark README.md --frail
npx remark ./notebooks/ --frail
npx remark ./tests/ --frail
npx remark ./docs/ --frail
1 change: 0 additions & 1 deletion .github/workflows/check_md_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
push:
branches:
- master
- dev
pull_request:
branches: '*'

Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/miss_hit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- dev
pull_request:
branches: '*'

Expand All @@ -28,12 +27,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip3 install install miss_hit
pip3 install -r requirements.txt
- name: Miss_hit code quality
- name: MISS_HIT Code style
run: |
mh_metric . --ci
mh_style --process-slx
- name: Miss_hit code style
- name: MISS_HIT Metrics
run: |
mh_style .
mh_metric --ci
- name: MISS_HIT Bug finder
run: |
mh_lint
15 changes: 14 additions & 1 deletion .github/workflows/moxunit.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
name: CI
name: MOxUnit

on:
push:
branches:
- master
- dev
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1

- name: Make jsonread for octave
run: |
sudo apt-get -y -qq update
sudo apt-get -y install octave
sudo apt-get -y install liboctave-dev
cd lib/JSONio
mkoctfile --mex jsonread.c jsmn.c -DJSMN_PARENT_LINKS
# cd ../..

- name: MOxUnit Action
uses: joergbrech/moxunit-action@v1.1
with:
tests: tests
src: src
with_coverage: true
cover_xml_file: coverage.xml

- name: Code coverage
uses: codecov/codecov-action@v1
with:
Expand Down
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,20 @@ tests/*.tsv*
check_my_code_report.txt

# jupyter notebook checkpoints
.ipynb_checkpoints
*/.ipynb_checkpoints/*
notebooks/.ipynb_checkpoints/*
notebooks/source/*
notebooks/output/*
notebooks/new_experiment/*

# ignore node js files
node_modules/*
package-lock.json

# visual studio code stuff
.vscode

# virtual env
cpp_bids/*

# documentation
docs/build/*
26 changes: 26 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
builder: html
fail_on_warning: true

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: requirements.txt
20 changes: 3 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
# have set it up to run continuous integration on this this repo

# Linux distribution (bionic beaver)
dist: bionic
dist: focal

# Language and version
language: node_js
node_js:
- "10"

cache:
apt: true # only works with Pro version
directories:
- node_modules # NPM packages for the remark markdown linter
- "11"

branches:
only: # only run the CI for those branches
Expand All @@ -33,7 +28,7 @@ before_install:
- travis_retry sudo apt-get -y install nodejs
- travis_retry sudo apt-get -y install npm
# Install BIDS-Validator
- sudo npm install -g bids-validator@1.5.4
- sudo npm install -g bids-validator@1.5.7

install:
# make octave file the JSONio submodule
Expand All @@ -51,12 +46,3 @@ jobs:

- name: "BIDS validator: create and check dataset"
script: octave $OCTFLAGS --eval "test_makeRawDataset" && bids-validator `pwd`/output/raw/ --ignoreNiftiHeaders

- name: "Check markdown"
before_script:
- npm install `cat npm-requirements.txt`
script:
- remark README.md --frail
- remark ./notebooks/ --frail
- remark ./tests/ --frail
- remark ./docs/ --frail
35 changes: 35 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"title": "CPP_BIDS",
"description": "A lightweight Octave/MATLAB toolbox to help create BIDS data sets from source.",
"creators": [
{
"affiliation": "Université Catholique de Louvain",
"name": "Gau, Rémi",
"orcid": "0000-0002-1535-9767"
},
{
"affiliation": "Université Catholique de Louvain",
"name": "Barilari, Marco",
"orcid": "0000-0002-3313-3120"
},
{
"affiliation": "Université Catholique de Louvain",
"name": "Battal, Ceren",
"orcid": "0000-0002-9844-7630"
},
{
"affiliation": "Université Catholique de Louvain",
"name": "Lenc, Thomas",
"orcid": "0000-0001-5796-1388"
}
],
"keywords": [
"BIDS",
"brain imaging data structure",
"neuroscience",
"MATLAB",
"Octave"
],
"license": "MIT license",
"upload_type": "software"
}
86 changes: 45 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/cpp-lln-lab/CPP_BIDS/master?filepath=notebooks%2Fbasic_usage.ipynb)

**Documentation**

[![Documentation Status: stable](https://readthedocs.org/projects/cpp-bids/badge/?version=stable)](https://cpp-bids.readthedocs.io/en/stable/?badge=stable)

**Cite it**

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4007674.svg)](https://doi.org/10.5281/zenodo.4007674)

**Unit tests and coverage**

[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/CPP_BIDS/actions)
Expand All @@ -19,7 +27,7 @@

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

* * *
---

# CPP_BIDS

Expand All @@ -44,42 +52,24 @@ A set of function for matlab and octave to create
structure and filenames for the output of behavioral, EEG, fMRI, eyetracking
studies.

## Output format

### Modality agnostic aspect

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

A session folder will ALWAYS be created even if not requested (default will be
`ses-001`).

Task labels will be printed in camelCase in the filenames.

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.

For example:

```bash
sub-090/ses-003/sub-090_ses-003_task-auditoryTask_run-023_events_date-202007291536.tsv
```

## Documentation

- [Installation](./docs/installation.md)
- [How to use it: jupyter notebooks](./notebooks)
- [Functions description](./docs/functions-description.md)
- [General documentation](https://cpp-bids.readthedocs.io/en/dev/index.html)

## Contributing

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

### Guidestyle
If you want to contribute, have a look at our
[contributing guidelines](https://github.com/cpp-lln-lab/.github/blob/main/CONTRIBUTING.md)
that are meant to guide you and help you get started. If something is not clear
or you get stuck: it is more likely we did not do good enough a job at
explaining things. So do not hesitate to open an issue, just to ask for
clarification.

### Style guide

- We use camelCase.

Expand All @@ -97,23 +87,31 @@ Here are the naming templates used.

- Behavior

`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.tsv`
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.json`
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_beh.tsv`
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_beh.json`
```bash
sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.tsv
sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.json
sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_beh.tsv
sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_beh.json
```

- BOLD

`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_ce-<label>][_dir-<label>][_rec-<label>][_run-<index>][_echo-<index>]_<contrast_label>.nii[.gz]`
```bash
sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_ce-<label>][_dir-<label>][_rec-<label>][_run-<index>][_echo-<index>]_<contrast_label>.nii[.gz]
```

- iEEG

`sub-<label>[_ses-<label>]_task-<task_label>[_run-<index>]_ieeg.json`
```bash
sub-<label>[_ses-<label>]_task-<task_label>[_run-<index>]_ieeg.json
```

- EEG

`sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_eeg.<manufacturer_specific_extension>`
`sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_eeg.json`
```bash
sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_eeg.<manufacturer_specific_extension>
sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_eeg.json
```

<!-- European data format (Each recording consisting of a .edf file)
Expand All @@ -132,14 +130,19 @@ Biosemi data format (Each recording consisting of a .bdf file) -->
current format `<matches>_recording-eyetracking_physio.tsv.gz`

future BEP format in a dedicated eyetracker folder
`sub-<participant_label>[_ses-<label>][_acq-<label>]_task-<task_label>_eyetrack.<manufacturer_specific_extension>`

```bash
sub-<participant_label>[_ses-<label>][_acq-<label>]_task-<task_label>_eyetrack.<manufacturer_specific_extension>
```

- Stim and physio

`<matches>[_recording-<label>]_physio.tsv.gz`
`<matches>[_recording-<label>]_physio.json`
`<matches>[_recording-<label>]_stim.tsv.gz`
`<matches>[_recording-<label>]_stim.json`
```bash
<matches>[_recording-<label>]_physio.tsv.gz
<matches>[_recording-<label>]_physio.json
<matches>[_recording-<label>]_stim.tsv.gz
<matches>[_recording-<label>]_stim.json
```

### Change log

Expand All @@ -164,6 +167,7 @@ Thanks goes to these wonderful people

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

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

This project follows the
Expand Down
Loading

0 comments on commit 3455032

Please sign in to comment.