gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
592 stars 138 forks source link

FIX keep current sampler when dataview changes - v2 #422

Closed TomDLT closed 2 years ago

TomDLT commented 2 years ago

This is a second attempt to fix the issue described in #420 (which was reverted in #421).

mvdoc commented 2 years ago

This (and probably the previous version too) works with cortex.Volume objects, but not cortex.Vertex. I think this is because samplers exist only for cortex.Volume but not cortex.Vertex objects.

This works fine

vol = cortex.Volume.random("S1", "fullhead")
cortex.webgl.show(vol)

Instead, this keeps spinning on "Loading brain..."

vertex = cortex.Vertex.random("S1")
cortex.webgl.show(vertex)
TomDLT commented 2 years ago

Makes sense, thanks for testing it, I'll see how to fix it.

TomDLT commented 2 years ago

I did reproduce the issue with Vertex, and fixed it by defining an empty method setFilter. It works on my machine, please let me know if this new fix works for you.

mvdoc commented 2 years ago

Nice! I can confirm it works. Thanks!