MNE version: 1.0.1
Operating System: Windows 10
I am adding new annotations to a .fif file which already has annotations. When I re-open the plot of the file to edit or add more annotations, I find that the previous annotations have moved in time.
I suspect this has to do with my use of _orig_time. However, I am unable to pinpoint the issue. So I am requesting some assistance. Here is the function I am using to add new annotations:
def add_annot(raw, annot_file):
if Path(annot_file).exists():
annotations=mne.read_annotations(annot_file)
annotations._orig_time = raw.annotations._orig_time
list_annot_values = [tuple(annot.values()) for annot in annotations
if annot["description"].lower()
in ['saccade', 'clean']]
onset, duration, description = list(zip(*list_annot_values))[:3]
orig_annotations = mne.Annotations(onset,duration,description)
raw.set_annotations(orig_annotations + raw.annotations)
else:
warnings.warn(f'Path {annot_file} not existent')
Let me know if I must clarify anything. Thank you for your time.
Best,
Diksha