-
Notifications
You must be signed in to change notification settings - Fork 11
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
ERPs #116
Comments
@vferat Any reason why we excluded Evoked?
|
Hey, The way microstate analysis is performed on ERPs is quite different from spontaneous activity: one major difference is that polarity is not ignored for ERPs (more details here: A Tutorial on Data-Driven Methods for Statistically Assessing ERP Topographies). This is not yet supported by Pycrostates. There is an ongoing PR (#93) that should deal with it; however, more work is needed, especially to adapt the smoothing algorithm (here). Any contribution is welcomed! 😊 As for now, I can only recommend using Cartool or Ragu for the topographic analysis of ERPs. |
Thanks @vferat. That is good to know. |
Hi @vferat, just wondering if there has been any breakthroughs on getting the ERP side of pycrostates up an running? I have been having a really difficult time trying to figure out how to get my fif files converted into something Cartool or Ragu can read. |
Hey Matt, Unfortunately, I don't know when we'll have time to work on this. However, if your aim is to use MNE data in Cartool, I can advise you to have a look at Pycartool which provides I/O function to read and export MNE objects to Cartool file formats. |
I actually just stumbled on that late yesterday. I have been playing around
with it, but the only conversion I found was pycartool.io.sef.write_sef(
*path*, *raw*)
But it seems to only work on raw data. Are you aware if there are any
functions that work on epoched or evoked data?
…On Wed, Nov 8, 2023 at 6:57 AM Victor Férat ***@***.***> wrote:
Hey Matt,
Unfortunately, I don't know when we'll have time to work on this.
However, if your aim is to use MNE data in Cartool, I can advise you to
have a look at Pycartool
<https://github.com/Functional-Brain-Mapping-Laboratory/PyCartool> which
provides I/O function to read and export MNE objects to Cartool file
formats.
—
Reply to this email directly, view it on GitHub
<#116 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJJHQ4EBMFITFXZRBFCCDMLYDNXSHAVCNFSM6AAAAAA2JQVLX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBRG42DENJZGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I don't think there is a specific Cartool file format for
I'm not really sure how to handle
Hope it can help. Let us know here if it worked for you, so other people can benefit from your experience |
Thank so much. I will give this a try and let you know.
…On Wed, Nov 8, 2023 at 1:11 PM Victor Férat ***@***.***> wrote:
I don't think there is a specific Cartool file format for Evoked or Epoched
data.
A workaround would be to transform your evoked data into raw (see example
with MNE sample dataset)
import mne
import pycartool
# Load the MNE-Python sample dataset
sample_data_path = mne.datasets.sample.data_path()
# Load the auditory evoked data (for example)
evoked = mne.read_evokeds(sample_data_path + '/MEG/sample/sample_audvis-ave.fif', condition=0)
data = evoked.data
info = evoked.info
raw = mne.io.RawArray(data, info)
pycartool.io.write_sef("test.sef", raw)
I'm not really sure how to handle epochs in Cartool, you may need to
export the raw file ( your can also use mne.export.export_raw
<https://mne.tools/stable/generated/mne.export.export_raw.html> for that)
along with the triggers. Or export each epoch to a sef file individually:
# Load the Epochs data for the visual condition (for example)
raw = mne.io.read_raw_fif(sample_data_path + '/MEG/sample/sample_audvis_raw.fif', preload=True)
events = mne.find_events(raw)
epochs = mne.Epochs(raw, events, tmin=-0.2, tmax=0.5, picks='meg', event_id=1)
data = epochs.get_data()
for i,d in enumerate(data):
raw = mne.io.RawArray(d, epochs.info)
pycartool.io.write_sef(f"epoch_{i}.sef", raw)
Hope it can help. Let us know here if it worked for you, so other people
can benefit from your experience
—
Reply to this email directly, view it on GitHub
<#116 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJJHQ4E4IPCX622KESXN53LYDPDNBAVCNFSM6AAAAAA2JQVLX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBSGQYDIMJVGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi @vferat, I gave this option a shot, and it does allow me to pull the data into Cartool, but it will not allow you to pull it into the segmentation due to some automatically calculated extra channels, such as GFP. However, this can be mitigated by opening up each file and manually deleting these channels and saving the modified .sef files separately. These separate files can then be pulled into the segmentation window. That said, there are some issue I am still trying to figure out. The segmentation output seems to lack a lot of information the tutorials have, such as the colored segmented GFP data and there are no head models for the microstate classes (though this latter issue happens because the .fif to .sef file transition loses this info and there is no great way to extract this info from MNE). All this has kept me from moving onto the next fitting step. I will say, as a note of caution, a lot of these problems are my ignorance of Cartool most likely. I am finding it incredibly overcomplicated and there are not a lot of good tutorials or an active forum specifically for the microstates side of the program. If someone knows Cartool better I will happily take your help. In the mean time I have found I could get a lot further with the toolboxes:< https://github.com/atpoulsen/Microstate-EEGlab-toolbox > and < https://github.com/plus-microstate/toolbox >. There does not seem to be a lot of support here either, but changing .fif files to .set files is readily done in MNE and then they have relatively straight forward pipelines. |
Is there a way to perform the segmentation on ERPs?
The text was updated successfully, but these errors were encountered: