Skip to content

Conversation

@mmagnuski
Copy link
Member

Another small change to plot_epochs_image - I made it separate from the other PR, because it is not necessarily a bug.
Currently vmin and vmax are set before smoothing (using sigma) so if one uses sigma the colorscale is not fully used (smoothed data will have lower min and max values etc.).
You can see the difference here:
Before:
before_02

After:
after_02

⚠️
Now the vmin, vmax are not set based on the whole data, but based on the first smoothed channel (out of those in picks). I could move smoothing out of the figure-loop - so that all picks are smoothed before the loop and vmin, vmax are set based on the whole smoothed data.

@dengemann
Copy link
Member

Looks pretty cool. Taking a look later.
On Wed, 29 Jun 2016 at 01:31, Mikolaj Magnuski notifications@github.com
wrote:

Another small change to plot_epochs_image - I made it separate from the
other PR, because it is not necessarily a bug.
Currently vmin and vmax are set before smoothing (using sigma) so if one
uses sigma the colorscale is not fully used (smoothed data will have
lower min and max values etc.).
You can see the difference here:
Before:
[image: before_02]
https://cloud.githubusercontent.com/assets/8452354/16435741/6e2c6ac4-3d98-11e6-9306-878f1e131455.PNG

After:
[image: after_02]
https://cloud.githubusercontent.com/assets/8452354/16435747/77e06b2e-3d98-11e6-8dff-c06687b1adee.PNG

⚠️
Now the vmin, vmax are not set based on the whole data, but based on the
first smoothed channel (out of those in picks). I could move smoothing out
of the figure-loop - so that all picks are smoothed before the loop and

vmin, vmax are set based on the whole smoothed data.

You can view, comment on, or merge this pull request online at:

#3360
Commit Summary

  • set vmin, vmax after smoothing

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#3360, or mute the thread
https://github.com/notifications/unsubscribe/AB0fik365srsXKntqixkCNikC2VxJf9Wks5qQa7MgaJpZM4JAovy
.

@codecov-io
Copy link

codecov-io commented Jun 29, 2016

Current coverage is 86.60%

Merging #3360 into master will increase coverage by 0.04%

@@             master      #3360   diff @@
==========================================
  Files           335        335          
  Lines         57319      57628   +309   
  Methods           0          0          
  Messages          0          0          
  Branches       8713       8721     +8   
==========================================
+ Hits          49617      49908   +291   
+ Misses         5075       5030    -45   
- Partials       2627       2690    +63   

Sunburst

Powered by Codecov. Last updated by 11fc0ef...cbba5fe

@jona-sassenhagen
Copy link
Contributor

Both this and #3359 are very appreciated.

@agramfort
Copy link
Member

I don't like the fact that you only use the first image.

I would say that if vmin, vmax are not set I see 2 options:

  • have a different vmin, vmax per channel
  • precompute the smoothed data and set the vmin, vmax globally

no strong feeling

@jona-sassenhagen
Copy link
Contributor

jona-sassenhagen commented Jun 29, 2016

I prefer option 2 - the code is probably more complex, but IMO same range = least surprise.

@mmagnuski
Copy link
Member Author

I also think I prefer option two. I'll add precomputing smoothed data.

evoked = epochs.average(picks)
data = epochs.get_data()[:, picks, :]
n_epochs = len(data)
data = np.swapaxes(data, 0, 1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could do the np.swapaxes in one line with epochs.get_data() and then set n_epochs = data.shape[1] if you prefer.

@mmagnuski
Copy link
Member Author

mmagnuski commented Jun 29, 2016

@agramfort @jona-sassenhagen @dengemann
Travis error is not related (failure to download some dataset), ready for review.

@mmagnuski mmagnuski changed the title set vmin, vmax after smoothing in plot_epochs_image [MRG] set vmin, vmax after smoothing in plot_epochs_image Jun 29, 2016
@agramfort agramfort merged commit 1a641d7 into mne-tools:master Jun 30, 2016
@agramfort
Copy link
Member

thx @mmagnuski

@mmagnuski
Copy link
Member Author

thanks! 🚀

@jona-sassenhagen
Copy link
Contributor

Thanks Mikolaj!

jona-sassenhagen added a commit to jona-sassenhagen/mne-python that referenced this pull request Jul 5, 2016
* 'master' of git://github.com/mne-tools/mne-python: (48 commits)
  FIX: Flake
  fix pep8
  [MRG] FIX Topographic plotting for KIT-UMD data (mne-tools#3349)
  QUICKFIX: logging test
  Error message for simulate evoked. (mne-tools#3372)
  Warnings for big bems. (mne-tools#3374)
  Add test for baseline correction.
  Use apply_baseline in read_evokeds.
  Makes (None, 0) the default value baseline in apply_baseline.
  [FIX] Adds apply_baseline to Evoked
  fix component inds in ica tutorial (mne-tools#3379)
  FIX: Xdawn with shuffled epochs (mne-tools#3373)
  FIX consistency:  Epochs.load_data() should always return self (mne-tools#3376)
  MRG: Build relevant examples (mne-tools#3365)
  [MRG] set vmin, vmax after smoothing in plot_epochs_image (mne-tools#3360)
  [FIX] Attempt to fix circle.
  fixing a bg plotting bug for topo plots
  Modified test and tutorial.
  [MRG] convert surface using python. (mne-tools#3273)
  [MRG] raw.plot_psd() with flat channel (mne-tools#3342)
  ...
@mmagnuski mmagnuski deleted the check_vmin_vmax_after_smoothing branch January 31, 2017 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants