You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to install PySurfer and followed the steps given on the GitHub page. After installation, I just ran the demo code for displaying the aparac.2009 parcellations. I just get a blank screen with a colorbar. The parcellations for gyri and sulci are not displayed. I tried to run the code in the Jupyter notebook and also in the python terminal, but I get the same issue. I have set the environment variable SUBJECTS_DIR as well.
Please find the below code and attached screenshot of the output:
import os
import numpy as np
import nibabel as nib
from surfer import Brain
"""
Make a vector containing the data point at each vertex.
"""
vtx_data = roi_data[labels]
"""
Handle vertices that are not defined in the annotation.
"""
vtx_data[labels == -1] = -1
"""
Display these values on the brain. Use a sequential colormap (assuming
these data move from low to high values), and add an alpha channel so the
underlying anatomy is visible.
"""
brain.add_data(vtx_data, .5, .75, thresh=0, colormap="rocket", alpha=.8)
Can someone direct me on resolving this issue?
Thank you,
Leema
The text was updated successfully, but these errors were encountered:
Hello Team,
I tried to install PySurfer and followed the steps given on the GitHub page. After installation, I just ran the demo code for displaying the aparac.2009 parcellations. I just get a blank screen with a colorbar. The parcellations for gyri and sulci are not displayed. I tried to run the code in the Jupyter notebook and also in the python terminal, but I get the same issue. I have set the environment variable SUBJECTS_DIR as well.
Please find the below code and attached screenshot of the output:
import os
import numpy as np
import nibabel as nib
from surfer import Brain
print(doc)
subject_id = "fsaverage"
hemi = "lh"
surf = "inflated"
os.environ["SUBJECTS_DIR"] = "/home/ubuntu/freesurfer/subjects"
"""
Bring up the visualization.
"""
brain = Brain(subject_id, hemi, surf, background="white")
"""
Read in the automatic parcellation of sulci and gyri.
"""
aparc_file = os.path.join(os.environ["SUBJECTS_DIR"],
subject_id, "label",
hemi + ".aparc.a2009s.annot")
labels, ctab, names = nib.freesurfer.read_annot(aparc_file)
"""
Make a random vector of scalar data corresponding to a value for each region in
the parcellation.
"""
rs = np.random.RandomState(4)
roi_data = rs.uniform(.5, .8, size=len(names))
"""
Make a vector containing the data point at each vertex.
"""
vtx_data = roi_data[labels]
"""
Handle vertices that are not defined in the annotation.
"""
vtx_data[labels == -1] = -1
"""
Display these values on the brain. Use a sequential colormap (assuming
these data move from low to high values), and add an alpha channel so the
underlying anatomy is visible.
"""
brain.add_data(vtx_data, .5, .75, thresh=0, colormap="rocket", alpha=.8)
Can someone direct me on resolving this issue?
Thank you,

Leema
The text was updated successfully, but these errors were encountered: