Skip to content

nibabel2bids does not rename .bval/.bvec sidecars to match BIDS filenames #291

Description

@jeanbaptiste-billaud

Describe the bug
When using the nibabel2bids plugin to convert NIfTI datasets:

  1. Diffusion sidecar files (.bval, .bvec) are copied into the BIDS output directory but are not renamed to match the BIDS filename of the corresponding DWI file.
  2. JSON sidecars are not consistently generated for non-BOLD modalities (e.g. DWI, T1w), even when metadata should be present.

This leads to non-BIDS-compliant outputs.
No explicit error is raised in the logs, but the resulting dataset structure is incorrect.

To reproduce
Steps to reproduce the behavior:

  1. Take a raw nifti dataset, i.e. https://fcon_1000.projects.nitrc.org/indi/CoRR/html/ipcas_1.html
  2. Run bidsmapper and bidscoiner using the nibabel2bids plugin
  3. inspect the output directory: bids/sub-XXXX/ses-1/dwi/
  4. Observe:
  • .bval / .bvec are present but not renamed
  • .json may be missing for DWI or other modalities

Expected behavior
The output should be fully BIDS-compliant:

sub-XXXX_ses-1_acq-XXX_dwi.nii.gz
sub-XXXX_ses-1_acq-XXX_dwi.bval
sub-XXXX_ses-1_acq-XXX_dwi.bvec
sub-XXXX_ses-1_acq-XXX_dwi.json

Similarly, other modalities (e.g. T1w) should always include a .json sidecar.

Software version

  • BIDS-version: 1.10.0
  • BIDScoin-version: 4.6.2
  • OS: Linux (Ubuntu 24.04)

Additional context
The same dataset processed with ezBIDS produces fully BIDS-compliant outputs:

  • correctly renamed .bval / .bvec
  • proper .json sidecars for all modalities

This suggests the issue is specific to the nibabel2bids plugin rather than the input dataset.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions