Skip to content

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

@Leema-Krishna-Murali

Description

@Leema-Krishna-Murali

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions