Skip to content
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

PySurfer Installation - Blank GUI screen with only colorbar display #308

Open
Leema-Krishna-Murali opened this issue Oct 26, 2021 · 0 comments

Comments

@Leema-Krishna-Murali
Copy link

Leema-Krishna-Murali commented Oct 26, 2021

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
PySurfer_visualization

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

1 participant