Simulating EEG data with MNE

External Email - Use Caution

Hi,

I'm trying to simulate EEG data based on my existing dataset, which is in
the format of .eeg/.vhdr/.vmrk files (raw), .rds files (processed) and a
.csv file (summarised). I tried these tutorials

https://mne.tools/dev/auto_examples/simulation/plot_simulate_evoked_data.html
https://mne.tools/dev/auto_examples/simulation/plot_simulate_raw_data.html?highlight=simulate

but I did not manage to do so, since these are based on .fiff files and my
dataset does not contain any fwd/ave/cov/proj files. Is there a way to
simulate data based on .eeg/.vhdr/.vmrk OR .rds OR .csv files?

Any suggestions would be appreciated.

Thanks in advance,

Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200413/dee9f281/attachment.html

External Email - Use Caution

hi Daniel,

to be able to simulate data you need a forward model (know how to go from
source
to your EEG channel locations).

WOuld it make sense to get sensor locations with your file and then use
fsaverage
after mapping your electrodes to this template head?

Alex

External Email - Use Caution

Hi Alex,

Thanks for your fast reply. I'm not entirely sure if I understand what you
mean, but judging by the documentation (
https://mne.tools/dev/auto_tutorials/source-modeling/plot_forward.html), I
would still need a -trans.fif file, correct? I am not in possession of this
file.

I do have sensor location data in my files, but I'm not sure how I can use
this or fsaverage to simulate data. Moreover, FreeSurfer is used for MRI
data and not for EEG data right?

Daniel

External Email - Use Caution

have a look at :

https://mne.tools/stable/auto_tutorials/source-modeling/plot_eeg_no_mri.html#sphx-glr-auto-tutorials-source-modeling-plot-eeg-no-mri-py

let me know if it does not help

A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200413/778ae5ee/attachment.html

External Email - Use Caution

Hi Alex,

I've been tinkering with your suggestions, but I keep getting the following
error:

RuntimeError: Could not load any valid 3D backend: ['mayavi', 'pyvista']

I can't seem to find any documentation to solve it online, do you have
any suggestions what this could be and how I can fix it?

Daniel

External Email - Use Caution

Hi Daniel,

What happens if you try and import either of those packages directly?

Cheers,

-Morgan

External Email - Use Caution

hi,

also please tell us what this gives you:

https://mne.tools/dev/generated/mne.sys_info.html

on your machine

Alex

External Email - Use Caution

I successfully installed Pyvista, but trying to install Mayavi generated a
huge error log (see attached file).

This is the output of the mne.sys_info():

Platform: Darwin-19.4.0-x86_64-i386-64bit
Python: 3.7.7 (default, Mar 26 2020, 10:32:53) [Clang 4.0.1
(tags/RELEASE_401/final)]
Executable: /Users/danielvandencorput/anaconda3/envs/opencv/bin/python
CPU: i386: 4 cores
Memory: Unavailable (requires "psutil" package)
mne: 0.20.0
numpy: 1.18.1 {blas=mkl_rt, lapack=mkl_rt}
scipy: 1.4.1
matplotlib: 3.2.1 {backend=module://ipykernel.pylab.backend_inline}

sklearn: 0.22.1
numba: Not found
nibabel: Not found
cupy: Not found
pandas: 1.0.3
dipy: Not found
mayavi: Not found
pyvista: 0.24.1
vtk: 8.1.2

Cheers

        External Email - Use Caution

hi,

also please tell us what this gives you:

mne.sys_info — MNE 1.7.0.dev17+g20174f448 documentation

on your machine

Alex

>
> External Email - Use Caution
>
> Hi Daniel,
>
> What happens if you try and import either of those packages directly?
>
> Cheers,
>
> -Morgan
>
>>
>> External Email - Use Caution
>>
>> Hi Alex,
>>
>> I've been tinkering with your suggestions, but I keep getting the
following error:
>>
>> RuntimeError: Could not load any valid 3D backend: ['mayavi', 'pyvista']
>>
>>
>> I can't seem to find any documentation to solve it online, do you have
any suggestions what this could be and how I can fix it?
>>
>>
>> Daniel
>>
>>
>>>
>>> External Email - Use Caution
>>>
>>> have a look at :
>>>
>>>
Page Redirection
>>>
>>> let me know if it does not help
>>>
>>> A
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> Mne_analysis Info Page
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> Mne_analysis Info Page
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200414/2a108f54/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Error_output.rtf
Type: text/rtf
Size: 45430 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200414/2a108f54/attachment-0001.rtf

External Email - Use Caution

then you have pyvista so it should work.

does making a toy pyvista plot works on your system?

pick one in : https://docs.pyvista.org/examples/index.html

Alex

External Email - Use Caution

Plotting with pyvista works as it should be.

External Email - Use Caution

please open an issue at https://github.com/mne-tools/mne-python/issues

so we can look into it with Guillaume Favelier

Alex

External Email - Use Caution

I will do that. Thanks for your help either way.

Daniel