Skip to content

ENH: Flatmaps #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
larsoner opened this issue Oct 3, 2017 · 2 comments
Closed

ENH: Flatmaps #214

larsoner opened this issue Oct 3, 2017 · 2 comments

Comments

@larsoner
Copy link
Contributor

larsoner commented Oct 3, 2017

I'm interested in doing flatmaps with PySurfer. Has anyone tried this?

A very naive approach did not work:

>>> brain = surfer.Brain('fsaverage', 'lh', 'cortex.patch.flat')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/larsoner/custombuilds/PySurfer/surfer/viz.py", line 451, in __init__
    geo.load_geometry()
  File "/home/larsoner/custombuilds/PySurfer/surfer/utils.py", line 126, in load_geometry
    coords, faces = nib.freesurfer.read_geometry(surf_path)
  File "/home/larsoner/miniconda3/envs/mne/lib/python3.6/site-packages/nibabel/freesurfer/io.py", line 128, in read_geometry
    quads = quads.reshape(nquad, 4)
ValueError: cannot reshape array of size 0 into shape (4665600,4)
@mwaskom
Copy link
Member

mwaskom commented Oct 3, 2017

Patch files are a completely different format.

I have a notebook where I got part of the way: https://gist.github.com/mwaskom/fab1970208a5c458869b3d8831fb7788

In general I'd think plotting on flat maps would be better handled by matplotlib than mayavi.

@larsoner
Copy link
Contributor Author

larsoner commented Oct 3, 2017

Patch files are a completely different format.

I'm guessing there is no simple mapping to vertices, then :(

In general I'd think plotting on flat maps would be better handled by matplotlib than mavavi.

Yeah that's true. And then Mayavi wouldn't be a blocker. PySurfer does a ton of stuff (add_data, time steps, videos, etc.) that would be nice to have in both cases. We could consider using a matplotlib backend when using the flat maps, but that would be quite a big degree of added difficulty :)

I probably won't dig into it now, then, since it's not so simple.

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

No branches or pull requests

2 participants