Skip to content

Commit

Permalink
Merge pull request #472 from bids-standard/bids_website
Browse files Browse the repository at this point in the history
[MAINT] update dataset listing
  • Loading branch information
Remi-Gau authored Nov 10, 2024
2 parents 38e3467 + f08050f commit 2f634a1
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 26 deletions.
55 changes: 42 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@ DO NOT EDIT DIRECTLY.
| [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) |
| [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) |

### Behavioral

<!--
TABLE BELOW IS GENERATED AUTOMATICALLY.
DO NOT EDIT DIRECTLY.
-->

| name | description | datatypes | suffixes | link to full data | maintained by |
|:------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------|:--------------------------------|:---------------------------------------------------------------------------------------------------------------|:-------------------------------------------------|:-------------------------------------------|
| [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) |
| [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) |
| [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) |

### EEG

<!--
Expand All @@ -151,6 +164,21 @@ DO NOT EDIT DIRECTLY.
| [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) |
| [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) |

### DWI

<!--
TABLE BELOW IS GENERATED AUTOMATICALLY.
DO NOT EDIT DIRECTLY.
-->

| name | description | datatypes | suffixes | link to full data | maintained by |
|:------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------|:--------------------------------|:---------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|:-------------------------------------------|
| [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) |
| [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 |
| [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 |
| [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) |
| [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) |

### iEEG

<!--
Expand All @@ -167,6 +195,20 @@ DO NOT EDIT DIRECTLY.
| [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) |
| [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) |
| [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) |
| [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) |

### HED

<!--
TABLE BELOW IS GENERATED AUTOMATICALLY.
DO NOT EDIT DIRECTLY.
-->

| name | description | datatypes | suffixes | link to full data | maintained by |
|:------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------|:-----------------------------|:---------------------------------------------------------------------------------------------------------------|:------------------------------------------------|:---------------------------------------------|
| [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) |
| [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) |
| [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) |

### MEG

Expand Down Expand Up @@ -309,16 +351,3 @@ DO NOT EDIT DIRECTLY.
| [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) |
| [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) |
| [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) |

### Behavioral

<!--
TABLE BELOW IS GENERATED AUTOMATICALLY.
DO NOT EDIT DIRECTLY.
-->

| name | description | datatypes | suffixes | link to full data | maintained by |
|:------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------|:--------------------------------|:---------------------------------------------------------------------------------------------------------------|:-------------------------------------------------|:-------------------------------------------|
| [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) |
| [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) |
| [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) |
3 changes: 2 additions & 1 deletion dataset_listing.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ mrs_2dmrsi 2D sLASER MRSI data from 8 subjects [link](https://zenodo.org/records
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
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
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
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
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
dwi_deriv exemplifies the storage of diffusion MRI derivates that may be generated on the Siemens XA platform. dwi dwi
40 changes: 28 additions & 12 deletions tools/print_dataset_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
You can pass an argument to insert the content in another file.
Otherwise the content will be added to the README of this repository.
"""

import sys
from pathlib import Path
import pandas as pd
from bids import BIDSLayout
from rich import print

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

# set to True to update the listing of datasets with the datatypes and suffixes
update_content = True
update_content = False

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

tables_order = {
"ASL": "perf",
"Behavioral": "beh",
"EEG": "^eeg$",
"DWI": "dwi",
"iEEG": "ieeg",
"HED": "",
"MEG": "meg",
"Microscopy": "micr",
"Motion": "motion",
Expand All @@ -40,11 +45,11 @@
"NIRS": "nirs",
"PET": "pet",
"qMRI": "",
"Behavioral": "beh",
}

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


def main(output_file=None):

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

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

names = df["name"].copy()

check_missing_folders(df, root)

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

df = add_links(df)

print(df)

clean_previous_run(output_file)

df = df[column_order]
add_tables(df, output_file)
add_tables(df, output_file, names)


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

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

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

if not datatypes:
Expand All @@ -122,7 +129,6 @@ def add_links(df):
return df



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


def add_warning(f):
f.write("""<!--
f.write(
"""<!--
Table below is generated automatically.
Do not edit directly.
-->
""".upper())
""".upper()
)


def add_tables(df: pd.DataFrame, output_file: Path) -> None:
def add_tables(df: pd.DataFrame, output_file: Path, names) -> None:
print("Writing markdown tables...")
df.fillna("n/a", inplace=True)
for table_name, table_datatypes in tables_order.items():
with output_file.open("a") as f:
f.write(f"\n### {table_name}\n\n")
add_warning(f)

if table_name == "qMRI":
sub_df = df[df["name"].str.contains("qmri_")]
mask = names.str.contains("qmri_")
elif table_name == "HED":
mask = names.str.contains("_hed_")
else:
sub_df = df[df["datatypes"].str.contains(table_datatypes, regex=True)]
mask = df["datatypes"].str.contains(table_datatypes, regex=True)

sub_df = df[mask].copy()
sub_df.sort_values(by=["name"], inplace=True)
# sub_df["name"] = df["name"].apply(lambda x: f'[{x}](https://github.com/bids-standard/bids-examples/tree/master/{x})')

print(sub_df)

sub_df.to_markdown(output_file, index=False, mode="a")
with output_file.open("a") as f:
f.write("\n")
Expand Down

0 comments on commit 2f634a1

Please sign in to comment.