Overlaying multiple labels on a surface in mne_analyze

Hi,

Is it possible to overlay multiple layers at the same time (ideally in
different colors) on a surface in mne_analyze?

Thanks,
Steve

Stephen Politzer-Ahles
New York University, Abu Dhabi
Psychology Department
http://files.nyu.edu/spa268/public
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20130813/74ca0151/attachment.html

I have not found a way to do it in mne_analyze, but it is quite easy in
PySurfer.

Best,
Eric

Hi Eric,

Thanks for the feedback. Is it also possible to draw labels in PySurfer?
The reason I ask is because I have some funky labels (labels which were
defined on a decimated source space instead of a Freesurfer surface, so
when I plot them they show up as a bunch of disconnected points rather than
as nice contiguous areas), so I was hoping to just draw labels around them
to make nicer-looking plots; but to keep them from overlapping with
neighboring labels, I would probably need to be able to overlay a few at
once. (I tried doing this in Freesurfer by turning my labels into an
annotation and plotting the annotation, but I've been running into issues
with that pipeline, so I thought I'd try it in MNE instead.)

Best,
Steve

Stephen Politzer-Ahles
New York University, Abu Dhabi
Psychology Department
http://files.nyu.edu/spa268/public

Hey Steve,

In mne-python, you can load your label using 'label = mne.read_label(...)'
and then just use the 'label.smooth(...)' method -- it will do exactly what
you want, namely fill in a label so it becomes contiguous if it was
produced on a decimated surface. If the label was produced on fsaverage, 2
smoothing steps should be enough (although it will look jagged so 3-5 might
look better), otherwise you might need more. Drawing labels in PySurfer is
then as easy as doing brain.add_label(label, color='r', alpha=0.5), because
it has been coded to understand mne-python Label objects. One of the
options for "add_label" is to use outlines. PySurfer then also has a
brain.save_image() method to save the image. This makes scripting figures
easy, if you're into that. This is the pipeline I've adopted recently with
seemingly nice results.

Eric

Thanks, I'll give that a shot!

Stephen Politzer-Ahles
New York University, Abu Dhabi
Psychology Department
http://files.nyu.edu/spa268/public

Hi Eric,

What's the best way to install pysurfer to get this label ability. I've been
using the version the gets installed via pip. But that is pysurfer 0.3.1 is
there a newer release that has this change. Should I just grab the master
branch from git hub and install from source? How stable is the master
branch?

Thanks.

Luke

[mailto:mne_analysis-bounces at nmr.mgh.harvard.edu] On Behalf Of Eric Larson

Support for mne-python label objects is in master on the PySurfer github
site. It hasn't been released yet, but I /think/ PySurfer might be planning
another release soon, if it matters in your decision. The master branch has
been stable in my experience (it's what I use).

Installing from source should be fairly straightforward ("git clone git://
github.com/nipy/PySurfer.git", then "python setup.py install", maybe with a
"--user" if appropriate).

Eric