GithubHelp home page GithubHelp logo

Comments (16)

larsoner avatar larsoner commented on May 22, 2024

Yeah, it looks like it's only designed to work with Ico source spaces, not Oct -- is there some way to make it work with Oct, though? (I'm not too familiar with this...)

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

Okay, I take it back, it seems to work okay. If I add patch info and use:

connectivity = mne.spatio_temporal_src_connectivity(src, n_times=1, dist=5e-3)

I get a connectivity matrix of the same size (8196 x 8196). So the inverse operator is selecting a subset of vertices to use...?

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

In any case, we should figure out how to deal with the mismatch between the source estimates that are generated, and the size of these connectivity matrices.

from mne-python.

agramfort avatar agramfort commented on May 22, 2024

can it be because some sources are too close to the inner skull and excluded from the source space?

from mne-python.

agramfort avatar agramfort commented on May 22, 2024

the --mintdist param in the mne_do_forward_solution

from mne-python.

mluessi avatar mluessi commented on May 22, 2024

+1 this would make most sense

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

Probably. I'm not sure if there is an easy way to detect this just from the source space instance, though, so I'm not sure how we'd throw an error...

from mne-python.

agramfort avatar agramfort commented on May 22, 2024

can you give the lines of code that would fail as a test?

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

Sure thing:

import mne
data_path = mne.datasets.sample.data_path('..')
fname_inv = data_path + '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif'
inverse_operator = mne.minimum_norm.read_inverse_operator(fname_inv)
connectivity = mne.spatio_temporal_src_connectivity(inverse_operator['src'], 
                                                    n_times=1)
a = connectivity.shape[0] 
b = sum([s['nuse'] for s in inverse_operator['src']])
assert a == b

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

Basically, a user could assume that the STC they get from using that inverse_operator could be used in spatio-temporal clustering, and it can't very easily since the inverse_operator does not use the whole source space.

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

One solution would be to morph the STC from the subject to itself, going from the subset of vertices used by inverse_operator to the full set of source space vertices, but this seems less appealing than somehow being able to generate a connectivity matrix that is compatible with the inverse_operator in the first place.

from mne-python.

agramfort avatar agramfort commented on May 22, 2024

Basically, a user could assume that the STC they get from using that inverse_operator could be used in spatio-temporal clustering, and it can't very easily since the inverse_operator does not use the whole source space.

why should the spatio temporal clustering break if sources are ignored
by the inverse operator?
I agree that it can produce artifacts like a clustering not going over
the top of the gyrus but is
that a really issue? just asking.

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

The clustering breaks because the STC files generated by that inverse_operator will not have the same number of vertices as the connectivity matrix. They will have b vertices, while the connectivity matrix will have a vertices.

from mne-python.

agramfort avatar agramfort commented on May 22, 2024

The clustering breaks because the STC files generated by that inverse_operator will not have the same number of vertices as the connectivity matrix. They will have b vertices, while the connectivity matrix will have a vertices.

how about restricting the connectivity to the used vertices that you
find in the source space structure?

iuse key if I remember.

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

That could work. I can give it a shot and see how it goes.

from mne-python.

larsoner avatar larsoner commented on May 22, 2024

Alright @agramfort, I think this fixes the issue, and I added a test. I have it raise a warning to the user so they know it's being subsampled.

from mne-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.