interactive gui

Hello,

Sorry to bother you with this probably very stupid question. I have been working with mne software for about a year now. Until now I have always done data inspection via EEGLab in matlab and run all analysis via mne based python scripts. However, I would like to switch my entire pipeline to mne/python, but I seem to be unable to launch the user interface of me_browse_raw. Could anyone please tell me what I need to do to launch this interface.

Thank you very much,

Dirk

Hi Dirk,

To get started with mne using the python tools, you can follow along with
this example
<http://martinos.org/mne/stable/auto_examples/io/plot_read_and_write_raw_data.html#sphx-glr-auto-examples-io-plot-read-and-write-raw-data-py>
and
our intro
<http://martinos.org/mne/stable/auto_tutorials/plot_introduction.html>. We
have a python implementation of mne_browse_raw with core overlapping
features. To browse your data, you need to read it in using the appropriate
function here <http://martinos.org/mne/stable/manual/io.html> given your
data type (raw = mne.io.read_raw_xxx). Then you can plot and inspect your
data using raw.plot().

Feel free to browse our website <http://martinos.org/mne/>. Let us know if
you have any questions or if you find a particular section confusing.

HTH,

teon

Hey Teon,

Thanks for your quick reply. The plotting of mne_browse_raw works fine. However, I should have been more clear in my question. I am looking for a way to quickly browse through my epoched data to check whether there are any remaining artifacts after automatic artifact rejection. In Matlab I was able to scroll to plots of EEG data to visually inspect the data and select epochs for rejection. Is this also possible in python via mne? I can now only think of the very inefficient work around to loop over all epochs with mne_browse_raw

Thank you,

Dirk

Hi Dirk,

We have a new (as of v0.10) interactive plotting for epochs that is a
method of the Epochs object. If you have made your epochs: epochs =
mne.Epochs(raw), then you can just say epochs.plot and it will provide
browser for looking at the epochs for artifact rejection.

HTH,

teon

Dear All
  There are plenty of examples for MEG analysis. I was wondering, if
anyone had a script for EEG source localization for volume source
spaces? Maybe, there is one lying around somewhere. That would be big
help to me.
many thanks
best regards parham hashemzadeh

with epochs.plot(block=True) you can click on epochs to mark them as bad

HTH
A

Parham,

In general there is nothing different from MEG and EEG analysis, so
the tutorial would look identical except the initial raw file would
only have EEG data. The only real additional consideration you have is
that your BEM has a much greater influence on EEG data than on MEG, so
you may want to think about including special MRI sequences like the
multi-echo FLASH for generating your BEM.

hth
d

Dear all

I got an error when running a beamforming tutorial script. I modified
the beamformer such that only the EEG leadfield is used and I just
wanted to do EEG analysis.
So I made the following changes:
(a) meg=False in fwd
(b) in epochs reject=dict(eog=150e-6)
When it gets to the function lcm_inverse, it throws an error:

""Only volume source estimates can be saved as volumes"" can be saved

  I was wondering, if you would be able to point me in the right
direction.
Many thanks
best regards parham hashemzadeh

fwd = mne.make_forward_solution(raw_fname, trans, src, bem,
                                 fname=None, meg=False, eeg=True,
mindist=5.0,
                                 n_jobs=2, overwrite=True)
epochs = mne.Epochs(raw, events, event_id, tmin, tmax, proj=True,
                     picks=picks, baseline=(None, 0), preload=True,
                     reject=dict(eog=150e-6))

evoked = epochs.average()
leadfield = fwd['sol']['data']
## Read regularized noise covariance and compute regularized data
covariance
noise_cov = mne.read_cov(fname_cov)
data_cov = mne.compute_covariance(epochs, tmin=0.04,
tmax=0.15,method='shrunk')

Hi Parham,

It sounds like you are using this tutorial:

http://martinos.org/mne/dev/auto_examples/inverse/plot_lcmv_beamformer.html?highlight=beamformer

If that is the case, it uses the cortical surface as the source space
and not a volume, so it doesn't really make sense to save as a nifti.

hth
d

Dear
  Thank you for your email. But actually no I am not using that tutorial.
I am using this tutorial which is focused on the Volume Source Space.

http://martinos.org/mne/dev/auto_examples/inverse/plot_lcmv_beamformer_volume.html#sphx-glr-auto-examples-inverse-plot-lcmv-beamformer-volume-py

All I am doing is that I am turning off the MEG and just want to use the
EEG.

In theory it should work even with this reduced leadfield matrix. Before
it was 366 rows but now only 60 rows (Just EEG).

So my volume (source space) does not change. It is exactly the same
thing. My number of sensors are reduced.

The error happens at the line below:
mne.save_stc_as_volume('lcmv_inverse.nii.gz', stc, fwd['src'],
mri_resolution=False)

""Only volume source estimates can be saved as volumes"" can be saved

Any help will be appreciated.
besst regards parham

Thank you very much, it works great. As I understand the marked epochs are directly dropped from the epochs object. Is there also a way to not drop the epochs but store their indices (such that you know which trials to exclude from the behavioral file?)

Anyway this is great. Really appreciate it.

Dirk

Hi Parham,
Where are you getting src from? It doesn't seem to be a volume source space.

hth
d

Dear
  I simply ran the tutorial below, which uses the file name
fname_fwd = data_path + '/MEG/sample/sample_audvis-meg-vol-7-fwd.fif'
So, it is a volume. I simply set Meg=False. It appears to me that it is
volume. At least it says that it is volume "vol-7-fwd.fif". I wanted to
only do the beamformer with EEG.
best regards parham hashemzadeh

Hi Parham,

There are a couple of problems you are running into here:

1. That forward solution only contains MEG sensors, you would need to
generate your own with EEG only sensors if you want to.

2. You didn't mention changing the picks call which would also need to be done.

Next time if you copy and paste all and exactly what you ran, I can
probably help you quicker.

hth
d

Dear Dan
  Thank you very much for spending so much time guiding me. In this
email, I have pasted the complete code from line 1 to last line of the
code. It is pasted after the first bit of code where I get the error and
includes the bit of code that gives the error.

  I implemented your advice, which by the way was very beneficial for me
for pedagogical reasons.

Everything went gone smoothly until, I get the following error:

please don't paste code in email but use dedicated services like:

https://gist.github.com/

almost if you want someone to test and replicate use an MNE dataset or
make your data available

A

Hi Dirk,

The Epochs
<http://martinos.org/mne/stable/generated/mne.Epochs.html#mne.Epochs> object
has an attribute, `epochs.selection` that maintains the indices of the
remaining epochs from the original epochs object. You can then use those
indices to select the same trials/events in your behavioral file (granted
that the original epochs and behavioral file are allowed in length from the
beginning).

HTH,

teon

Dear All
  I was hoping to do a source reconstruction with fieldtrip. My question
involves MNE-sample data set. under the mri directory, there are a
number of files. Can you kindly tell, which is the original mri file
(main one), that one can use the free surfer to generate the meshes and
basically if I wanted to follow the steps in

http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate
but applied to MNE-sample data set, which mri image, do I need to load
and how to determine the coordinate system?,...
many thanks
best regards parham

use mri/T1.mgz

HTH
Alex