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

MEG data problem consulting #12795

Open
student123-coder opened this issue Aug 17, 2024 · 18 comments
Open

MEG data problem consulting #12795

student123-coder opened this issue Aug 17, 2024 · 18 comments
Labels

Comments

@student123-coder
Copy link

Description of the problem

https://github.com/neuroscan/curry-python-reader
001
002
The data collected by neuroscan MEG device can be read through this plug-in, and the data can be read normally, but there will be errors later.

Steps to reproduce

Consistent with the problem description.

Link to data

No response

Expected results

NeuroScan MEG data can be analyzed through MNE,The neuroscan MEG data analysis tutorial using the MNE toolkit can be found on github.

Actual results

There will be an error after reading the data, see Picture 002 for details

Additional information

No other information

Copy link

welcome bot commented Aug 17, 2024

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

@drammock
Copy link
Member

Hello! Please provide a link to the problematic file, and copy-pasteable text (not screenshots) to reproduce the problem. Also please let us know: are you able to successfully load this file using other software besides MNE?

@student123-coder
Copy link
Author

student123-coder commented Aug 18, 2024 via email

@student123-coder
Copy link
Author

student123-coder commented Aug 20, 2024 via email

@mscheltienne
Copy link
Member

We can't download anything from the google drive.

C:\Users\jd\001\set.py:3: RuntimeWarning: Estimated head radius (0.0 cm) is below the 3rd percentile for infant head size. Check if the montage_units argument is correct (the default is "mm", but your channel positions may be in different unit

This is a warning, not an error. The montage in the files is probably wrong, but maybe you don't need it. Hard to tell.

If there is indeed a bug in the mne.io.read_raw_curry function and if we can reproduce it on a file you share, then we can have a look. Else this issue will be closed.

@student123-coder
Copy link
Author

student123-coder commented Aug 21, 2024 via email

@student123-coder
Copy link
Author

student123-coder commented Aug 21, 2024 via email

@drammock
Copy link
Member

dropbox link also does not work :(

dropbox

@student123-coder
Copy link
Author

student123-coder commented Aug 21, 2024 via email

@student123-coder
Copy link
Author

student123-coder commented Aug 21, 2024 via email

@student123-coder
Copy link
Author

student123-coder commented Aug 21, 2024 via email

@student123-coder
Copy link
Author

student123-coder commented Aug 22, 2024 via email

@mscheltienne
Copy link
Member

None work.

@student123-coder
Copy link
Author

student123-coder commented Aug 22, 2024 via email

@drammock
Copy link
Member

drammock commented Aug 22, 2024

All of the dropbox links have the same error message as in my previous reply. However I was able to go back to the google drive links, and it seems my request for access was granted, so now they work. I'll try to take a look at the data soon.

@student123-coder
Copy link
Author

student123-coder commented Aug 22, 2024 via email

@drammock
Copy link
Member

OK. I'm not really sure what we would need to do to get MNE-Python to read this file. But I can confirm that https://github.com/neuroscan/curry-python-reader can read the file. From there, I'm able to shoehorn it into an MNE object, but some things are not accounted for (see below):

In [1]: import mne
In [2]: import curryreader as cr
In [3]: curry_data = cr.read("test data/Acq 2024_08_08_0924_Sub1 Data.cdt", plotdata=0)
INFO: Reading file Acq 2024_08_08_0924_Sub1 Data.cdt ...
INFO: Number of samples = 878200, number of channels = 188, number of trials/epochs = 1, sampling frequency = 1000.0 Hz
INFO: Found channel labels
INFO: Found sensor positions
INFO: Found events
In [4]: info = mne.create_info(ch_names=curry_data["labels"], sfreq=curry_data["info"]["samplingfreq"], ch_types="mag")
In [5]: raw = mne.io.RawArray(data=curry_data["data"].T, info=info)
Creating RawArray with float64 data, n_channels=188, n_times=878200
    Range : 0 ... 878199 =      0.000 ...   878.199 secs
Ready.

Notes: According to the Data Parameters file (.cdt.dpa), there are 2 "groups": a MAG group with 177 channels, and an "other" group with 11 channels. Data for mag channels are in fT, so will need to be scaled by 1e-15. Data in "other" group are in uV, so will need to be scaled by 1e-6. As far as I can tell, curryreader doesn't account for / handle the units in any way. Something like scaler = np.repeat([1e-15, 1e-6], (177, 11)) should be a correct scaling factor, assuming the two channel groups aren't interleaved (I have no idea if they are or not). Once you work out the channel order question, then replace the last line above with

raw = mne.io.RawArray(data=(scaler * curry_data["data"]).T, info=info)

Note that the info will still be incorrect, so you'll need to go back and correctly specify the ch_types param in create_info too (since they're not all Magnetometers, 11 of them are something else... not clear if EEG, ECG, EOG, EMG, GSR...)

Hopefully that's enough of a lead that you can work out how to get it into MNE quickly, and don't need to wait for us to get the reader bug corrected.

@student123-coder
Copy link
Author

student123-coder commented Aug 28, 2024 via email

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

No branches or pull requests

3 participants