mne-tools / mne-bids-pipeline

Automatically process entire electrophysiological datasets using MNE-Python.
https://mne.tools/mne-bids-pipeline/
BSD 3-Clause "New" or "Revised" License
140 stars 67 forks source link

ENH: Add annotation of head velocity #757

Closed larsoner closed 1 year ago

larsoner commented 1 year ago

Before merging …

With updated vals for ds004229:

mf_mc_rotation_velocity_limit = 30.0  # deg/s for annotations
mf_mc_translation_velocity_limit = 20e-3  # m/s

During the run we see:

[14:47:31] │ ⏳️ preprocessing/_03_maxfilter sub-102 Translation velocity exceeded 0.02 m/s limit for 5.5 s (1.8%)
[14:47:31] │ ⏳️ preprocessing/_03_maxfilter sub-102 Rotation velocity exceeded 30.0 °/s limit for 4.0 s (1.3%)

And in the report we get:

Screenshot from 2023-07-05 14-49-41

hoechenberger commented 1 year ago

@larsoner I'm wondering if we shouldn't add part of this upstream to mne.Report? I got this impression when I saw you injecting custom HTML. – It's an open question, I'm not entirely sure about the best approach myself. WDYT?

larsoner commented 1 year ago

Indeed in principle people could want to automatically gain some notes about raw annotations. In principle we could maybe add some logic to report.add_raw to autodetect the built-in annot types we have, but for example it would miss the limit that I inject here. Or if users have done their own annotations they'll have to write custom code anyway. So there is a deeper API discussion to be had. My inclination is to add stuff here first and if people think it's useful generally then we can add it upstream and remove our "custom" code here

hoechenberger commented 1 year ago

Thanks @larsoner