Skip to content

Commit 921076c

Browse files
committed
enh: continue working on BIDS
1 parent fa14d08 commit 921076c

File tree

1 file changed

+101
-23
lines changed
  • docs/assets/fmriprep-bootcamp-geneva2024/day1-02-bids

1 file changed

+101
-23
lines changed

docs/assets/fmriprep-bootcamp-geneva2024/day1-02-bids/index.html

Lines changed: 101 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -845,27 +845,64 @@
845845

846846
# BIDS Validator
847847

848+
.boxed-content[
848849
The machine-readable structure makes validation possible:
849850

850-
```bash
851-
$ deno run -A jsr:@bids/validator /data/bids/openneuro/ds000228
852-
[WARNING] JSON_KEY_RECOMMENDED A JSON file is missing a key listed as recommended.
853-
DatasetType
854-
/dataset_description.json
851+
``` bash
852+
$ bids-validator .
853+
854+
855+
1: [WARN] The recommended file /README is very small. Please consider expanding it with additional information about the dataset. (code: 213 - README_FILE_SMALL)
856+
./README
857+
858+
Please visit https://neurostars.org/search?q=README_FILE_SMALL for existing conversations about this issue.
859+
860+
Summary: Available Tasks: Available Modalities:
861+
96 Files, 6.63GB Mixed-stimuli, positive-control task MRI
862+
5 - Subjects Resting-state fMRI
863+
1 - Session
864+
865+
866+
If you have any questions, please post on https://neurostars.org/tags/bids.
867+
```
868+
869+
.center[
870+
## https://bids-standard.github.io/bids-validator/
871+
]]
872+
873+
---
874+
875+
# BIDS Validator
876+
877+
.boxed-content[
878+
Once all warnings and errors are addressed:
879+
880+
``` bash
881+
$ bids-validator .
882+
855883

856-
GeneratedBy
857-
/dataset_description.json
884+
This dataset appears to be BIDS compatible.
885+
Summary: Available Tasks: Available Modalities:
886+
96 Files, 6.63GB Mixed-stimuli, positive-control task MRI
887+
5 - Subjects Resting-state fMRI
888+
1 - Session
858889

859-
SourceDatasets
860-
/dataset_description.json
861890

862-
Please visit https://neurostars.org/search?q=JSON_KEY_RECOMMENDED for existing
863-
conversations about this issue.
864-
...
891+
If you have any questions, please post on https://neurostars.org/tags/bids.
865892
```
866893

867894
.center[
868895
## https://bids-standard.github.io/bids-validator/
896+
]]
897+
898+
---
899+
900+
# Sharing through OpenNeuro
901+
902+
.boxed-content[
903+
.center[[https://openneuro.org/datasets/ds005454/versions/1.0.0](https://openneuro.org/datasets/ds005454/versions/1.0.0)]
904+
905+
<iframe src="https://openneuro.org/datasets/ds005454/versions/1.0.0" width="100%" height="500px" style="border: 0" />
869906
]
870907

871908
---
@@ -876,12 +913,10 @@
876913
# BIDS Applications
877914

878915
---
879-
880916
A common specification of neuroimaging datasets affords queries for and
881917
adaptation to the available data.
882-
883918
--
884-
919+
.boxed-content[
885920
Queryable (meta)data allows a very simple protocol for a
886921
[BIDS App](https://bids-apps.neuroimaging.io/apps/):
887922

@@ -892,27 +927,29 @@
892927
.footnote[
893928
\* Note that `participant` is an analysis level. Apps may also operate
894929
at the `run`, `session` or `group` levels.
895-
]
930+
]]
896931

897932
--
898933

934+
.boxed-content[
899935
## Examples
900936

901937
**MRIQC**
902938

903939
```Bash
904940
mriqc /data/bids/openneuro/ds000228 /data/processed/ds000228-mriqc group
905941
```
906-
942+
]
907943
--
908944

945+
.boxed-content[
909946
**fMRIPrep**
910947

911948
```Bash
912949
fmriprep /data/bids/openneuro/ds000228 /data/processed/ds000228-fmriprep \
913950
participant --participant-label pixar001
914951
```
915-
952+
]
916953
---
917954

918955
.pull-left[
@@ -1071,6 +1108,7 @@
10711108

10721109
# PyBIDS
10731110

1111+
.boxed-content[
10741112
A common specification of neuroimaging datasets affords queries for and
10751113
adaptation to the available data.
10761114

@@ -1094,31 +1132,71 @@
10941132
'suffix': 'bold',
10951133
'task': 'rest'}
10961134
```
1097-
1135+
]
10981136
---
10991137

1100-
# PyBIDS - Derivatives
1138+
# PyBIDS | Derivatives
11011139

1140+
.boxed-content[
11021141
PyBIDS layouts support BIDS derivatives:
11031142

11041143
```Python
1105-
>>> fmri_derivs = BIDSLayout('/my_dataset-fmriprep', config=['bids', 'derivatives'], validate=False)
1144+
>>> fmri_derivs = BIDSLayout(
1145+
... '/my_dataset-fmriprep',
1146+
... config=['bids', 'derivatives'],
1147+
... validate=False,
1148+
... )
11061149
>>> spaces = fmri_derivs.get_spaces(desc='preproc', suffix='bold')
11071150
>>> spaces
11081151
['MNI152NLin2009cAsym']
11091152
```
1110-
1153+
]
11111154
--
11121155

1156+
.boxed-content[
11131157
It is also possible to provide your own config:
11141158

11151159
```Python
11161160
>>> import niworkflows
11171161
>>> nipreps_config = niworkflows.data.load('nipreps.json')
1118-
>>> fmri_derivs = BIDSLayout('/my_dataset-fmriprep, config=[nipreps_config], validate=False)
1162+
>>> fmri_derivs = BIDSLayout('/my_dataset-fmriprep', config=[nipreps_config], validate=False)
1163+
```
1164+
]
1165+
---
1166+
1167+
# PyBIDS | Large datasets
1168+
1169+
.boxed-content[
1170+
<br />
1171+
.larger[*BIDS Apps* can spend long time indexing if they rely on *PyBIDS* ]
1172+
.no-bullet[
1173+
* <i class="fa-solid fa-circle-right"></i> **create a cache**:
1174+
]
1175+
1176+
```Bash
1177+
$ pybids layout --reset-db --no-validate --index-metadata . /my_dataset/.bids-index/
11191178
```
11201179

1180+
.larger[And then inform your *BIDS App*.]
1181+
1182+
<br />
1183+
1184+
In the case of *MRIQC* and *fMRIPrep*, point the `--bids-database-dir` argument to the newly created cache:
1185+
1186+
```Bash
1187+
$ mriqc /data/input /derivatives/output participant [OPTIONS] \
1188+
--bids-database-dir /my_dataset/.bids-index/
1189+
```
1190+
1191+
```Bash
1192+
$ fmriprep /data/input /derivatives/output participant [OPTIONS] \
1193+
--bids-database-dir /my_dataset/.bids-index/
1194+
```
1195+
1196+
]
1197+
11211198
---
1199+
11221200
template: newsection
11231201

11241202
# Conclusion

0 commit comments

Comments
 (0)