Skip to content

Replace nipreps.json with schema-driven config generation#1023

Draft
astewartau wants to merge 7 commits intonipreps:masterfrom
astewartau:feat/use-pybids-config-gen
Draft

Replace nipreps.json with schema-driven config generation#1023
astewartau wants to merge 7 commits intonipreps:masterfrom
astewartau:feat/use-pybids-config-gen

Conversation

@astewartau
Copy link

@astewartau astewartau commented Feb 12, 2026

Summary

  • Replaces the hand-maintained nipreps.json config with schema-driven config generation from pybids
  • Standard derivative patterns come from the BIDS schema (rule_groups=["deriv"]) with NiPreps-specific hash entity injection
  • 28 NiPreps-specific patterns replaced by compact extra_rules dicts that declare only datatypes, suffixes, extensions, and entity deviations—entity ordering and standard entities are inherited from the schema
  • 5 figure patterns kept as literal strings due to non-standard directory layout
  • Entity overrides rename schema keys to short BIDS names (descriptiondesc, hemispherehemi, etc.)

Depends on bids-standard/pybids#1215

Test plan

  • Cross-repo: niworkflows test suite validates end-to-end that schema-generated + extra_rules patterns produce identical behavior for all 266 test cases

@astewartau astewartau marked this pull request as draft February 12, 2026 06:16
@astewartau astewartau force-pushed the feat/use-pybids-config-gen branch from 0c52365 to f68145b Compare February 12, 2026 06:30
Entity definitions are now generated from the BIDS schema via pybids'
generate_extended_config(). NiPreps-specific entities (hash, fmapid,
pvc) and the figures datatype are layered on via ConfigExtension.

Path patterns are defined inline as they all use NiPreps-specific
entities and suffixes. The reports module now receives the generated
config dict directly via add_config_paths().

nipreps.json is no longer needed and has been removed.
Convert 28 monolithic pattern strings to compact rule dicts that specify
only datatypes, suffixes, extensions, and entity deviations. Entity
ordering and standard derivative entities are inherited from the BIDS
schema. Figures patterns remain as literal strings due to their
non-standard directory layout.
@astewartau astewartau force-pushed the feat/use-pybids-config-gen branch from f8198cb to df574cd Compare February 12, 2026 13:54
pre-commit-ci bot and others added 5 commits February 12, 2026 13:57
…ules

Schema splits .json into sidecar patterns, but DerivativesDataSink outputs
.nii + .json together as multi-file, requiring a single pattern with all
extensions. Document this and other reasons for apparent redundancy.
…a_rules

With sidecar_split=False, schema derivative patterns include all extensions
in a single pattern, so extra_rules no longer need to duplicate schema-known
suffixes for multi-file output. Remove 22 redundant suffixes from 3 rules:
- anat: keep only MTw, TSE (removed 16 schema suffixes)
- func: keep only boldref, boldmap (removed 4 schema suffixes)
- dwi: keep only dwiref, epiref, lowb (removed 2 schema suffixes)
- Extract _SURFACE_SUFFIXES, _SCALAR_SUFFIXES, _CIFTI_EXTENSIONS constants
- Merge xfm rules for anat/func/dwi into one multi-datatype rule
- Merge fmap fieldmap + mask into one rule
- Rename _PET_EXTRA_ENTITIES -> _PET_ENTITIES, _PERF_EXTRA_ENTITIES -> _PERF_ENTITIES
- Reorganize rules by category (transforms, surfaces, CIFTI, then per-datatype)

28 rules -> 25 rules, -95 lines net.
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.

1 participant