[Mne_analysis] Issues generating functional labels for RH

Cushing, Cody CCUSHING1 at mgh.harvard.edu
Fri Mar 4 12:34:32 EST 2016
Search archives:

Hi Natalie and others,

It was actually just my failure to understand the syntax of the output.  I needed to change this line:

func_labels,_ = mne.stc_to_label(stc_mean_label, src=src, smooth=True,
                                  subjects_dir=subjects_dir, connected=True)
to:

_,func_labels = mne.stc_to_label(stc_mean_label, src=src, smooth=True,
                                  subjects_dir=subjects_dir, connected=True)

in order to get my list of rh labels.  Thus the emptiness of my list of right hemisphere labels.  Thanks to Ivan on the martinos-python list for pointing that out.  So (in case it helps anyone else), something like:

func_labels_lh, func_labels_rh = mne.stc_to_label(stc_mean_label, src=src, smooth=True,
                                  subjects_dir=subjects_dir, connected=True)

would get me two lists, each containing the respective lh and rh labels (as I'm imagining is obvious to anyone with more than a week's worth of python experience).

Thanks for trying to help Natalie!
________________________________
From: mne_analysis-bounces at nmr.mgh.harvard.edu [mne_analysis-bounces at nmr.mgh.harvard.edu] on behalf of Natalie Klein [neklein at andrew.cmu.edu]
Sent: Friday, March 04, 2016 11:08 AM
To: Discussion and support forum for the users of MNE Software
Subject: Re: [Mne_analysis] Issues generating functional labels for RH

My guess is stc_to_label doesn't like 'connected=True' when you have vertices in both hemispheres but I have not looked at the source code. You could try 'connected=False' which should return labels in each hemisphere according to the documentation. Either that, or try to figure out why your parcellation labels are resulting in vertices in both hemispheres and change that. (The ROIs I used to restrict the stc were hand drawn in Freesurfer, so when I use 'stc.in_label(label)', I only get vertices in one hemisphere; 'stc.vertices' returns a list in which one of the arrays is empty.)

On Fri, Mar 4, 2016 at 9:57 AM, Cushing, Cody <CCUSHING1 at mgh.harvard.edu<mailto:CCUSHING1 at mgh.harvard.edu>> wrote:
Hm, well the problem must be with me somewhere then.  If I run the code for a right hemi parc, I get:

In [50]: stc_mean.vertices
Out[50]:
[array([    12,     68,     76, ..., 132204, 132241, 132257]),
 array([     7,     38,     43, ..., 134417, 134419, 134449])]

If I run it on the left hemisphere, I get the exact same thing.  Do those two arrays represent vertices for each hemisphere?  Or is that telling me its looking at the same vertices (only in the lh) when looking for rh activation?

________________________________
From: mne_analysis-bounces at nmr.mgh.harvard.edu<mailto:mne_analysis-bounces at nmr.mgh.harvard.edu> [mne_analysis-bounces at nmr.mgh.harvard.edu<mailto:mne_analysis-bounces at nmr.mgh.harvard.edu>] on behalf of Natalie Klein [neklein at andrew.cmu.edu<mailto:neklein at andrew.cmu.edu>]
Sent: Friday, March 04, 2016 9:46 AM
To: Discussion and support forum for the users of MNE Software
Subject: Re: [Mne_analysis] Issues generating functional labels for RH

I've recently run my own code based on this example and it works for both hemispheres. Just guessing here, but what does stc_mean.vertices look like? Does it have vertices in the correct hemisphere?

On Fri, Mar 4, 2016 at 9:37 AM, Cushing, Cody <CCUSHING1 at mgh.harvard.edu<mailto:CCUSHING1 at mgh.harvard.edu>> wrote:
Hi all,

I have been attempting to generate functional labels from source estimates for a data set as outlined here:  https://martinos.org/mne/stable/auto_examples/inverse/plot_label_from_stc.html#sphx-glr-auto-examples-inverse-plot-label-from-stc-py

This works beautifully for all the left hemisphere parcellations I try, but whenever I try a right hemisphere counter-part, the list of func_labels return empty, causing the below indexing error:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
[] in <module>()
     57
     58 # take first as func_labels are ordered based on maximum values in stc
---> 59 func_label = func_labels[0]
     60
     61

IndexError: list index out of range

I have tried a couple of subjects and a variety of different parc labels.  I have played with different time windows and eventually just opened it up to the whole trial (1s).  Every lh parc label works fine, but not a single rh parc I have tried returns any functional labels from this line of code:

func_labels,_ = mne.stc_to_label(stc_mean_label, src=src, smooth=True,
                                  subjects_dir=subjects_dir, connected=True)

There is data in stc_mean_label.data.  I do not believe it could be due to a lack of right hemisphere activation because looking at the dSPM activations in mne_analyze shows just as much if not more activity in the right hemisphere for the parcellation pairs I've looked at (e.g. fusiform-rh and fusiform-lh).  The label is read fine (from the proper hemisphere), so I'm not quite sure what the problem is.  Is it possible that the empty return is a result of the module only looking in left hemisphere source space (where obviously no right hemisphere activation will be found)?

Any help is greatly appreciated and I'm happy to supply whatever additional information.  The only changes I have made from the source code are supplying in my own paths for my personal data, but I am happy to provide my code upon request.

Cheers,
Cody

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu<mailto:Mne_analysis at nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.



_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu<mailto:Mne_analysis at nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160304/157af385/attachment.html 


More information about the Mne_analysis mailing list