[Neuroimaging] [PySurfer] When displaying ROI values on the surface, undefined regions are assigned values corresponding to another ROI

Michael Waskom mwaskom at stanford.edu
Sun Jul 5 17:17:20 CEST 2015


Hi Carolyn,

Like Roan I couldn't reproduce your issue. However, from what you
described, it sounds like what happens when the left hemisphere version of
a map is plotted on the right hemisphere, or vice versa. Maybe an earlier
version of the code had hemisphere hard-coded somewhere?

For what it's worth, you could trim down the middle portion of your script
to:

vtx_data = labels == names.index("caudalmiddlefrontal")

which might streamline the code and make it easier to debug.
HTH,
Michael

On Sat, Jul 4, 2015 at 9:04 PM, Carolyn Parkinson <
carolyn.parkinson at gmail.com> wrote:

> 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)
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150705/b8dd4a57/attachment.html>


More information about the Neuroimaging mailing list