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

interpolate missing channels #11738

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

Conversation

dasdiptyajit
Copy link
Contributor

@dasdiptyajit dasdiptyajit commented Jun 16, 2023

Reference issue

Example: Fixes #11652

What does this implement/fix?

It answers one straightforward question: “how do I interpolate a sensor that was completely missing from a recording?”

CC @drammock, I did some changes.

@dasdiptyajit dasdiptyajit changed the title Dasdiptyajit interpolate missing channels interpolate missing channels Jun 16, 2023
@dasdiptyajit
Copy link
Contributor Author

@larsoner thanks for having a look. I will try to work on this soon.

@dasdiptyajit dasdiptyajit marked this pull request as draft June 21, 2023 10:08
@dasdiptyajit
Copy link
Contributor Author

@drammock @larsoner I have created a .json (dict file) that contains channel names and locations. Is it possible to facilitate one extra file that contains channel locations in MNE? If we can do that then the example can run using a single dataset. I have seen a similar file mne/io/artemis123/resources/Artemis123_mneLoc.csv but not sure about its usage. My code is working now with the additional file but I don't know how to read/add it as a standard path. I would appreciate some help.
Plus, if you get some time, have a look at the code. I would love to get some feedback,

thanks!

@larsoner
Copy link
Member

I have created a .json (dict file) that contains channel names and locations. Is it possible to facilitate one extra file that contains channel locations in MNE?

Why do you need this file? To me I would just directly create the ch_pos dict to pass to make_dig_montage. Feel free to use json.loads in the example if you want to copy-paste your JSON as a string.

@dasdiptyajit
Copy link
Contributor Author

I have created a .json (dict file) that contains channel names and locations. Is it possible to facilitate one extra file that contains channel locations in MNE?

Why do you need this file? To me I would just directly create the ch_pos dict to pass to make_dig_montage. Feel free to use json.loads in the example if you want to copy-paste your JSON as a string.

I thought its a clean way to interpolate any missing channel for MEG recordings if there is a separate file to load the channel position. I think make_dig_montage doesn't work for meg data but rather eeg right? Basically, my idea was: for 'eeg' we have standard montage layouts, so it wouldn't be that bad if we have something similar for meg. But, perhaps it's not that important.

Do you want me to copy the ch_pos from a standard dateset in the example? Then I will make the changes.

@larsoner
Copy link
Member

Do you want me to copy the ch_pos from a standard dateset in the example? Then I will make the changes.

No my suggestion for MEG (as before) would be to get the channel positions from some other instance. Why do we need a new file?

@dasdiptyajit
Copy link
Contributor Author

Do you want me to copy the ch_pos from a standard dateset in the example? Then I will make the changes.

No my suggestion for MEG (as before) would be to get the channel positions from some other instance. Why do we need a new file?

Okey. I was thinking earlier.. of having a single file that contains different MEG systems ch_position for user. But it was rather a suggestion. No problem. I will follow your recommendation.

@larsoner
Copy link
Member

I'd prefer to avoid adding a new file with positions

# Now we have to update channels location. For this, we will use MNE's
# in-built MEG layout configuration

file = "/home/dip_linux/PycharmProjects/mne-python/mne/io/fiff/VectorView_mne_loc.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

hardcoded path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wmvanvliet Thanks for having a look. I still need to modify the code based on my last discussion with Eric.
Unfortunately, I am really busy these days. I will get back it soon.

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.

4 participants