[Mne_analysis] extract label time course for resting state data

Denis-Alexander Engemann denis.engemann at gmail.com
Fri Oct 20 16:49:56 EDT 2017
Search archives:

Hi Noam,

I think you might want to use the utils we engineered with Sheraz earlier
this year. I will contribute them to MNE over the forthcoming months. But
the API might change a bit as not everyone agrees that we should use
mne.io.RawArray as terminal container for source rest time courses.

Denis
On Fri 20 Oct 2017 at 22:46, Peled, Noam <NPELED at mgh.harvard.edu> wrote:

> I ended up using the following code, instead of
> stc.extract_label_time_course:
>
> label_flip = mne.label_sign_flip(label, src)[:, None].squeeze()
> label_flip = np.tile(label_flip, (stc.data.shape[1], 1)).T
> label_tc = np.mean(label_flip * stc.data, axis=0)
>
>
> The problem was in the last line. originally it's:
>
> np.mean(flip * stc.data[vertidx, :], axis=0)
> Which doesn't work if the stc was calculated specifically for the label using
>
> mne.minimum_norm.apply_inverse_raw(
>     raw, inverse_operator, lambda2, inverse_method, label=label)
>
>
> Does it make sense?
> Thanks,
>
> Noam
>
>
>
>
>
> ------------------------------
> *From:* mne_analysis-bounces at nmr.mgh.harvard.edu <
> mne_analysis-bounces at nmr.mgh.harvard.edu> on behalf of Peled, Noam <
> NPELED at mgh.harvard.edu>
> *Sent:* Friday, October 20, 2017 4:10:46 PM
> *To:* mne_analysis at nmr.mgh.harvard.edu
> *Subject:* [Mne_analysis] extract label time course for resting state data
>
>
> Hi all,
>
> I'm trying to extract the labels time course for a long resting state data
> (from HCP)
>
> What would be a good approach for that?
>
> I've tried first to use mne.minimum_norm.apply_inverse_raw, but it was
> too much for my computer and it crashed because of memory error.
>
> Then, I've tried to create an stc file for each label, to extract later
> the time course. But then I got the error that the stc is not compatible
> with source space, which it true.
>
> Maybe I should use the apply_inverse_raw each time for short windows? I
> prefer to get the full time course of each label if possible.
>
>
> Thanks,
>
> Noam
>
>
> _______________________________________________
> Mne_analysis mailing list
> 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/20171020/90da1b32/attachment-0001.html 


More information about the Mne_analysis mailing list