Skip to content

mne.source_estimate.MixedSourceEstimate.plot_surface(...) crashes #7015

Closed

Description

@christian-oreilly

Steps and/or code to reproduce

Sorry for not providing a fully reproducible code, but I think the problem is quite clear here. I tried to plot sources with a MixedSourceEstimate using

stc.plot_surface(views='lat', hemi='split', src=mne.SourceSpaces(src[:2]), subject='sample',
                             subjects_dir=atlas_dir, colorbar=False, clim=clim, colormap=colormap)

and I got:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-72-14b84a8a0864> in <module>
---->   7                              subjects_dir=atlas_dir, #initial_time=max_t, colorbar=False, clim=clim, colormap=colormap)
     10 screenshot = brain.screenshot()
     11 brain.close()

~/mne-python/mne/source_estimate.py in plot_surface(self, src, subject, surface, hemi, colormap, time_label, smoothing_steps, transparent, alpha, time_viewer, config_opts, subjects_dir, figure, views, colorbar, clim)
   2240                                      config_opts=config_opts,
   2241                                      subjects_dir=subjects_dir, figure=figure,
-> 2242                                      views=views, colorbar=colorbar, clim=clim)
   2243 
   2244 

TypeError: plot_source_estimates() got an unexpected keyword argument 'config_opts'

And sure enough, on the current dev code at line 2257 of mne/source_estimate.py:

        return plot_source_estimates(stc, subject, surface=surface, hemi=hemi,
                                     colormap=colormap, time_label=time_label,
                                     smoothing_steps=smoothing_steps,
                                     transparent=transparent, alpha=alpha,
                                     time_viewer=time_viewer,
                                     config_opts=config_opts,
                                     subjects_dir=subjects_dir, figure=figure,
                                     views=views, colorbar=colorbar, clim=clim)

and at line 1540 of mne/viz/_3d.py

def plot_source_estimates(stc, subject=None, surface='inflated', hemi='lh',
                          colormap='auto', time_label='auto',
                          smoothing_steps=10, transparent=True, alpha=1.0,
                          time_viewer=False, subjects_dir=None, figure=None,
                          views='lat', colorbar=True, clim='auto',
                          cortex="classic", size=800, background="black",
                          foreground="white", initial_time=None,
                          time_unit='s', backend='auto', spacing='oct6',
                          title=None, verbose=None):

Unless I am missing something, this code is broken...

Activity

  1. larsoner commented on Nov 4, 2019

    @larsoner
    Member

    It probably has not been used for some time (and is obviously untested!). Are you up for making a PR to fix it?

  2. christian-oreilly commented on Nov 4, 2019

    @christian-oreilly
    ContributorAuthor

    I can most probably have a look at it and if it goes well propose something. But I am on short deadlines for the next two weeks so it would go after that.

  3. christian-oreilly commented on Nov 18, 2019

    @christian-oreilly
    ContributorAuthor

    Will be solved when PR #7079 passes. Closing the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions