Skip to content

Add BIDS entrypoint, smoke tests, and routing fixes#841

Open
karl-koschutnig wants to merge 2 commits into
Deep-MI:devfrom
karl-koschutnig:dev
Open

Add BIDS entrypoint, smoke tests, and routing fixes#841
karl-koschutnig wants to merge 2 commits into
Deep-MI:devfrom
karl-koschutnig:dev

Conversation

@karl-koschutnig

Copy link
Copy Markdown

Description

This PR adds initial BIDS support to FastSurfer via a new run_fastsurfer_bids.py entrypoint.

Scope

  • discover subjects/sessions from a BIDS dataset using pybids
  • route single-session cases to brun_fastsurfer.sh
  • route multi-session cases to long_fastsurfer.sh
  • support participant/session filtering
  • write a minimal derivatives dataset_description.json

Tests / developer workflow

  • added unit coverage for BIDS discovery/routing
  • added an OpenNeuro smoke test based on ds004937
    • one single-session subject
    • one multi-session subject
  • added a small developer wrapper to run the BIDS smoke checks quickly

Routing fix

During testing, --seg_only exposed an invalid path where multi-session BIDS subjects were still being sent to long_fastsurfer.sh, which does not support --seg_only / --surf_only.

This PR fixes that by forcing cross-sectional routing when those passthrough flags are present.

Additional fix included

While validating cross-sectional runs, the Corpus Callosum pipeline failed under NumPy 2.x because it used np.cross() on 2D vectors. This PR replaces those calls with an explicit signed 2D cross-product and adds a regression test.

Validated

  • targeted pytest coverage for BIDS logic
  • OpenNeuro dry-run smoke test
  • --seg_only cross-sectional routing
  • mixed dry-run routing (brun + long)
  • CC NumPy 2.x regression test

Out of scope / missing

  • no BIDS-aware srun_fastsurfer.sh integration yet
  • SLURM support would need separate orchestration for cross-sectional vs longitudinal BIDS cases

- Introduced run_fastsurfer_bids.py as a BIDS-App entrypoint for FastSurfer.
- Added BIDS dataset discovery and processing logic.
- Updated README.md to include usage instructions for BIDS.
- Created BIDS.md documentation for detailed BIDS entrypoint information.
- Added integration tests for BIDS functionality and fetching OpenNeuro dataset.
- Included necessary dependencies in pyproject.toml for BIDS support.
- Added a developer-oriented smoke test for the BIDS add-on.
- Updated `test_bids_openneuro.sh` to include new usage options.
- Introduced `_requires_cross_sectional_passthrough` function to handle passthrough flags.
- Added tests for the new passthrough functionality.
- Improved documentation in BIDS.md and README.md for clarity on new options.
@m-reuter

m-reuter commented Jul 9, 2026

Copy link
Copy Markdown
Member

Hi , thanks, we will take a look. One thing up front, fixes should not be mixed into feature PRs . Can you do a separate PR for the CC numpy 2 fix (and @ClePol can check that). After merging it, we can rebase this one.

@karl-koschutnig

Copy link
Copy Markdown
Author

Thanks, Martin, for your prompt response.
I’ve created a separate PR.
Best,
Karl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants