[ENH] BEP047 - Add audio/video recordings to behavioral experiments - #2231
[ENH] BEP047 - Add audio/video recordings to behavioral experiments#2231bendichter wants to merge 70 commits into
Conversation
Add comprehensive support for audio and video recordings in behavioral experiments: - Add audio file extensions (mp3, wav) and video file extensions (mp4, mkv, avi) with corresponding _audio and _video suffixes - Document usage of audio/video recordings in beh directory for capturing vocalizations, speech, facial expressions, and body movements - Add metadata schema for audio/video device information and stream properties - Include privacy warnings about personally identifiable information in human subject recordings - Update behavioral experiments title to remove "with no neural recordings" restriction, clarifying data can be stored with or without neural recordings - Add examples for file organization including multi-angle recordings and split files - Define optional entities: task, acquisition, run, recording, split
…ee macros - Change section title from 'Behavioral experiments' to 'Behavioral recordings' - Convert file tree examples to use MACROS___make_filetree_example for consistent rendering - Address review comments from @yarikoptic in PR #2231
effigies
left a comment
There was a problem hiding this comment.
Overall this makes sense to me. It would be good to get some feedback from contributors to related BEPs, such as eye-tracking (20), motion (29), stimuli (44) and physio (45). Even if this PR doesn't propose adding this as an associated file to those data types, the potential is there and it's worth getting opinions and identifying potential conflicts.
cc @bids-standard/bep029 @bids-standard/bep044
cc @mszinte @julia-pfarr @oesteban (BEP020)
cc @m-miedema @smoia @SouravKulkarni (?) (BEP045)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2231 +/- ##
=======================================
Coverage 83.07% 83.07%
=======================================
Files 22 22
Lines 1696 1696
=======================================
Hits 1409 1409
Misses 287 287 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
Per PR review discussion on thread r2989972681 (h-mayorquin proposed, @CodyCBakerPhD raised the image-vs-video tension on r3349547943): ImagePixelFormat (FFmpeg pix_fmt) deterministically encodes bit depth for any FFmpeg-readable file, so ImageBitDepth is redundant for video. However: - Common PIL modes (L, RGB, RGBA, P, ...) are implicitly 8-bit-per- channel and do not encode bit depth in the mode name. Image-domain tooling (Pillow, libtiff, PNG library) surfaces bit depth as a first-class integer rather than as part of a pix_fmt string. - For image-only sidecars whose producing tools do not naturally go through FFmpeg, ImagePixelFormat may be absent and bit depth is the only color-precision field available. - An integer is more directly discoverable for the typical researcher than the FFmpeg pix_fmt naming convention. Added as OPTIONAL with an explicit "redundant with ImagePixelFormat when both present; the two MUST agree" note in the description, so the redundancy is acknowledged rather than hidden. Co-authored-by: Heberto Mayorquin <h.mayorquin@gmail.com> Co-authored-by: Cody Baker <CodyCBakerPhD@gmail.com> Co-Authored-By: Claude Code 2.1.161 / Claude Opus 4.7 <noreply@anthropic.com>
…definitions) This branch builds off PR #2367 ("Add common media file definitions for BEP044/BEP047") and layers PR #2231 ("BEP047 - Add audio/video recordings to behavioral experiments") on top. Conflict resolutions (preferred #2367's canonical media definitions for all shared objects, kept #2231's unique behavioral additions): - extensions.yaml: kept #2367 generic descriptions for mkv/mp3/mp4/ogg/wav/avi; dropped #2231 duplicate avi/wav entries. - suffixes.yaml: kept #2367 generic audio/audiovideo/image/video suffixes; dropped #2231 duplicate behavioral-specific versions. NOTE: #2367 defines 'video' as video-only (no audio); #2231 had treated 'video' as possibly containing audio. Resolved in favor of #2367. - metadata.yaml: dropped #2231 duplicate AudioChannelCount/AudioSampleRate (kept #2367's richer versions); retained #2231-only fields (AudioDuration, AudioBitDepth, CameraPosition, Duration, FrameRate, Height, Width). - behavioral-experiments.md: kept #2367's updated examples-page URL. NOTE: #2231 uses generic metadata names (FrameRate/Width/Height/Duration) while #2367 uses prefixed names (VideoFrameRate/VideoWidth/...). Both sets coexist after this merge and should be reconciled by maintainers. Schema loads cleanly; no duplicate keys remain. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review on the mediafiles PR: remove redundant generic metadata and sidecar rules that re-declare what the common media file definitions (media.yaml / #2367) already provide. - metadata.yaml: drop Duration, AudioDuration, FrameRate, Height, Width (superseded by RecordingDuration, VideoFrameRate, ImageWidth/ImageHeight). Keep behavioral-specific Device, AudioBitDepth, CameraPosition. - rules/sidecars/beh.yaml: drop AudioVideoDuration/AudioStreams/VideoStreams/ ImageProperties groups (covered by media.yaml's MediaDuration/ MediaAudioProperties/MediaVideoProperties/MediaImageProperties). Keep only behavioral additions (Device/License, AudioBitDepth, CameraPosition) and fix the stale 'behimage' suffix -> 'image'. - behavioral-experiments.md: point sidecar tables at the common media groups and update JSON examples to the canonical field names. Schema loads; behavioral example validates with 0 errors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These are generic media properties usable by any modality that stores audio, so define them alongside the other common media file definitions: - flac (.flac) lossless audio extension - AudioBitDepth metadata, added as an optional field of MediaAudioProperties Moved here from the BEP047 behavioral PR per review discussion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
flac (extension) and AudioBitDepth (metadata) are generic media properties, now defined in the common media definitions (mediafiles PR, yarikoptic#3). Remove them from the BEP047 layer and the behavioral AudioBitDepthProperties sidecar group; AudioBitDepth is now an optional field of MediaAudioProperties. Device stays here as a behavioral-specific field. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add flac extension and AudioBitDepth to common media definitions
|
A great usecase came from @xiaonansun is video recording of epileptic patients along with EEG or iEEG or other (single units) recording. |
|
and @mvdm 's lab records rodent faces for eye tracking + potential whiskers analysis etc! |
Per the July 1 BEP047 discussion, generalize the camera-position field so it also covers audio recording devices (for example, microphone arrays): - Rename the `CameraPosition` metadata object to `DevicePosition` and broaden its description to any recording device. - Move it into the `AudioVideoImageDevice` sidecar group so it applies to the `audio`, `video`, `audiovideo`, and `image` suffixes, and drop the separate `CameraProperties` group. - Update the behavioral-experiments tables and example sidecar accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # src/schema/objects/extensions.yaml
9418f93 to
07ca171
Compare
The BEP047 metadata field was generalized from `CameraPosition` to `DevicePosition` (bids-standard/bids-specification#2231) so it applies to any recording device. Update the example sidecars and README accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Consolidation updateThis PR now carries the complete BEP047 proposal in one place. It combines what were previously three separate PRs:
Both upstream PRs have been closed with pointers here, so #2231 is the single canonical PR to review. The branch has been merged onto current What's included (12 files)
|
|
bids-standard/bids-examples#523 is up do date with this branch |
yarikoptic
left a comment
There was a problem hiding this comment.
I think this is in a good shape and would allow also BEP042 to start making use of the metadata fields and macros
|
Since this would relate to the software which would use such recordings, I would love to invite @talmo @MMathisLab @niksirbi @roaldarbol as relating to Please have a look at this PR changes and/or rendered version at https://bids-specification--2231.org.readthedocs.build/en/2231/modality-specific-files/behavioral-experiments.html . It would be great to hear your opinion about the suggested BIDS file naming conventions for audiovideo recordings and metadata to come along in the sidecars. edit: note -- you are welcome to submit an "official" review of the PR |
|
Thanks for tagging me @yarikoptic! I'm quite busy at the moment, but would definitely want to review this. Is there a time horizon / deadline for the review period? |
|
Currently on holidays, I'll have a look in early August. :-) |
fix #1771
edits by @yarikoptic: