Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Eric Larson
    @larsoner
    for the snapshot stuff, maybe for now instead of adding to MNE, you can build on my tutorial once it's merged
    to show how it can be done
    and if you hear that other groups want similar functionality, then we'll move it to MNE namespace
    for STC there is already an issue, let me find it
    Chris Holdgraf
    @choldgraf
    as in, write an MNE tutorial that just defines the coordinate system transforms within teh function?
    and re: the STC stuff, I can help out a little with that to get it ecog-ready if there's work to be done
    Eric Larson
    @larsoner
    add to my tutorial another ~10 lines that takes the Mayavi plot, and matplotlib+marker-izes it
    mne-tools/mne-python#2995
    it's a bit of a misnomer for you, but the discussion is relevant
    Chris Holdgraf
    @choldgraf
    thanks for the link
    yeah I think that's a big challenge w/ MNE as folks from different backgrounds start to use it
    everybody has their own trigger words for topics they're interested in, and those words are often non-overlapping
    Eric Larson
    @larsoner
    if you just want plots like the one you have it should be easy enough, we just need to add something that gets the nearest cortical vertex to each electrode, pop it into an STC, and wiht some smoothing during plotting it will look like what you had
    Chris Holdgraf
    @choldgraf
    but I think that's where tutorials etc are helpful (like the ecog one you put together)
    yeah it'll probably look better than what I had actually :P
    I briefly looked through the tutorials but I didn't see anything to the effect of "plot activity on a cortical surface" in the "visualization and reporting" section. Maybe that's a place we could try and expose that API in a more general sense
    but either way, after you merge I'll open a PR to show how to turn those coordinates into 2d coordinates by just explaining it in the example
    Eric Larson
    @larsoner
    perfect
    for the plotting bit, basically we need a function that is ECoG specific
    Chris Holdgraf
    @choldgraf
    yea, I was just calling it a "surface activity plot" in my own code
    but basically it's an "ecog activity plot"
    Eric Larson
    @larsoner
    I'll open an issue, we need to decide a name
    but in my mind the functionality is pretty clear
    okay if I share the image you shared with me?
    the one with the STC-like activity?
    Chris Holdgraf
    @choldgraf
    yeah that one is actually already shared earlier in the scatter3d issue :)
    so go for it
    and if people want to look at a version of code that accomplishes that, you can point to https://github.com/choldgraf/ecogtools/blob/master/ecogtools/viz3d.py
    to see how most of it could be done w/ pysurfer etc
    I think the surface activity stuff could be swapped out with some kind of STC plot
    Eric Larson
    @larsoner
    we use bleeding-edge SG
    Chris Holdgraf
    @choldgraf
    ah ok cool - so I'll just make the example the way you've got it there, and we can wait to pull until your SG fix is in?
    I'll make the changes that you suggested today. It'll be in a few hours because I just got the copyedits back for an article that is almost in press. Between that and obsessively refreshing 538 every 10 minutes, that'll take a couple hours.
    Eric Larson
    @larsoner
    heh, yes it will
    no rush from my end
    SG usually moves pretty quickly, that'll probably be in within a week
    then we can merge your PR
    if it takes longer, we can live with the current version
    Chris Holdgraf
    @choldgraf
    ok sounds good. I'll make your changes today then, and will plan to check in next weekend
    though it would be nice if this were merged sometime before SfN gets into full swing, in the off chance that I have an ecog conversation with somebody who's interested in mne-python
    Eric Larson
    @larsoner
    @choldgraf when fitting the ReceptiveField, should the intercept be that of the original data (i.e., constant across delays), or should it be the intercept for the delayed, truncated (which changes the intercept value!), and zero-padded data?
    I am seeing differences between TimeDelayingRidge and Ridge and I think this is a cause
    I'd like to unify them if possible
    I can make TimeDelayingRidge behave like Ridge, or vice-versa
    Eric Larson
    @larsoner
    in the limit it does not matter
    I think I have convinced myself the Ridge way is better with an example that makes the problem bad:
    import numpy as np
    import mne
    from sklearn.linear_model import Ridge
    X = np.random.RandomState(0).randn(10)
    X[0] = 10000
    X[-1] = -10000
    sfreq = 1.
    tmin, tmax = -1, 2
    kernel = [2, 1]
    y = np.convolve(X, kernel, mode='same')
    for est in (Ridge(alpha=0., fit_intercept=True),
                mne.decoding.TimeDelayingRidge(tmin, tmax, sfreq,
                                               fit_intercept=True)):
        rf = mne.decoding.ReceptiveField(tmin, tmax, sfreq,
                                         estimator=est, )
        rf.fit(X[:, np.newaxis], y)
        print(rf.coef_.round(3))
    I get:
    [[-0.01   1.944  1.008  0.01 ]]
    [[ 0.1  2.   0.9 -0.1]]
    i.e., Ridge does better
    Chris Holdgraf
    @choldgraf
    I'm +1 to doing whatever looks empirically better :-)