mne-tools / mne-tools/mne-python
Coordinate frame and Fieldtrip import of Neuromag data
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
I have an issue with coordinate systems when I import a FieldTrip-processed Neurmag MEG. In general I would like to apply SSS. I have a FT-generated .mat file, that has 'neuromag' coord sys of type 'neuromag306'.
When I import it using mne.io.read_raw_fieldtrip, I get sensors' coordinate system to be FIFFV_COORD_HEAD (and MaxFilter does not like it). However if I later save the resulting raw to a file in .fif format and load it again, the sensor coordinate system is now shown as FIFFV_COORD_DEVICE. Even though the values of the 'loc' don't change at all.
I have also noticed that when importing the fieldtrip file, MNE performs some coordinate transformation.
So I guess there is a bug somewhere here -- either coord system is set by MNE wrong when importing or when exporting.
So to get a MaxFilter-compatible coord system, do I have to perform some coord frame conversion, or should I just change the coord system label in the info structure?
MNE version 0.20.3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the coordinate-frame change with the FieldTrip-generated .mat file and mne.io.read_raw_fieldtrip, then compare the sensor loc values and coordinate labels before and after saving and reloading FIF. Check how the neuromag306 frame is represented in the imported info and whether the resulting data is accepted by MaxFilter; done means the frame handling is correct or the required conversion is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100