[Neuroimaging] [PySurfer] When displaying ROI values on the surface, undefined regions are assigned values corresponding to another ROI
Carolyn Parkinson
carolyn.parkinson at gmail.com
Sun Jul 5 06:04:04 CEST 2015
Hello,
I hope this is the right place for this question! The PySurfer site directs
questions to the NiPy mailing list, which this list appears to have
replaced.
I'm using PySurfer to display results from an analysis performed within
each region of Freesurfer's Desikan-Killiany atlas on the surface.
However, I've noticed that whatever value is assigned to the ROI
'caudalmiddlefrontal' in my results also appears to get mapped to the
undefined regions of the surface model in the medial view. I've included
some code below to show what I mean.
Is there anything that I should be doing differently in order to avoid this?
Thanks very much,
Carolyn
import os
import numpy as np
import nibabel as nib
from surfer import Brain
# Set parameters
subject_id = "fsaverage"
hemi = "lh"
# Read in the Desikan-Killiany atlas annotation
aparc_file = os.path.join(os.environ["SUBJECTS_DIR"], subject_id, "label",
hemi + ".aparc.annot")
labels, ctab, names = nib.freesurfer.read_annot(aparc_file)
# Make a list of values to display in each ROI
# All ROIs but 'caudalmiddlefrontal' are assigned 0
roi_data_list = []
for roi in names:
if roi == 'caudalmiddlefrontal':
roi_data_list.append(1)
else:
roi_data_list.append(0)
roi_data = np.array(roi_data_list)
# Make a vector of values corresponding to each vertex
vtx_data = roi_data[labels]
# Bring up the visualization
brain = Brain(subject_id, hemi, "inflated", config_opts = dict(background =
"white", cortex = 'bone'))
brain.add_data(vtx_data, -1, 1,colormap = "coolwarm", alpha = .75)
brain.add_annotation('aparc', borders = 4)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150705/4bac067e/attachment.html>
More information about the Neuroimaging
mailing list