Skip to content

Should this repo get 2nd life as bids-cmdline or smth like that? #2

Description

@yarikoptic

For a while I felt the need, and at some point expressed it (but forgot where), to get a command line (or may be eventually some GUI) utility to manipulate a BIDS dataset. Quite often due to inherent redundancy, some trivial operations are not that trivial. E.g.

note: the list has being edited (last in March 2026) to reflect discovered needs

List of commands/needs with priorities

  • migrate (need: high): establish migration path(s) to address deprecations and potential breaking changes for BIDS 2.0
  • renaming a subject (need: medium): (codename subject-rename for now) requires
    • renaming sub- directory
      • possibly also under sourcedata/ (and who knows -- may be .heudiconv/)
    • renaming every file under that directory since they all carry sub- prefix
      • possibly also under sourcedata/
    • fixing up _scans file as well since that is where those files are listed as well
  • remove a subject[/session] (need: low)
  • remove a run (need: low) while shifting all subsequent run indexes
  • rename or fix a filename (need: high) (just rename) - could be used by subject-rename -- since a file might have a side car file, and then listed in _scans, might come handy
    • some non-BIDS compliant file, e.g. having spurious suffix like a _test
    • prototypes:
  • renaming a session (need: medium) (session-rename)
  • moving into a session (need: medium) (session-rename '' session) -- whenever dataset (or a specific subject?) was collected without any session'ing, and then multiple sessions decided to be taken
  • merge datasets (need: low) - implementation might relate to Moving into a session. Take two datasets (possibly without sessions) and then merge them either by
    • just combining subjects (and failing if conflicting)
    • placing each one into a (specified) session
    • using subjects (re)mapping file
  • bubble-up/condense/organize metadata (need: medium) - move common (meta)data up in the hierarchy to make BIDS dataset easier for users to find at higher level, and not duplicated underneath (

Various related ideas

Testing

  • we have outstanding and well maintained https://github.com/bids-standard/bids-examples/ of valid datasets of different kinds. We must make as much use of it as possible, e.g.
    • for each command sweep through datasets, perform basic operation(s) they implement while verifying that valid (before) datasets remain valid after the operation!

Extra features

  • git/git-annex awareness (need: medium):
    • Ideally the tool should be aware of git and/or git-annex, i.e. that files might be under VCS and then should use corresponding VCS functions.
    • If for the function we need content of the files it could either be obtained (datalad get) or accessed transparently remotely (through fsspec + info from annex. See https://github.com/datalad/datalad-fuse/ providing support interfaces

Originally I thought to propose this development within pybids, but per-se such utility (bids) does not have to (although likely will) be implemented using pybids. Some functionalities, which operate on BIDS-compliant datasets, could be achieved via re-layouting using pybids, but then it should also become capable to capture those under .heudiconv and sourcedata/ which is not strongly "prescribed" in BIDS (there is only a recommendation to follow BIDS naming there as well)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions