Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 22:33
    codecov[bot] commented #5895
  • Jan 31 2019 22:32
    larsoner synchronize #5895
  • Jan 31 2019 21:16
    codecov[bot] commented #5895
  • Jan 31 2019 21:16
    larsoner synchronize #5895
  • Jan 31 2019 20:23
    agramfort commented #5768
  • Jan 31 2019 18:31
    larsoner opened #5895
  • Jan 31 2019 18:31
    larsoner milestoned #5895
  • Jan 31 2019 17:58
    codecov[bot] commented #5822
  • Jan 31 2019 17:16
    GuillaumeFavelier commented #5822
  • Jan 31 2019 17:13
    codecov[bot] commented #5822
  • Jan 31 2019 17:13
    GuillaumeFavelier synchronize #5822
  • Jan 31 2019 17:01
    jshanna100 commented #5807
  • Jan 31 2019 16:11
    larsoner commented #5807
  • Jan 31 2019 15:36
    jshanna100 commented #5807
  • Jan 31 2019 15:19
    codecov[bot] commented #5807
  • Jan 31 2019 15:07
    GuillaumeFavelier commented #5822
  • Jan 31 2019 14:18
    codecov[bot] commented #5768
  • Jan 31 2019 14:01
    codecov[bot] commented #5807
  • Jan 31 2019 14:01
    jshanna100 synchronize #5807
  • Jan 31 2019 13:45
    GuillaumeFavelier synchronize #5822
Luke Bloy
@bloyl
thanks I was wondering what the syntax was for that...
I should have mentioned that i did do pip install sphinxcontrib-bibtex that got me past the errors about importing sphinxcontrib.bibtex but then i started getting the ones about sphinxcontrib.bibtex2
Luke Bloy
@bloyl
Also how do I reference an example from another example?
I tried :ref:_ex-inverse-source-power to link to https://github.com/mne-tools/mne-python/blob/master/examples/inverse/plot_dics_source_power.py#L2 but it didn’t work :(
is there some magic I’m missing?
Alexandre Gramfort
@agramfort
@biancaisla1 I don't know the details of the data you are using. Do you know how to related these numbers to your events?
biancaisla1
@biancaisla1
@agramfort, I have an event_dict that numbers and then labels/groups by condition if that's what you mean? So I can take a look at the numbers and go back to the dict and then see that it may/may not be e.g. habituation. I just wanted to make sure that when I input print(set(raw.annotations.description)) the numbers I get back in the output are the numbers ascribed to the different conditions in my event_dict? Furthermore, if I input description=raw.annotations.description I get a ValueError specifying that onset, duration, and description must be equal in sizes, got 236, 236, and 5114. If I input description=event_dict I get a RunTimeWarning that 1 annotation was omitted because it was outside the data range. Am I using these functions appropriately? I'm not sure I understand the theory behind the description parameter of annotations.
Eric Larson
@larsoner

@bloyl are you sure you referenced it properly? If you push to your PRI I can look. but something like the following should work:

blah blah :ref:`ex-inverse-source-power` blah

if you for example `git grep tut-inverse" you can see how we link that one (you have to be careful with the underscores)

Alexandre Gramfort
@agramfort
@biancaisla1 descriptions are strings/text. Events are integers. You need a way to convert from string to integers. Share a file and a script if it can help
Daniel McCloy
@drammock
@bloyl if you look at requirements.txt you'll see that we've pinned to a specific commit of sphinxcontrib-bibtex because the functionality we need hasn't been released yet. so simply pip installing the released version won't work.
Daniel McCloy
@drammock
@ErichZimm this answer is a bit late, but FYI the sensor units are documented here: https://mne.tools/stable/overview/implementation.html#internal-representation-units
Luke Bloy
@bloyl
@drammock Thanks that solved the problem.
@larsoner It was indeed an underscore problem. I had kept that underscore when i tried to reference but i guess the indicates that its a link. either way its working now.
biancaisla1
@biancaisla1
@agramfort I'll share a script and a file via email. I'll also summarize the issue, I don't think we're the only one utilizing MNE for Neuroscan files. So this may prove a useful example to the community of users.
biancaisla1
@biancaisla1
Thank you @agramfort !
Daniel McCloy
@drammock
has there been any discussion about when/where the next sprint will be? April is not very far away...
Alexandre Gramfort
@agramfort
april is already hard for me. Last 2 weeks of march why not but It must be in paris. Too many trips already.
agpr141
@agpr141
I'm reading alot on the best choice for re-referencing EEG electrodes. Has anyone implemented Reference Electrode Standardisation Technique (REST) referencing using MNE? Is it possible?
agpr141
@agpr141
A simple google fixed it: https://libraries.io/pypi/restpython thanks anyway!
Kuilaing
@Kuilaing
Hey guys, when use men to read the eeglab's .set(raw = mne.io.read_raw_eeglab("gain.set",preload=False)), show that buffer is too small fo requested array. I use mne version 0.19.2 in spyder. Thanks!
Fidel Cakmak
@miaStilo_twitter
Hey guys,
I have an EEG dataset which is not in EEG file format in MNE. Can you please let me know how can I convert my data to any of these datasets?
Daniel McCloy
@drammock
@miaStilo_twitter There are lots of readers for different file types (https://mne.tools/dev/overview/implementation.html#supported-data-formats) and it is also possible to create MNE-Python data structures from data in NumPy array format (https://mne.tools/dev/auto_tutorials/simulation/plot_creating_data_structures.html ). You didn't tell us what format the data is in. a MAT file? CSV? Something else?
Alexandre Gramfort
@agramfort
@Kuilaing did you try setting parameter uint16_codec as suggested in the code?
Daniel McCloy
@drammock
Any EEGLAB experts out there? Please have a look at #7192
Mainak Jas
@jasmainak
I think sharing a reproducible script is the first step. He can share the files and a script with me if needed. We sit in same offices but I’m currently on vacation
perevo
@perevo
Hi, is there any way to plot topographic map of PSD data?
perevo
@perevo
The 'plot_topo' and 'plot_topomap' are only working for TFRs data but not for PSD data.
Mikolaj Magnuski
@mmagnuski
@perevo: Funny, I'm almost sure there was a method for that on Raw files. However it is actually better to first compute psd (mne.time_frequency.psd_welch for example) and then use mne.viz.plot_topomap passing the data vector and raw.info.
perevo
@perevo
@mmagnuski :How to plot 2D topography of PSD like 'mne.viz.plot_evoked_topo'?
Mikolaj Magnuski
@mmagnuski
@perevo - you select a frequency you are interested in or a frequency range that you subsequently average.
perevo
@perevo
@mmagnuski , No, I mean plot each spectrum on the sensor location of topographic map. Just like this: https://mne.tools/stable/_images/sphx_glr_plot_visualize_evoked_013.png
Mikolaj Magnuski
@mmagnuski
@perevo Ah, this you can do for raw: raw.plot_psd_topo()
You can also use mne.viz.iter_topography if you want to have more control over what and how is plotted.
Daniel McCloy
@drammock
question for the room: mne.stats.spatio_temporal_cluster_1samp_test has a spatial_exclude parameter that takes indices of vertices to ignore. If instead have a large-ish label that I want to use to tell spatio_temporal_cluster_1samp_test what to include, what is the sensible way to go about it? Ideas so far are np.setdiff1d() between the source space vertices and the label vertices, or (if the label is from a parcellation) use regex negative lookahead to select all labels except for the ones I want, and use those to tell spatio_temporal_cluster_1samp_test what I want to exclude. Is one of these preferred? Is there some other, better way?
Eric Larson
@larsoner
@drammock the setdiff1d sounds much easier than the regex way (also parcellations are not guaranteed to be complete IIRC)
you could alternatively use stc.in_label and similarly constrain your connectivity, but just to do the latter you would end up using np.in1d an the setdiff1d is about the same amount of work/lines
Daniel McCloy
@drammock
@larsoner so a combination of label.restrict(sourcespace) followed by np.setdiff1d(sourcespace, label) seems good to you?
(or more accurately: np.setdiff1d(sourcespace[hemi_idx]['vertno'], label.vertices))
Eric Larson
@larsoner
yes and then you have to be careful about offsets for left/right hemi, and/or concatenation
Ruben Dörfel
@RDoerfel
Hey guys, can someone please explain following information in the raw structure: raw.info - hpi_results - order ?
biancaisla1
@biancaisla1
Okay everyone, having a problem with matplotlib. I am trying to denoise but am getting a ZeroDivisionError the full traceback is as follows:
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-46-589d069ad28e> in <module>
----> 1 plt.plot(1e3 * epochs.times, 1e15 * data[0, 31:, :].T)
      2 plt.xlabel('Time (ms)')
      3 plt.ylabel('Data (fT)');

~\Anaconda3\lib\site-packages\matplotlib\pyplot.py in plot(scalex, scaley, data, *args, **kwargs)
   2793     return gca().plot(
   2794         *args, scalex=scalex, scaley=scaley, **({"data": data} if data
-> 2795         is not None else {}), **kwargs)
   2796 
   2797 

~\Anaconda3\lib\site-packages\matplotlib\axes\_axes.py in plot(self, scalex, scaley, data, *args, **kwargs)
   1664         """
   1665         kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
-> 1666         lines = [*self._get_lines(*args, data=data, **kwargs)]
   1667         for line in lines:
   1668             self.add_line(line)

~\Anaconda3\lib\site-packages\matplotlib\axes\_base.py in __call__(self, *args, **kwargs)
    223                 this += args[0],
    224                 args = args[1:]
--> 225             yield from self._plot_args(this, kwargs)
    226 
    227     def get_next_color(self):

~\Anaconda3\lib\site-packages\matplotlib\axes\_base.py in _plot_args(self, tup, kwargs)
    403                 "non-matching shapes is deprecated.")
    404         for j in range(max(ncx, ncy)):
--> 405             seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
    406             ret.append(seg)
    407         return ret

ZeroDivisionError: integer division or modulo by zero
biancaisla1
@biancaisla1
Alright, I think I somewhat fixed the issue. When I input print(data.shape) the output returns that I have 25 channels but I forgot that MNE counts the channels from 0. Thus the ZeroDivisionError! Aha moment....but upon fixing that, I passed plt.plot(1e3 * epochs.times, 1e15 * data[0, 24:, :].T) and it only gives me one channel and not all of my channels.
image.png
Eric Larson
@larsoner
if data.shape == (n_epochs, 25, n_times) and you do data[0, 24:, :].T you will get the first epoch, and just the last channel. If you want all channels it would be data[0, :, :].T
biancaisla1
@biancaisla1
Thank you for explaining that @larsoner
Gertjan De Mulder
@gertjandemulder
is there a way to adjust the fontsize of the colorbar when plotting the CSP patterns/filters?
Schermafbeelding 2020-01-17 om 21.06.14.png
These are a bit too small compared the rest of
Eric Larson
@larsoner
@gertjandemulder these are ultimately just matplotlib plots so you should be able to get the fig and make any adjustments after the fact
Gertjan De Mulder
@gertjandemulder
@larsoner , thank you. That tutorial comes right on time !