Macquarie-MEG-Research / natural_conversations

Data analysis for the natural conversations study
0 stars 2 forks source link

ENH: Refactor AEF timing into separate function #3

Closed larsoner closed 11 months ago

larsoner commented 12 months ago

I'm working on a script to BIDSify the dataset so I can put it through MNE-BIDS-Pipeline. It would be helpful if the trigger realignment code from https://github.com/Macquarie-MEG-Research/natural_conversations/blob/main/simple_AEF_AEP.py were refactored into:

  1. A separate importable module (e.g., utils.py or similar)
  2. A function within that module that took a filename or (better) raw instance, extracted triggers, analyzed mic data, and realigned/recreated triggers based on the extracted data, and returned an events ndarray suitable for creating mne.Epochs(raw, events, ...)

Then MNE-BIDS-Pipeline will give us the AEFs (almost) for free.

larsoner commented 12 months ago

@JD-Zhu I can try to do the refactoring suggested above if it would help, but it would probably be quicker for you assuming you wrote simple_AEF_AEP.py

JD-Zhu commented 12 months ago

Thanks @larsoner . I will have a go at this tomorrow!

Would you mind also sharing your code for aligning and concatenating the MEG and EEG data? Yifan is doing some explorations on the data and it would be great to look at combined MEG and EEG if possible.

JD-Zhu commented 11 months ago

I have now separated the trigger timing correction code into utils.py - please let me know if this looks okay @larsoner

The function is currently also returning the audio delay values themselves, as these are used again for timing correction of EEG data later on in simple_AEF_AEP.py (when we align and concatenate the MEG and EEG data, this will no longer be required)

larsoner commented 11 months ago

Thanks. Yes I can push the sync code early next week, just want to get it pumping through MNE-BIDS-Pipeline so I need to take care of a limitation there first, but I don't think that will be too bad!

JD-Zhu commented 11 months ago

Thanks!

On Sat, 2 Dec. 2023, 6:42 am Eric Larson, @.***> wrote:

Thanks. Yes I can push the sync code early next week, just want to get it pumping through MNE-BIDS-Pipeline so I need to take care of a limitation there first, but I don't think that will be too bad!

— Reply to this email directly, view it on GitHub https://github.com/Macquarie-MEG-Research/natural_conversations/issues/3#issuecomment-1836672893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE5HU3XOMV35PDEZIIWAGLYHIXLTAVCNFSM6AAAAAA77T6CEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZWGY3TEOBZGM . You are receiving this because you were assigned.Message ID: @.*** com>