Skip to content

Feature Request: Add BIDSReport parsing support for ASL, PET, and MRS modalities #1256

Description

@anushkagupta200615-jpg

Summary

The bids.reports module currently lacks parsing functions and templates for several newer, officially supported BIDS modalities, specifically Arterial Spin Labeling (ASL), Positron Emission Tomography (PET), and Magnetic Resonance Spectroscopy (MRS).

As a result, users attempting to generate automated methods sections for datasets containing these modalities will find that the files are either skipped or generate incomplete, fallback text.

Background

Currently, the BIDSReport.generate_from_files() pipeline routes files to specific parsing functions based on their data type and suffix (e.g., func_info, anat_info, dwi_info, fmap_info). These functions are hardcoded in src/bids/reports/parsing.py and rely on a configuration mapped in src/bids/reports/config/converters.json to extract relevant JSON metadata (like RepetitionTime, EchoTime, FlipAngle) and format it into publication-ready prose.

Over the last few years, the BIDS specification has officially integrated several new modalities:

  • ASL (BEP005) - requires parsing for LabelingDuration, PostLabelingDelay, BackgroundSuppression, etc.
  • PET (BEP009) - requires parsing for TracerName, InjectedRadioactivity, ModeOfAdministration, etc.
  • MRS (BEP022) - requires parsing for WaterSuppressed, EchoTime, SpectrometerFrequency, etc.

Expected Behavior

Running report = BIDSReport(layout) and report.generate_from_files(files) on an ASL, PET, or MRS dataset should return a fully formed methods paragraph detailing the specific acquisition parameters unique to that modality, exactly as it currently does for BOLD and T1w data.

Proposed Implementation

To resolve this, we would need to:

  1. Update src/bids/reports/parsing.py: Create new dedicated parsing functions (e.g., asl_info(layout, files, config), pet_info(...), mrs_info(...)) that extract the mandatory and recommended metadata fields for each modality.
  2. Update src/bids/reports/report.py: Add routing logic to detect these suffixes/datatypes and pass them to the new parsing functions.
  3. Update converters.json: Add the corresponding metadata fields and grammatical conversion rules so that raw JSON values are correctly translated into prose.
  4. Add Tests: Include synthetic mock datasets for ASL, PET, and MRS in src/bids/tests/data/ (or use existing ones if available) and add pytest coverage in src/bids/reports/tests/test_reports.py to ensure the generated strings match expectations.

I would love to take a stab at implementing one of these modalities (e.g., ASL) if a maintainer is willing to point me in the right direction!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions