Skip to content

Commit 15b86a3

Browse files
authored
Merge branch 'bids-standard:master' into master
2 parents 1202d77 + ce0eb77 commit 15b86a3

File tree

5 files changed

+174
-5
lines changed

5 files changed

+174
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ venv*
1313
venv3.11/
1414
.idea/*
1515
.pytest_cache/*
16+
build/*
17+
*.egg-info

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Camille Maumet ([@cmaumet](https://github.com/cmaumet)) and Satrajit Ghosh ([@sa
3434
- Cyril Regan ([@cyril-data](https://github.com/cyril-data))<a href="https://github.com/bids-standard/BEP028_BIDSprov/commits?author=cyril-data" title="Code">💻</a><a href="https://github.com/bids-standard/BEP028_BIDSprov/pulls?q=is%3Apr+reviewed-by%3Acyril-data" title="Reviewed Pull Requests">👀</a><a href="https://github.com/bids-standard/BEP028_BIDSprov/commits?author=cyril-data" title="Documentation">📖</a>
3535
<a href="https://github.com/bids-standard/BEP028_BIDSprov/issues?q=author%3Acyril-data" title="Bug reports">🐛</a>
3636

37+
- Boris Clénet ([@bclenet](https://github.com/bclenet))<a href="https://github.com/bids-standard/BEP028_BIDSprov/commits?author=bclenet" title="Code">💻</a><a href="https://github.com/bids-standard/BEP028_BIDSprov/commits?author=bclenet" title="Documentation">📖</a><a href="https://github.com/bids-standard/BEP028_BIDSprov/issues?q=author%3Abclenet" title="Bug reports">🐛</a>
38+
3739
This project follows the
3840
[all-contributors](https://github.com/all-contributors/all-contributors)
3941
specification. Contributions of any kind welcome!
@@ -80,7 +82,41 @@ Mature building blocks of NIDM:
8082
[New features (to be included)](new_features.md)
8183

8284

83-
## Run parsers on the SPM, FSL and AFNI data
85+
## Using the code
86+
87+
### Visualize your BIDSprov data
88+
89+
To visualize your BIDSprov data, perform the following steps :
90+
1. [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) the code inside a `BEP028_BIDSprov` directory, and cd into this directory :
91+
92+
```shell
93+
git clone [email protected]:bids-standard/BEP028_BIDSprov.git
94+
cd BEP028_BIDSprov
95+
```
96+
97+
3. install the `bids_prov` python package :
98+
99+
```shell
100+
pip install .
101+
```
102+
103+
4. you should be able to launch the visualizer on your .jsonld files with the command `bids_prov_visualizer`
104+
105+
```shell
106+
bids_prov_visualizer --input_file graph.jsonld --output_file graph.png
107+
108+
bids_prov -h
109+
usage: bids_prov_visualizer [-h] --input_file INPUT_FILE [--output_file OUTPUT_FILE]
110+
111+
options:
112+
-h, --help show this help message and exit
113+
--input_file INPUT_FILE
114+
input BIDSprov data as a .jsonld file
115+
--output_file OUTPUT_FILE
116+
output .png file showing BIDSprov graph
117+
```
118+
119+
### Run parsers on the SPM, FSL and AFNI data
84120

85121
To obtain data in **bids-prov format**, you can use the developed parsers.
86122
* [Tutorial](https://github.com/bids-standard/BEP028_BIDSprov/blob/master/bids_prov/README.md)

bids_prov/visualize.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,15 @@ def main(filename: str, output_file=None, omit_details=True) -> None:
111111
viz_jsonld11(jsonld11, output_file)
112112

113113

114-
if __name__ == "__main__":
115-
114+
def entry_point():
115+
""" A command line tool for the visualize module """
116116
parser = argparse.ArgumentParser()
117-
parser.add_argument("--input_file", type=str, default="res.jsonld", help="data jsonld file ")
118-
parser.add_argument("--output_file", type=str, default="res.png", help="output dir where results are written")
117+
parser.add_argument("--input_file", type=str, help="input BIDSprov data as a .jsonld file ", required=True)
118+
parser.add_argument("--output_file", type=str, default="output_graph.png", help="output .png file showing BIDSprov graph")
119119
opt = parser.parse_args()
120120

121121
main(opt.input_file, output_file=opt.output_file, omit_details=True)
122122
# >> python -m bids_prov.visualize --input_file ./res_temp.jsonld --output_file res.png
123+
124+
if __name__ == "__main__":
125+
entry_point()
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Date : 2024_10_08_13h43m16s
2+
Processing files...
3+
file= nidmresults-examples/afni_alt_onesided_proc.sub_001
4+
file= nidmresults-examples/afni_alt_onesided_proc.sub_001
5+
file= nidmresults-examples/afni_bi_sided_t_test_proc.sub_001
6+
file= nidmresults-examples/afni_bi_sided_t_test_proc.sub_001
7+
file= nidmresults-examples/afni_clustconn_18_proc.sub_001
8+
file= nidmresults-examples/afni_clustconn_18_proc.sub_001
9+
file= nidmresults-examples/afni_clustconn_26_proc.sub_001
10+
file= nidmresults-examples/afni_clustconn_26_proc.sub_001
11+
file= nidmresults-examples/afni_con_f_proc.sub_001
12+
file= nidmresults-examples/afni_con_f_proc.sub_001
13+
file= nidmresults-examples/afni_default_proc.sub_001
14+
file= nidmresults-examples/afni_default_proc.sub_001
15+
file= nidmresults-examples/afni_gam_proc.sub_001
16+
file= nidmresults-examples/afni_gam_proc.sub_001
17+
file= nidmresults-examples/afni_hrf_gammadiff_proc.sub_001
18+
file= nidmresults-examples/afni_hrf_gammadiff_proc.sub_001
19+
file= nidmresults-examples/afni_hrf_tent_proc.sub_001
20+
file= nidmresults-examples/afni_hrf_tent_proc.sub_001
21+
file= nidmresults-examples/afni_other_template_proc.sub_001
22+
file= nidmresults-examples/afni_other_template_proc.sub_001
23+
file= nidmresults-examples/afni_thr_clustfwep05_proc.sub_001
24+
file= nidmresults-examples/afni_thr_clustfwep05_proc.sub_001
25+
file= nidmresults-examples/afni_thr_clustunck10_proc.sub_001
26+
file= nidmresults-examples/afni_thr_clustunck10_proc.sub_001
27+
file= nidmresults-examples/afni_thr_voxelfdrp05_proc.sub_001
28+
file= nidmresults-examples/afni_thr_voxelfdrp05_proc.sub_001
29+
file= nidmresults-examples/afni_thr_voxelunct4_proc.sub_001
30+
file= nidmresults-examples/afni_thr_voxelunct4_proc.sub_001
31+
file= nidmresults-examples/fsl_con_f_multiple_report_log.html
32+
file= nidmresults-examples/fsl_con_f_report_log.html
33+
file= nidmresults-examples/fsl_contrast_mask_report_log.html
34+
file= nidmresults-examples/fsl_default_report_log.html
35+
file= nidmresults-examples/fsl_full_examples001_report_log.html
36+
file= nidmresults-examples/fsl_gamma_basis_report_log.html
37+
file= nidmresults-examples/fsl_gaussian_report_log.html
38+
file= nidmresults-examples/fsl_group_btw_report_log.html
39+
file= nidmresults-examples/fsl_group_ols_report_log.html
40+
file= nidmresults-examples/fsl_group_wls_report_log.html
41+
file= nidmresults-examples/fsl_hrf_fir_report_log.html
42+
file= nidmresults-examples/fsl_hrf_gammadiff_report_log.html
43+
file= nidmresults-examples/fsl_motion_reg_der_report_log.html
44+
file= nidmresults-examples/fsl_motion_reg_report_log.html
45+
file= nidmresults-examples/fsl_thr_clustfwep05_report_log.html
46+
file= nidmresults-examples/fsl_thr_voxelfwep05_report_log.html
47+
file= nidmresults-examples/narps_do_02_pc_with_sign0.tcsh
48+
file= nidmresults-examples/narps_do_02_pc_with_sign0.tcsh
49+
file= nidmresults-examples/narps_do_04_make_imgs_A.tcsh
50+
file= nidmresults-examples/narps_do_04_make_imgs_A.tcsh
51+
file= nidmresults-examples/narps_do_13_view_zoom.tcsh
52+
file= nidmresults-examples/narps_do_13_view_zoom.tcsh
53+
file= nidmresults-examples/spm_2_t_test_batch.m
54+
file= nidmresults-examples/spm_HRF_informed_basis_batch.m
55+
file= nidmresults-examples/spm_con_f_batch.m
56+
file= nidmresults-examples/spm_conjunction_batch.m
57+
file= nidmresults-examples/spm_contrast_mask_batch.m
58+
file= nidmresults-examples/spm_covariate_batch.m
59+
file= nidmresults-examples/spm_default_batch.m
60+
file= nidmresults-examples/spm_explicit_mask_batch.m
61+
file= nidmresults-examples/spm_group_ols_batch.m
62+
file= nidmresults-examples/spm_group_wls_batch.m
63+
file= nidmresults-examples/spm_hrf_fir_batch.m
64+
file= nidmresults-examples/spm_non_sphericity_batch.m
65+
file= nidmresults-examples/spm_partial_conjunction_batch.m
66+
file= nidmresults-examples/spm_temporal_derivative_batch.m
67+
file= nidmresults-examples/spm_thr_clustfwep05_batch.m
68+
file= nidmresults-examples/spm_thr_clustunck10_batch.m
69+
file= nidmresults-examples/spm_thr_voxelfdrp05_batch.m
70+
file= nidmresults-examples/spm_thr_voxelfwep05_batch.m
71+
file= nidmresults-examples/spm_thr_voxelunct4_batch.m
72+
End of processed files. Results in dir : 'examples/from_parsers'. Time required: 0:00:02.150151

pyproject.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[build-system]
2+
requires = ["poetry-core"]
3+
build-backend = "poetry.core.masonry.api"
4+
5+
[tool.poetry]
6+
name = "bids_prov"
7+
authors = [
8+
"Camille Maumet",
9+
"Satrajit Ghosh",
10+
"Stefan Appelhoff",
11+
"Chris Markiewicz",
12+
"Yaroslav Halchenko",
13+
"Jean-Baptiste Poline",
14+
"Rémi Adon",
15+
"Hermann Courteille",
16+
"Thomas Betton",
17+
"Cyril Regan",
18+
"Boris Clénet"
19+
]
20+
description = "BIDS extension proposal 28 : BIDS Provenance"
21+
version = "0.1.0"
22+
readme = "README.md"
23+
requires-python = ">=3.10, <3.11"
24+
license = "CC-BY-4.0"
25+
classifiers = [
26+
"Intended Audience :: Science/Research",
27+
"Programming Language :: Python :: 3",
28+
"Topic :: Scientific/Engineering",
29+
"Topic :: Scientific/Engineering :: Medical Science Apps."
30+
]
31+
include = ["bids_prov/visualize.py"]
32+
exclude = ["bids_prov*"]
33+
34+
[tool.poetry.dependencies]
35+
python = "^3.10.0"
36+
beautifulsoup4 = "^4.12.3"
37+
boutiques = "^0.5.26"
38+
click = "^8.1.7"
39+
deepdiff = "^7.0.1"
40+
graphviz = "^0.20.3"
41+
rdflib = "^7.0.0"
42+
rdflib-jsonld = "^0.6.2"
43+
prov = "^2.0.0"
44+
pydot = "^2.0.0"
45+
pyld = "^2.0.4"
46+
pyyaml = "^6.0.1"
47+
requests = "^2.32.3"
48+
49+
[tool.poetry.group.dev.dependencies]
50+
black = "^24.4.2"
51+
markdownify = "^0.12.1"
52+
pre-commit = "^3.7.1"
53+
pytest-cov = "^5.0.0"
54+
55+
[tool.poetry.scripts]
56+
bids_prov_visualizer = "bids_prov.visualize:entry_point"

0 commit comments

Comments
 (0)