Skip to content

Commit 2f634a1

Browse files
authored
Merge pull request #472 from bids-standard/bids_website
[MAINT] update dataset listing
2 parents 38e3467 + f08050f commit 2f634a1

File tree

3 files changed

+72
-26
lines changed

3 files changed

+72
-26
lines changed

README.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,19 @@ DO NOT EDIT DIRECTLY.
136136
| [asl004](https://github.com/bids-standard/bids-examples/tree/master/asl004) | T1w, asl (Siemens, PCASL, multiPLD with pepolar), m0scan separate scans with pepolar approach | anat, fmap, perf | T1w, asl, aslcontext, asllabeling, m0scan | [link](https://osf.io/yru2q/) | [@patsycle](https://github.com/patsycle) |
137137
| [asl005](https://github.com/bids-standard/bids-examples/tree/master/asl005) | T1w, asl (Siemens, PCASL, singleTI, 3D_GRASE), m0scan as separate scan | anat, perf | T1w, asl, aslcontext, asllabeling, m0scan | [link](https://osf.io/yru2q/) | [@patsycle](https://github.com/patsycle) |
138138

139+
### Behavioral
140+
141+
<!--
142+
TABLE BELOW IS GENERATED AUTOMATICALLY.
143+
DO NOT EDIT DIRECTLY.
144+
-->
145+
146+
| name | description | datatypes | suffixes | link to full data | maintained by |
147+
|:------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------|:--------------------------------|:---------------------------------------------------------------------------------------------------------------|:-------------------------------------------------|:-------------------------------------------|
148+
| [ds000117](https://github.com/bids-standard/bids-examples/tree/master/ds000117) | A multi-subject, multi-modal human neuroimaging dataset of 19 subjects on a MEG visual task | anat, beh, dwi, fmap, func, meg | FLASH, T1w, bold, channels, coordsystem, dwi, events, headshape, magnitude1, magnitude2, meg, phasediff, scans | [link](https://openneuro.org/datasets/ds000117/) | [@RikHenson](https://github.com/RikHenson) |
149+
| [eeg_ds003645s_hed_demo](https://github.com/bids-standard/bids-examples/tree/master/eeg_ds003645s_hed_demo) | Shows usage of Hierarchical Event Descriptor (HED) in .tsv files | anat, beh, eeg, micr, motion | KSSSleep, SPIM, beh, channels, coordsystem, defacemask, eeg, electrodes, events, motion, photo, samples, scans | [link](https://openneuro.org/datasets/ds003645) | [@VisLab](https://github.com/VisLab) |
150+
| [synthetic](https://github.com/bids-standard/bids-examples/tree/master/synthetic) | A synthetic dataset | anat, beh, func | T1w, beh, bold, events, physio, scans, sessions, stim | n/a | [@effigies](https://github.com/effigies) |
151+
139152
### EEG
140153

141154
<!--
@@ -151,6 +164,21 @@ DO NOT EDIT DIRECTLY.
151164
| [eeg_matchingpennies](https://github.com/bids-standard/bids-examples/tree/master/eeg_matchingpennies) | Offline data of BCI experiment decoding left vs. right hand movement. BrainVision data format (.eeg, .vhdr, .vmrk) | eeg | channels, eeg, events | [link](https://doi.org/10.17605/OSF.IO/CJ2DR) | [@sappelhoff](https://github.com/sappelhoff) |
152165
| [eeg_rishikesh](https://github.com/bids-standard/bids-examples/tree/master/eeg_rishikesh) | Mind wandering experiment. EEG data in Biosemi (.bdf) format | eeg | channels, eeg, events | [link](https://openneuro.org/datasets/ds001787) | [@arnodelorme](https://github.com/arnodelorme) |
153166

167+
### DWI
168+
169+
<!--
170+
TABLE BELOW IS GENERATED AUTOMATICALLY.
171+
DO NOT EDIT DIRECTLY.
172+
-->
173+
174+
| name | description | datatypes | suffixes | link to full data | maintained by |
175+
|:------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------|:--------------------------------|:---------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|:-------------------------------------------|
176+
| [ds000117](https://github.com/bids-standard/bids-examples/tree/master/ds000117) | A multi-subject, multi-modal human neuroimaging dataset of 19 subjects on a MEG visual task | anat, beh, dwi, fmap, func, meg | FLASH, T1w, bold, channels, coordsystem, dwi, events, headshape, magnitude1, magnitude2, meg, phasediff, scans | [link](https://openneuro.org/datasets/ds000117/) | [@RikHenson](https://github.com/RikHenson) |
177+
| [ds114](https://github.com/bids-standard/bids-examples/tree/master/ds114) | multiple tasks, multiple runs | anat, dwi, func | T1w, bold, dwi, events | [link](https://openneuro.org/datasets/ds000114/versions/1.0.1) | n/a |
178+
| [dwi_deriv](https://github.com/bids-standard/bids-examples/tree/master/dwi_deriv) | exemplifies the storage of diffusion MRI derivates that may be generated on the Siemens XA platform. | dwi | dwi | n/a | n/a |
179+
| [eeg_rest_fmri](https://github.com/bids-standard/bids-examples/tree/master/eeg_rest_fmri) | Resting state with simultaneous fMRI. BrainVision data format (.eeg, .vhdr, .vmrk) | anat, dwi, eeg, func | T1w, bold, dwi, eeg | n/a | [@cpernet](https://github.com/cpernet) |
180+
| [genetics_ukbb](https://github.com/bids-standard/bids-examples/tree/master/genetics_ukbb) | multiple tasks, T1w, DTI, BOLD, genetic info | anat, dwi, func | FLAIR, T1w, bold, dwi, events, info | n/a | [@cpernet](https://github.com/cpernet) |
181+
154182
### iEEG
155183

156184
<!--
@@ -167,6 +195,20 @@ DO NOT EDIT DIRECTLY.
167195
| [ieeg_motorMiller2007](https://github.com/bids-standard/bids-examples/tree/master/ieeg_motorMiller2007) | Cue-based hand & tongue movement data | ieeg | channels, coordsystem, electrodes, events, ieeg | n/a | [@dorahermes](https://github.com/dorahermes) |
168196
| [ieeg_visual](https://github.com/bids-standard/bids-examples/tree/master/ieeg_visual) | Stimulus dependence of gamma oscillations in human visual cortex | anat, ieeg | T1w, channels, coordsystem, electrodes, events, ieeg | n/a | [@dorahermes](https://github.com/dorahermes) |
169197
| [ieeg_visual_multimodal](https://github.com/bids-standard/bids-examples/tree/master/ieeg_visual_multimodal) | n/a | anat, fmap, func, ieeg | T1w, bold, channels, coordsystem, electrodes, epi, events, ieeg, sbref | n/a | [@irisgroen](https://github.com/irisgroen) |
198+
| [xeeg_hed_score](https://github.com/bids-standard/bids-examples/tree/master/xeeg_hed_score) | EEG and iEEG data with annotations of artifacts, seizures and modulators using HED-SCORE | anat, eeg, ieeg | T1w, channels, coordsystem, eeg, electrodes, events, ieeg | n/a | [@dorahermes](https://github.com/dorahermes) |
199+
200+
### HED
201+
202+
<!--
203+
TABLE BELOW IS GENERATED AUTOMATICALLY.
204+
DO NOT EDIT DIRECTLY.
205+
-->
206+
207+
| name | description | datatypes | suffixes | link to full data | maintained by |
208+
|:------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------|:-----------------------------|:---------------------------------------------------------------------------------------------------------------|:------------------------------------------------|:---------------------------------------------|
209+
| [eeg_ds003645s_hed_demo](https://github.com/bids-standard/bids-examples/tree/master/eeg_ds003645s_hed_demo) | Shows usage of Hierarchical Event Descriptor (HED) in .tsv files | anat, beh, eeg, micr, motion | KSSSleep, SPIM, beh, channels, coordsystem, defacemask, eeg, electrodes, events, motion, photo, samples, scans | [link](https://openneuro.org/datasets/ds003645) | [@VisLab](https://github.com/VisLab) |
210+
| [eeg_ds003645s_hed_library](https://github.com/bids-standard/bids-examples/tree/master/eeg_ds003645s_hed_library) | HED annotation using HED library vocabularies (schema). | eeg | channels, eeg, events | [link](https://openneuro.org/datasets/ds003645) | [@VisLab](https://github.com/VisLab) |
211+
| [xeeg_hed_score](https://github.com/bids-standard/bids-examples/tree/master/xeeg_hed_score) | EEG and iEEG data with annotations of artifacts, seizures and modulators using HED-SCORE | anat, eeg, ieeg | T1w, channels, coordsystem, eeg, electrodes, events, ieeg | n/a | [@dorahermes](https://github.com/dorahermes) |
170212

171213
### MEG
172214

@@ -309,16 +351,3 @@ DO NOT EDIT DIRECTLY.
309351
| [qmri_sa2rage](https://github.com/bids-standard/bids-examples/tree/master/qmri_sa2rage) | Fast B1+ mapping using SA2RAGE | fmap | TB1SRGE | `not publicly available` | [@agahkarakuzu](https://github.com/agahkarakuzu) |
310352
| [qmri_tb1tfl](https://github.com/bids-standard/bids-examples/tree/master/qmri_tb1tfl) | B1+ mapping with TurboFLASH readout. | fmap | TB1TFL | `not publicly available` | [@agahkarakuzu](https://github.com/agahkarakuzu) |
311353
| [qmri_vfa](https://github.com/bids-standard/bids-examples/tree/master/qmri_vfa) | Variable Flip Angle T1 mapping. Includes an Actual Flip Angle (AFI) B1+ mapping example. | anat, fmap | TB1AFI, VFA | [link](https://osf.io/k4bs5/) | [@agahkarakuzu](https://github.com/agahkarakuzu) |
312-
313-
### Behavioral
314-
315-
<!--
316-
TABLE BELOW IS GENERATED AUTOMATICALLY.
317-
DO NOT EDIT DIRECTLY.
318-
-->
319-
320-
| name | description | datatypes | suffixes | link to full data | maintained by |
321-
|:------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------|:--------------------------------|:---------------------------------------------------------------------------------------------------------------|:-------------------------------------------------|:-------------------------------------------|
322-
| [ds000117](https://github.com/bids-standard/bids-examples/tree/master/ds000117) | A multi-subject, multi-modal human neuroimaging dataset of 19 subjects on a MEG visual task | anat, beh, dwi, fmap, func, meg | FLASH, T1w, bold, channels, coordsystem, dwi, events, headshape, magnitude1, magnitude2, meg, phasediff, scans | [link](https://openneuro.org/datasets/ds000117/) | [@RikHenson](https://github.com/RikHenson) |
323-
| [eeg_ds003645s_hed_demo](https://github.com/bids-standard/bids-examples/tree/master/eeg_ds003645s_hed_demo) | Shows usage of Hierarchical Event Descriptor (HED) in .tsv files | anat, beh, eeg, micr, motion | KSSSleep, SPIM, beh, channels, coordsystem, defacemask, eeg, electrodes, events, motion, photo, samples, scans | [link](https://openneuro.org/datasets/ds003645) | [@VisLab](https://github.com/VisLab) |
324-
| [synthetic](https://github.com/bids-standard/bids-examples/tree/master/synthetic) | A synthetic dataset | anat, beh, func | T1w, beh, bold, events, physio, scans, sessions, stim | n/a | [@effigies](https://github.com/effigies) |

dataset_listing.tsv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ mrs_2dmrsi 2D sLASER MRSI data from 8 subjects [link](https://zenodo.org/records
8080
mrs_biggaba MEGA-PRESS and PRESS MRS data from 12 subjects from one site from the Big GABA project [link](https://www.nitrc.org/projects/biggaba) [@markmikkelsen](https://github.com/markmikkelsen) anat, mrs T1w, mrsref, svs
8181
mrs_fmrs Functional MRS data involving a pain stimulus task from 15 subjects [link](https://www.nitrc.org/projects/fmrs_2020) [@markmikkelsen](https://github.com/markmikkelsen) anat, mrs T1w, events, mrsref, svs
8282
2d_mb_pcasl Siemens 2D MultiBand Multi-delay PCASL (m0 and noRF included within timeseries) [link](https://osf.io/xrkc4/) [@aptinis](https://github.com/aptinis) anat, fmap, perf T1w, asl, aslcontext, epi
83-
xeeg_hed_score EEG and iEEG data with annotations of artifacts, seizures and modulators using HED-SCORE [@dorahermes](https://github.com/dorahermes) eeg, anat, ieeg channels, coordsystem, electrodes, events, ieeg, eeg, T1w
83+
xeeg_hed_score EEG and iEEG data with annotations of artifacts, seizures and modulators using HED-SCORE [@dorahermes](https://github.com/dorahermes) anat, eeg, ieeg T1w, channels, coordsystem, eeg, electrodes, events, ieeg
84+
dwi_deriv exemplifies the storage of diffusion MRI derivates that may be generated on the Siemens XA platform. dwi dwi

tools/print_dataset_listing.py

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
You can pass an argument to insert the content in another file.
55
Otherwise the content will be added to the README of this repository.
66
"""
7+
78
import sys
89
from pathlib import Path
910
import pandas as pd
1011
from bids import BIDSLayout
12+
from rich import print
1113

1214
folders_to_skip = ["docs", ".git", ".github", "tools", "env", "site", ".vscode"]
1315
suffixes_to_remove = ["README", "description", "participants", "CITATION"]
@@ -23,15 +25,18 @@
2325
UPSTREAM_REPO = "https://github.com/bids-standard/bids-examples/tree/master/"
2426

2527
# set to True to update the listing of datasets with the datatypes and suffixes
26-
update_content = True
28+
update_content = False
2729

2830
root = Path(__file__).resolve().parent.parent
2931
input_file = root / "dataset_listing.tsv"
3032

3133
tables_order = {
3234
"ASL": "perf",
35+
"Behavioral": "beh",
3336
"EEG": "^eeg$",
37+
"DWI": "dwi",
3438
"iEEG": "ieeg",
39+
"HED": "",
3540
"MEG": "meg",
3641
"Microscopy": "micr",
3742
"Motion": "motion",
@@ -40,11 +45,11 @@
4045
"NIRS": "nirs",
4146
"PET": "pet",
4247
"qMRI": "",
43-
"Behavioral": "beh",
4448
}
4549

4650
DELIMITER = "<!-- ADD EXAMPLE LISTING HERE -->"
4751

52+
4853
def main(output_file=None):
4954

5055
if len(sys.argv) > 1:
@@ -55,6 +60,8 @@ def main(output_file=None):
5560

5661
df = pd.read_csv(input_file, sep="\t")
5762

63+
names = df["name"].copy()
64+
5865
check_missing_folders(df, root)
5966

6067
if update_content:
@@ -64,12 +71,10 @@ def main(output_file=None):
6471

6572
df = add_links(df)
6673

67-
print(df)
68-
6974
clean_previous_run(output_file)
7075

7176
df = df[column_order]
72-
add_tables(df, output_file)
77+
add_tables(df, output_file, names)
7378

7479

7580
def check_missing_folders(df, root):
@@ -93,10 +98,12 @@ def update_datatypes_and_suffixes(df, root):
9398
layout = BIDSLayout(root / row[1]["name"])
9499

95100
tmp = sorted(layout.get_datatypes()) or ["n/a"]
101+
print(f" {tmp}")
96102
datatypes.append(stringify_list(tmp))
97103

98104
tmp = layout.get_suffixes()
99105
tmp = sorted([s for s in tmp if s not in suffixes_to_remove]) or ["n/a"]
106+
print(f" {tmp}")
100107
suffixes.append(stringify_list(tmp))
101108

102109
if not datatypes:
@@ -122,7 +129,6 @@ def add_links(df):
122129
return df
123130

124131

125-
126132
def clean_previous_run(output_file: Path) -> None:
127133
print("Cleaning output files from previous run...")
128134
lines = output_file.read_text().split("\n")
@@ -134,28 +140,38 @@ def clean_previous_run(output_file: Path) -> None:
134140
break
135141
f.write(line + "\n")
136142

143+
137144
def add_warning(f):
138-
f.write("""<!--
145+
f.write(
146+
"""<!--
139147
Table below is generated automatically.
140148
Do not edit directly.
141149
-->
142150
143-
""".upper())
151+
""".upper()
152+
)
153+
144154

145-
def add_tables(df: pd.DataFrame, output_file: Path) -> None:
155+
def add_tables(df: pd.DataFrame, output_file: Path, names) -> None:
146156
print("Writing markdown tables...")
147157
df.fillna("n/a", inplace=True)
148158
for table_name, table_datatypes in tables_order.items():
149159
with output_file.open("a") as f:
150160
f.write(f"\n### {table_name}\n\n")
151161
add_warning(f)
162+
152163
if table_name == "qMRI":
153-
sub_df = df[df["name"].str.contains("qmri_")]
164+
mask = names.str.contains("qmri_")
165+
elif table_name == "HED":
166+
mask = names.str.contains("_hed_")
154167
else:
155-
sub_df = df[df["datatypes"].str.contains(table_datatypes, regex=True)]
168+
mask = df["datatypes"].str.contains(table_datatypes, regex=True)
169+
170+
sub_df = df[mask].copy()
156171
sub_df.sort_values(by=["name"], inplace=True)
157-
# sub_df["name"] = df["name"].apply(lambda x: f'[{x}](https://github.com/bids-standard/bids-examples/tree/master/{x})')
172+
158173
print(sub_df)
174+
159175
sub_df.to_markdown(output_file, index=False, mode="a")
160176
with output_file.open("a") as f:
161177
f.write("\n")

0 commit comments

Comments
 (0)