Skip to content

Commit 92b0bf8

Browse files
committed
update infra and doc
1 parent 7a19449 commit 92b0bf8

File tree

10 files changed

+129
-78
lines changed

10 files changed

+129
-78
lines changed

CITATION.cff

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cff-version: 1.2.0
2+
3+
title: "spm_2_bids"
4+
5+
version: v0.1.0dev
6+
7+
abstract: Toolbox to convert SPM output files to valid BIDS derivatives.
8+
9+
repository-code: "https://github.com/cpp-lln-lab/spm_2_bids.git"
10+
11+
contact:
12+
- affiliation: "Université catholique de Louvain"
13+
14+
family-names: Gau
15+
given-names: Rémi
16+
17+
authors:
18+
- family-names: "Gau"
19+
given-names: "Rémi"
20+
orcid: "https://orcid.org/0000-0002-1535-9767"
21+
affiliation: "Université catholique de Louvain"
22+
23+
license: GPL-3.0
24+
25+
keywords:
26+
- BIDS
27+
- brain imaging data structure
28+
- neuroimaging
29+
- MRI
30+
- MATLAB
31+
- Octave
32+
- SPM

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
install_dev:
2-
git clone https://github.com/bids-standard/bids-matlab.git lib/bids-matlab
3-
cd lib/bids-matlab && git checkout dev
4-
git clone https://github.com/gllmflndn/JSONio.git --depth 1 lib/JSONio
1+
.PHONY: clean
2+
3+
install_dev_octave: install_dev
4+
cd lib/JSONio && mkoctfile --mex jsonread.c jsmn.c -DJSMN_PARENT_LINKS
5+
install_dev: lib/bids-matlab lib/JSONio
56

6-
install_dev_octave:
7+
lib/bids-matlab:
78
git clone https://github.com/bids-standard/bids-matlab.git lib/bids-matlab
89
cd lib/bids-matlab && git checkout dev
9-
git clone https://github.com/gllmflndn/JSONio.git --depth 1 lib/JSONio
10-
cd lib/JSONio && mkoctfile --mex jsonread.c jsmn.c -DJSMN_PARENT_LINKS
1110

11+
lib/JSONio:
12+
git clone https://github.com/gllmflndn/JSONio.git --depth 1 lib/JSONio
1213
clean:
1314
rm -rf lib/bids-matlab
1415
rm -rf lib/JSONio
16+
rm -rf version.txt
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: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,47 @@
1-
<!--
1+
[![code quality](https://github.com/cpp-lln-lab/spm_2_bids/actions/workflows/miss_hit_code_quality.yml/badge.svg)](https://github.com/cpp-lln-lab/spm_2_bids/actions/workflows/miss_hit_code_quality.yml)
2+
[![code style](https://github.com/cpp-lln-lab/spm_2_bids/actions/workflows/miss_hit_code_style.yml/badge.svg)](https://github.com/cpp-lln-lab/spm_2_bids/actions/workflows/miss_hit_code_style.yml)
3+
[![tests](https://github.com/cpp-lln-lab/spm_2_bids/actions/workflows/run_tests.yml/badge.svg)](https://github.com/cpp-lln-lab/spm_2_bids/actions/workflows/run_tests.yml)
4+
[![codecov](https://codecov.io/gh/cpp-lln-lab/spm_2_bids/branch/master/graph/badge.svg?token=yaL40GJK9y)](https://codecov.io/gh/cpp-lln-lab/spm_2_bids)
25

3-
When you have set up your repo
6+
# spm_2_bids
47

5-
**Unit tests and coverage**
8+
Small code base to help convert the MRI spm output to a valid bids derivatives.
69

7-
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/Remi-gau/template_matlab_analysis/actions)
8-
![](https://github.com/Remi-gau/template_matlab_analysis/workflows/CI/badge.svg)
10+
This code only generates the plausible BIDS derivatives filename for given file
11+
that has been preprocessed with SPM.
912

10-
[![codecov](https://codecov.io/gh/Remi-gau/template_matlab_analysis/branch/master/graph/badge.svg)](https://codecov.io/gh/Remi-gau/template_matlab_analysis)
13+
Most of the renaming is based on the SPM prefixes combinations.
1114

12-
**Miss_hit linter**
15+
It is configurable to adapt to new set of prefixes.
1316

14-
[![Build Status](https://travis-ci.com/Remi-gau/template_matlab_analysis.svg?branch=master)](https://travis-ci.com/Remi-gau/template_matlab_analysis)
17+
## Dependencies
1518

16-
-->
19+
- [BIDS-matlab](https://github.com/bids-standard/bids-matlab)
1720

18-
# spm_2_bids
21+
Can be installed with :
1922

20-
Small code base to help convert the MRI spm output to a valid bids derivatives.
23+
For MATLAB
2124

22-
This code only generates the plausible BIDS derivatives filename for given file that has
23-
been preprocessed with SPM.
25+
```bash
26+
make install_dev
27+
```
2428

25-
Most of the renaming is based on the SPM prefixes combinations.
29+
For Octave
2630

27-
It is configurable to adapt to new set of prefixes.
31+
```bash
32+
make install_dev_octave
33+
```
34+
35+
## Usage
36+
37+
```matlab
38+
file = 'wmsub-01_desc-skullstripped_T1w.nii';
39+
40+
new_filename = spm_2_bids(file);
41+
42+
new_filename =
43+
44+
'sub-01_space-IXI549Space_desc-preproc_T1w.nii');
45+
```
2846

29-
- [Dependencies](./lib/README.md)
30-
- [Documentation](https://spm-2-bids.readthedocs.io/en/latest/)
47+
For more see the [documentation](https://spm-2-bids.readthedocs.io/en/latest/).

docs/requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
# doc
12
Sphinx
23
sphinxcontrib-matlabdomain
3-
sphinxcontrib-napoleon
4+
sphinx-copybutton
45
sphinx_rtd_theme
6+
rstcheck
7+
myst-parser

docs/source/conf.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
#
1313
import os
1414
import sys
15-
sys.path.insert(0, os.path.abspath('../..'))
15+
16+
sys.path.insert(0, os.path.abspath("../.."))
1617

1718

1819
# -- Project information -----------------------------------------------------
1920

20-
project = 'spm_2_bids'
21-
author = 'Rémi Gau'
21+
project = "spm_2_bids"
22+
author = "Rémi Gau"
2223

2324
# The full version, including alpha/beta/rc tags
24-
release = 'v0.1.0'
25+
release = "v0.1.0"
2526

2627

2728
# -- General configuration ---------------------------------------------------
@@ -30,37 +31,40 @@
3031
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3132
# ones.
3233
extensions = [
33-
'sphinxcontrib.matlab',
34-
'sphinx.ext.autodoc']
35-
matlab_src_dir = os.path.dirname(os.path.abspath('../../src'))
36-
primary_domain = 'mat'
34+
"sphinxcontrib.matlab",
35+
"sphinx.ext.autodoc",
36+
"sphinx_copybutton",
37+
"myst_parser",
38+
]
39+
matlab_src_dir = os.path.dirname(os.path.abspath("../../src"))
40+
primary_domain = "mat"
3741

3842
# Add any paths that contain templates here, relative to this directory.
39-
templates_path = ['_templates']
43+
templates_path = ["_templates"]
4044

4145
# List of patterns, relative to source directory, that match files and
4246
# directories to ignore when looking for source files.
4347
# This pattern also affects html_static_path and html_extra_path.
4448
exclude_patterns = []
4549

4650
# The name of the Pygments (syntax highlighting) style to use.
47-
pygments_style = 'sphinx'
51+
pygments_style = "sphinx"
4852

4953
# The master toctree document.
50-
master_doc = 'index'
54+
master_doc = "index"
5155

5256
# source_suffix = ['.rst', '.md']
53-
source_suffix = '.rst'
57+
source_suffix = ".rst"
5458

55-
autodoc_member_order = 'bysource'
59+
autodoc_member_order = "bysource"
5660

5761

5862
# -- Options for HTML output -------------------------------------------------
5963

6064
# The theme to use for HTML and HTML Help pages. See the documentation for
6165
# a list of builtin themes.
6266
#
63-
html_theme = 'sphinx_rtd_theme'
67+
html_theme = "sphinx_rtd_theme"
6468

6569
# Add any paths that contain custom static files (such as style sheets) here,
6670
# relative to this directory. They are copied after the builtin static files,
@@ -76,11 +80,11 @@
7680
# }
7781

7882
html_sidebars = {
79-
'**': [
80-
'about.html',
81-
'navigation.html',
82-
'relations.html', # needs 'show_related': True theme option to display
83-
'searchbox.html',
84-
'donate.html',
83+
"**": [
84+
"about.html",
85+
"navigation.html",
86+
"relations.html", # needs 'show_related': True theme option to display
87+
"searchbox.html",
88+
"donate.html",
8589
]
8690
}

docs/source/function_details.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Function details
2+
****************
3+
4+
``spm_2_bids`` only provides names to use but does not actually rename the files.
5+
6+
.. automodule:: src
7+
8+
.. autofunction:: spm_2_bids
9+
10+
.. automodule:: src.defaults
11+
12+
.. autofunction:: check_cfg
13+
14+
.. autoclass:: Mapping
15+
:members:

docs/source/general_information.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

docs/source/index.rst

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. cpp_bids documentation master file
1+
.. spm_2_bids documentation master file
22
33
Welcome to spm_2_bids documentation!
44
************************************
@@ -7,27 +7,5 @@ Welcome to spm_2_bids documentation!
77
:maxdepth: 2
88
:caption: Content
99

10-
----
11-
12-
``spm_2_bids`` only provides names to use but does not actually rename the files.
13-
14-
.. automodule:: src
15-
16-
.. autofunction:: spm_2_bids
17-
18-
.. automodule:: src.defaults
19-
20-
.. autofunction:: check_cfg
21-
22-
.. autoclass:: Mapping
23-
:members:
24-
25-
26-
27-
28-
Indices and tables
29-
==================
30-
31-
* :ref:`genindex`
32-
* :ref:`modindex`
33-
* :ref:`search`
10+
general_information
11+
function_details

lib/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.1.0
1+
v0.1.0dev

0 commit comments

Comments
 (0)