Skip to content

bids-inject-sidecar #259

Description

@yarikoptic

Relevant to

and existing bids-inject as it would be the one providing interface to extract relevant (as described in https://bids-specification--2367.org.readthedocs.build/en/2367/appendices/media-files.html for bids-standard/bids-specification#2367) metadata for any audio and/or video file into its sidecar. I foresee options

  • bids-inject-sidecar [options] FILE1[ FILE2 ...] -- operate on 1 or more audio/video files. Sidecar .json is nearby each one of those files (aggregation for inheritance principle etc will be done separately
  • [--videos-file FILE] -- option to potentially point to videos.tsv which could have already some fields cached
  • --json-mode replace,update
    • replace would replace entire .json file if already exists
    • update would just add (or refresh) fields in potentially existing .json file(s) so that
  • --add META1=VALUE, e.g. --add DeviceSerialNumber=ABC12345 --add RecordingDuration=3600 . For the field which is part of BIDS schema, it should potentially do casting into target data type if not a string
  • --existing-different error,overwrite. By default if a field already exists and the same -- all ok. If different, by default error out. But with "overwrite" just log and proceed with replacement. Treat original value n/a as no value, so if overwriting with some value -- all good. But if trying to override an existing non-n/a value with n/a -- 'error' is the default. This flag is also handling --add'ed values

Potential further enhancements (not part of this issue per se):

  • preserved json formatting: Note that modifying an existing .json file is actually can be non-trivial if you want to preserve original formatting to e.g. minimize the diff. I think it would be good time to try using (and also potentially contribute to development as well) https://github.com/bids-standard/bids-utils/ . So for this functionality, do not worry about preserving formatting, and/or use bids-utils.
  • add support for image files as here we deal only with audio/video

Metadata

Metadata

Assignees

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