Generate a dataset report

Here we generate a methods writeup from a synthetic test dataset using BIDSReport.

[1]:
from os.path import join

import rich
from bids.layout import BIDSLayout
from bids.tests import get_test_data_path
[2]:
layout = BIDSLayout(join(get_test_data_path(), "synthetic"))
[3]:
from bids.ext.reports import BIDSReport

report = BIDSReport(layout)
counter = report.generate(session="01")
/home/remi/github/bids/pybids-reports/env/lib/python3.11/site-packages/bids/layout/models.py:229: UserWarning: Accessing entities as attributes is deprecated as of 0.7. Please use the .entities dictionary instead (i.e., .entities['run'] instead of .run.
  warnings.warn("Accessing entities as attributes is deprecated as "
[15:55:32] INFO     Number of patterns detected: 1                                                    report.py:182
           INFO     Remember to double-check everything and to replace <deg> with a degree symbol.    report.py:184
[4]:
rich.print(counter.most_common()[0][0])
In session 01,
MRI data were acquired using a  system.

One run of   UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo structural MRI data were collected (repetition 
time, TR= 2500.0 ms; flip angle, FA= 8°; echo time, TE= 2.9 ms; field of view FOV= 256x256 mm; matrix size= 
256x256; voxel size= 1x1x1 mm; UNKNOWN slices).

One run of   UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo structural MRI data were collected (repetition 
time, TR= 2500.0 ms; flip angle, FA= 8°; echo time, TE= 2.9 ms; field of view FOV= 256x256 mm; matrix size= 
256x256; voxel size= 1x1x1 mm; UNKNOWN slices).

One run of  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT diffusion-weighted-imaging () data were collected (68 slices;
repetition time, TR= 8400.0 ms; flip angle, FA= 90°; echo time, TE= 90 ms; field of view FOV= 128x128 mm; matrix 
size= 64x64; voxel size= 2x2x2 mm; b-values of 0 and 1000 acquired; 64 diffusion directions;  ).



A  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT field map (repetition time, TR= 400.0 ms; flip angle, FA= 60.0°; echo 
time 1 / 2, TE 1/2= 519000.0/519000.0 ms; phase encoding: anterior to posterior; field of view FOV= 256x256 mm; 
matrix size= 256x256; voxel size= 1x1x1 mm; UNKNOWN slices) was acquired for the first and second runs of the 
N-Back BOLD scan.

For the N-Back task Two runs of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were 
collected. The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; 
echo time, TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 
For the N-Back task Two runs of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were 
collected. The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; 
echo time, TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 
For the Rest task One run of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were collected. 
The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; echo time, 
TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 
For the Rest task One run of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were collected. 
The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; echo time, 
TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 
One run of   UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo structural MRI data were collected (repetition 
time, TR= 2500.0 ms; flip angle, FA= 8°; echo time, TE= 2.9 ms; field of view FOV= 256x256 mm; matrix size= 
256x256; voxel size= 1x1x1 mm; UNKNOWN slices).

One run of   UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo structural MRI data were collected (repetition 
time, TR= 2500.0 ms; flip angle, FA= 8°; echo time, TE= 2.9 ms; field of view FOV= 256x256 mm; matrix size= 
256x256; voxel size= 1x1x1 mm; UNKNOWN slices).

For the N-Back task Two runs of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were 
collected. The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; 
echo time, TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 
For the N-Back task Two runs of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were 
collected. The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; 
echo time, TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 
For the Rest task One run of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were collected. 
The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; echo time, 
TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 
For the Rest task One run of bold  UNKNOwN SEQUENCE UNKNOWN SEQUENCE VARIANT single-echo fMRI data were collected. 
The acquisition parameters were: UNKNOWN slices acquired in a  fashion; repetition time, TR= 2500.0 ms; echo time, 
TE= 30 ms;    field of view FOV= 128x128 mm; matrix size= 64x64; voxel size= 2x2x2 mm;
Each run was 2:40 minutes in length, during which 64 functional volumes were acquired.

Participants were specifically instructed to: 

Dicoms were converted to NIfTI-1 format.