# interactive gui

**URL:** <https://mne.discourse.group/t/interactive-gui/998>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 12, 2016, 11:48pm UTC](https://mne.discourse.group/t/interactive-gui/998 "2016-04-12T23:48:39Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 12, 2016, 11:48pm UTC](https://mne.discourse.group/t/interactive-gui/998/1 "2016-04-12T23:48:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 5:34am UTC](https://mne.discourse.group/t/interactive-gui/998/2 "2016-04-13T05:34:03Z")

</div>

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](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](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](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/](http://martinos.org/mne/)\>. Let us know if  
you have any questions or if you find a particular section confusing.

HTH,

teon

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 3:34pm UTC](https://mne.discourse.group/t/interactive-gui/998/3 "2016-04-13T15:34:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 4:24pm UTC](https://mne.discourse.group/t/interactive-gui/998/4 "2016-04-13T16:24:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 4:36pm UTC](https://mne.discourse.group/t/interactive-gui/998/5 "2016-04-13T16:36:03Z")

</div>

Dear All  
&nbsp;&nbsp;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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 5:38pm UTC](https://mne.discourse.group/t/interactive-gui/998/6 "2016-04-13T17:38:01Z")

</div>

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

HTH  
A

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 6:36pm UTC](https://mne.discourse.group/t/interactive-gui/998/7 "2016-04-13T18:36:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 7:48pm UTC](https://mne.discourse.group/t/interactive-gui/998/8 "2016-04-13T19:48:09Z")

</div>

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

&nbsp;&nbsp;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,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fname=None, meg=False, eeg=True,  
mindist=5.0,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n\_jobs=2, overwrite=True)  
epochs = mne.Epochs(raw, events, event\_id, tmin, tmax, proj=True,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;picks=picks, baseline=(None, 0), preload=True,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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')

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 8:41pm UTC](https://mne.discourse.group/t/interactive-gui/998/9 "2016-04-13T20:41:55Z")

</div>

Hi Parham,

It sounds like you are using this tutorial:

[http://martinos.org/mne/dev/auto\_examples/inverse/plot\_lcmv\_beamformer.html?highlight=beamformer](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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 10:01pm UTC](https://mne.discourse.group/t/interactive-gui/998/10 "2016-04-13T22:01:02Z")

</div>

Dear  
&nbsp;&nbsp;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](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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 14, 2016, 1:58am UTC](https://mne.discourse.group/t/interactive-gui/998/11 "2016-04-14T01:58:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 14, 2016, 3:33am UTC](https://mne.discourse.group/t/interactive-gui/998/12 "2016-04-14T03:33:59Z")

</div>

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

hth  
d

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 14, 2016, 8:54am UTC](https://mne.discourse.group/t/interactive-gui/998/13 "2016-04-14T08:54:34Z")

</div>

Dear  
&nbsp;&nbsp;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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 14, 2016, 3:17pm UTC](https://mne.discourse.group/t/interactive-gui/998/14 "2016-04-14T15:17:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 15, 2016, 12:56pm UTC](https://mne.discourse.group/t/interactive-gui/998/15 "2016-04-15T12:56:28Z")

</div>

Dear Dan  
&nbsp;&nbsp;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.

&nbsp;&nbsp;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:

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 15, 2016, 4:34pm UTC](https://mne.discourse.group/t/interactive-gui/998/16 "2016-04-15T16:34:02Z")

</div>

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

[https://gist.github.com/](https://gist.github.com/)

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

A

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 22, 2016, 4:45am UTC](https://mne.discourse.group/t/interactive-gui/998/17 "2016-04-22T04:45:16Z")

</div>

Hi Dirk,

The Epochs  
\<[http://martinos.org/mne/stable/generated/mne.Epochs.html#mne.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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 22, 2016, 11:26am UTC](https://mne.discourse.group/t/interactive-gui/998/18 "2016-04-22T11:26:14Z")

</div>

Dear All  
&nbsp;&nbsp;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](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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 22, 2016, 12:20pm UTC](https://mne.discourse.group/t/interactive-gui/998/19 "2016-04-22T12:20:15Z")

</div>

use mri/T1.mgz

HTH  
Alex
