annotating bad segments, then cropping signal, annotations don't get shifted?

MNE 1.9.0

Hi MNE Team,

I manually annotated bad segments in patient EEG data.
Next, I cropped the early and late parts of the resting state data, as they were most noisy.
I assumed that the annotations in the remaining time window would be shifted accordingly. Luckily, my colleague compared the pre/post cropping annotations and noted that they didn`t get shifted. There is probably a good reason for this behaviour, which I am curious to hear about.
I suggest a warning that cautions the user that annotations are not updated automatically when cropping signals containing annotations. I think that can be easily implemented and might prevent users from potentially rejecting good segments and keeping bad segments.

Happy to hear your thoughts.

Cheers,

Carina

Hello, simply speaking, annotation onset times are stored as the time of day. They’re not based on time relative to recording onset.

So if a recording starts at 09:00.00 and an annotation is added for a segment 10 mins after recording start, it will be tied to 09:10.00.

If you crop, say, the first five minutes, it only “takes” 5 min (instead of previously 10) to “reach” the annotation.

This is intentional behavior, though.

A fix I could imagine for your use case is opti ally adjusting the recording start time if one crops a segment from the beginning of the recording.

Richard

Then again, perhaps we are already shifting onset when cropping, and this is exactly what’s causing your issue? Could you please provide a reproducible example that demonstrates the issue?

Richard

I think annotations should get shifted accordingly when cropping. If this is not the case, please open an issue.