Closed LauraGwilliams closed 6 years ago
@LauraGwilliams can you see why travis complains?
I'm not sure the failures are related to this PR (looks like upstream dependency issues?) but once they're sorted out I think this is still going to be broken because pysurfer doesn't install MNE or its sample data during the CI build.
I also think including the MEG-related steps of upsampling/smoothing/etc. adds a lot of complexity to the example, which is already demonstrating something that's much more complex than any of our other scripts.
Could I please request dropping the MNE imports and simplifying the example substantially? Reading in one of our full-resolution fMRI-derived example files will skip a lot of code that seems orthogonal to adding an independent alpha channel. I'd suggest something obvious like reading in lh.sig.nii.gz and setting the alpha baed on one of the (normalized) x/y/z coordinates, or maybe using the (absolute and normalized) lh.alt_sig.nii.gz image.
Could I please request dropping the MNE imports and simplifying the example substantially? Reading in one of our full-resolution fMRI-derived example files will skip a lot of code that seems orthogonal to adding an independent alpha channel. I'd suggest something obvious like reading in lh.sig.nii.gz and setting the alpha baed on one of the (normalized) x/y/z coordinates, or maybe using the (absolute and normalized) lh.alt_sig.nii.gz image.
Agreed. Really anything for demonstration purposes would work, even setting the color of the brain based on the Z coordinate value (higher is hotter!) or something.
OK, no problem! Is there a simple way of loading the x, y, z + triangles from a nii.gz file, such that the rest of the code can stay pretty much the same? I'm having trouble googling the answer to this.
Thank you!
http://nipy.org/nibabel/reference/nibabel.freesurfer.html#nibabel.freesurfer.io.read_geometry
on e.g. SUBJECTS_DIR/subject/surf/lh.white
for white left hemi
The lh.white
file is about 5Gb, which isn't huge, but we should avoid adding something that size to the code repository if possible. It should be sufficient to build a path using the $SUBJECTS_DIR
environment variable, because anyone who is using pysurfer will have this file (and it will exist on travis because we use the basic fsaverage files to run tests).
Once the PR is finalized, I think you'll need to do a rebase so that the checked-in and then removed data file doesn't end up in master. Let us know if you need help with that.
A related question for @larsoner, @agramfort : this example is revealing that several useful attributes of the Brain
attribute (the mlab figure and the geometry) are private. This keeps the public namespace from getting too cluttered, but using them would make this (and similar) applications even easier. Exposing them should probably go in a different PR, but seems like a good idea?
e.g. brain.geo['lh'].coords
is already public, that could be used. But sure making the figures public is reasonable. We can tell them not to modify them or things might break.
e.g. brain.geo['lh'].coords is already public, that could be used.
I'm not sure I knew about that! I'm not sure it's used in any examples ... might be good to add here.
I don't understand what Travis is complaining about -- am I trying to import something that's not allowed?
Fixed in #240 which has now been merged. If you rebase you should get meaningful feedback.
Also feel free to use brain.geo['lh'].coords
instead of manually loading the coordinates, it will simplify things a little bit.
OK! Is there a way of extracting the triangles from brain.geo, too? I can only find the x, y, z...
brain.geo['lh'].faces
Output looks a bit weird but I think it's just a depth rendering / opacity thing:
https://118-1551431-gh.circle-artifacts.com/0/html/auto_examples/plot_custom_colours.html
If you make it opaque it might look better?
Flake errors:
Also let's go with colors
instead of colours
in the filename for consistency :)
thx @LauraGwilliams !
Thank you for all your help with this!! :)
Thanks again for contributing this @LauraGwilliams! I just had the opportunity to make one of these figures and it was very easy with your completed example!
Ah, great, I'm happy to hear @mwaskom! :D
Hi @larsoner,
I have (finally - I'm sorry) put together a draft of the script that allows for plotting custom rgba values. Any feedback is appreciated!
Thanks, Laura
Closes #228