Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add framework for TWA head pos as MF destination #1043

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

drammock
Copy link
Member

Opening this for early feedback. So far it looks like it won't require a very big diff, but perhaps that's the naïvety of not having tested it yet 🙈. Could probably be tested with funloc once that's finished / merged.

Before merging …

  • Changelog has been updated (docs/source/dev.md.inc)

mne_bids_pipeline/_config.py Outdated Show resolved Hide resolved
mne_bids_pipeline/steps/preprocessing/_03_maxfilter.py Outdated Show resolved Hide resolved
@larsoner
Copy link
Member

Would be great to test using funloc, FYI could also in principle use this dataset but it's probably nice to have that it continue testing as it is

mf_destination = mne.transforms.translation( # rotate backward and move up

Copy link
Member Author

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this is now ready for another set of eyes again. Still TODO is setting up a proper test for it; I haven't had time yet to see if there's a suitable dataset (funloc won't work without monkeypatching, as it doesn't have multiple runs). That said, it appears to be working locally.

It feels like TWA-HP should actually be a separate "step" between _02_headpos and _03_maxfilter. As implemented now, if run 1 and run 2 for a given subj/sess are happening in parallel, they may both try to compute TWA-HP, where really it should only ever need to happen once.

Right now there is no logging.

I suppose it might be possible to tack TWA-HP computation onto the end of the headpos step instead of the beginning of the maxfilter step... then in maxfilter step we just check the config and load the destination Transform... that might make both logging and parallelization issues easier... WDYT?

@larsoner
Copy link
Member

I suppose it might be possible to tack TWA-HP computation onto the end of the headpos step instead of the beginning of the maxfilter step... then in maxfilter step we just check the config and load the destination Transform... that might make both logging and parallelization issues easier... WDYT?

Yeah if you're computing time-varying head positions, I think it makes sense to always compute the time-weighted average and save it. It's very quick to compute and the resulting file is tiny. Then whether or not you use it in the maxwell_filter step depends on whether or not you set the destination to 'twa' or whatever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants