Closed jamalw closed 4 years ago
what version of pysurfer are you using?
it should work with latest version
I'm using version 0.8.0. What's the latest version and do I just do something like "pip install -U pysurfer" to upgrade?
see the code of 0.8 if option was already there. Sorry I don't have time to investigate
0.8 is the latest version and hemi="split"
has been possible since version 0.4.
However there is something strange about the bug report. Calling the Brain
constructor should not result in the execution of the mri_vol2surf
binary. So I suspect the error is being caused when you are doing something that you are not telling us about.
Can you please provide a complete, reproducible example that causes the error?
Below is the code I'm using. The line where best_k = ... (this line) is where the error is coming from. The traceback is below the code.
from mayavi import mlab from surfer import Brain, project_volume_data import scipy import matplotlib.pyplot as plt import nibabel as nib
""" Bring up the visualization window. """ mlab.options.backend = 'envisage' view = "lateral" brain = Brain("fsaverage", "split", "inflated", cortex='low_contrast',views=['lat','med'])
""" Get a path to the overlay file. """ reg_file = '/Applications/freesurfer/average/mni152.register.dat' overlay_file = "/Users/jamalw/Desktop/PNI/music_event_structures/best_k_map.nii.gz"
best_k = project_volume_data('best_k_map.nii.gz', 'split', reg_file)
Traceback (most recent call last):
File "pysurfer_plot.py", line 25, in
MRISread(/Applications/freesurfer/subjects/fsaverage/surf/split.white): could not open file No such file or directory mri_vol2surf: could not read surface /Applications/freesurfer/subjects/fsaverage/surf/split.white No such file or directory
project_volume_data
doesn't accept "split" as a hemisphere value. What it's doing is calling out to Freesurfer to turn a volumetric image into a vector you can plot in PySurfer. Freesurfer is pretty fundamentally oriented around doing things with one hemisphere at a time.
If you have a split brain visualization, you'll need to iterate over hemispheres for the volume-to-surface conversion.
It sounds like you'll basically want to follow the example here: https://pysurfer.github.io/auto_examples/plot_resting_correlations.html
Awesome tip! This actually does allow for all 4 views to be plotted. However, it plots them in 4 separate tabs in the mayavi gui. How do I get all four views in a single plot/tab?
Thanks for the help so far!
However, it plots them in 4 separate tabs in the mayavi gui. How do I get all four views in a single plot/tab?
It sounds like you iterated creating a new Brain
object inside the loop. Create a single Brain
instance at the beginning with hemi='split'
, and iterate over calls to add the vol-to-surf data to this single instance.
I'm trying to use pysurfer to plot brain activations on inflated surfaces. So far, I've been able to get left and right hemisphere plots separately as well as animations. However, whenever I try to plot multiple hemispheres (using Brain(fsaverage, "split",...) as opposed to "lh" or "rh") simultaneously I get the following error:
mri_vol2surf: could not read surface /Applications/freesurfer/subjects/fsaverage/surf/split.white
I've looked everywhere for this file can't seem to find it.
Any help would be greatly apprecaited.
Thanks!