-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH: Movement correction for OPM data #11275
Copy link
Copy link
Open
Description
Time-varying position / head-movement correction would be the next natural step after #10780 I think.
IIRC the procedure is/could be here:
- Extract time-varying rigid-body position + rotation of the system, typically using optical tracking: new
mne.chpi.read_head_pos_optitrack, ormne.chpi.calculate_head_pos_optitrack, depending on the complexity of the problem (if optitrack directly gives pos+rot, or we actually need to do some calculation). It's a bit of a misnomer, butmne.chpiis where all our head-position related stuff lives, so the optitrack outputting pos+rot as a function of time is natural there. We could put it in a newmne.optitrack, ormne.preprocessing.opmor something if we want, but optical tracking seems pretty generic. - Clean up position+rotation parameters: new
mne.chpi.clean_head_positionsor so? Or maybe this should be built intocalculate_head_pos_optitrack. TBD. - Add head positions to the raw data (as new channels) -- this is what
maxwell_filterdoes, so it's natural for us to do it as well -- maybemne.chpi.add_head_positions(raw, pos)and you can choose how to interpolate. (Under the hood this probably boils down to amne.add_channels((raw, RawArray(...)))or so but we'll need to interpolate/upsample the positions+rotations, and setting the info correctly will be annoying -- so not totally trivial, thus worth wrapping.) - Regressing can then be done immediately with
regress_artifactI think. OPM-specific options we need, if any, should hopefully be useful for other types of regression and thus reasonably implemented there.
@neurofractal did you ever play around/try regressing quaternions rather than Euler angles for rotation angle (by my bad memory you use Euler for regression)? We can convert back and forth but the .pos files we use for position + rotation information in space store in quaternions, so if those work just as well or better than Euler angles it's a slightly more natural fit here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels