<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Great! Thanks!</p>
<p>Using the code in the previous email I've extracted the time course of the <span>
Lausanne125 parcellation</span>. I just need to double check it.</p>
<p>Is your code on the mne-hcp github?</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Noam<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Sheraz Khan, PhD <sheraz@nmr.mgh.harvard.edu><br>
<b>Sent:</b> Friday, October 20, 2017 6:21:41 PM<br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Cc:</b> Discussion and support forum for the users of MNE Software; Peled, Noam<br>
<b>Subject:</b> Re: [Mne_analysis] extract label time course for resting state data</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Noam,<br>
<br>
Denis and me, work a lot on label representative time series, I have some<br>
adhoc code you might try.<br>
<br>
Thanks<br>
<br>
Sheraz<br>
<br>
<br>
> Hi Noam,<br>
><br>
> I think you might want to use the utils we engineered with Sheraz earlier<br>
> this year. I will contribute them to MNE over the forthcoming months. But<br>
> the API might change a bit as not everyone agrees that we should use<br>
> mne.io.RawArray as terminal container for source rest time courses.<br>
><br>
> Denis<br>
> On Fri 20 Oct 2017 at 22:46, Peled, Noam <NPELED@mgh.harvard.edu> wrote:<br>
><br>
>> I ended up using the following code, instead of<br>
>> stc.extract_label_time_course:<br>
>><br>
>> label_flip = mne.label_sign_flip(label, src)[:, None].squeeze()<br>
>> label_flip = np.tile(label_flip, (stc.data.shape[1], 1)).T<br>
>> label_tc = np.mean(label_flip * stc.data, axis=0)<br>
>><br>
>><br>
>> The problem was in the last line. originally it's:<br>
>><br>
>> np.mean(flip * stc.data[vertidx, :], axis=0)<br>
>> Which doesn't work if the stc was calculated specifically for the label<br>
>> using<br>
>><br>
>> mne.minimum_norm.apply_inverse_raw(<br>
>> raw, inverse_operator, lambda2, inverse_method, label=label)<br>
>><br>
>><br>
>> Does it make sense?<br>
>> Thanks,<br>
>><br>
>> Noam<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> ------------------------------<br>
>> *From:* mne_analysis-bounces@nmr.mgh.harvard.edu <<br>
>> mne_analysis-bounces@nmr.mgh.harvard.edu> on behalf of Peled, Noam <<br>
>> NPELED@mgh.harvard.edu><br>
>> *Sent:* Friday, October 20, 2017 4:10:46 PM<br>
>> *To:* mne_analysis@nmr.mgh.harvard.edu<br>
>> *Subject:* [Mne_analysis] extract label time course for resting state<br>
>> data<br>
>><br>
>><br>
>> Hi all,<br>
>><br>
>> I'm trying to extract the labels time course for a long resting state<br>
>> data<br>
>> (from HCP)<br>
>><br>
>> What would be a good approach for that?<br>
>><br>
>> I've tried first to use mne.minimum_norm.apply_inverse_raw, but it was<br>
>> too much for my computer and it crashed because of memory error.<br>
>><br>
>> Then, I've tried to create an stc file for each label, to extract later<br>
>> the time course. But then I got the error that the stc is not compatible<br>
>> with source space, which it true.<br>
>><br>
>> Maybe I should use the apply_inverse_raw each time for short windows? I<br>
>> prefer to get the full time course of each label if possible.<br>
>><br>
>><br>
>> Thanks,<br>
>><br>
>> Noam<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Mne_analysis mailing list<br>
>> Mne_analysis@nmr.mgh.harvard.edu<br>
>> <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
>><br>
>><br>
>> The information in this e-mail is intended only for the person to whom<br>
>> it<br>
>> is<br>
>> addressed. If you believe this e-mail was sent to you in error and the<br>
>> e-mail<br>
>> contains patient information, please contact the Partners Compliance<br>
>> HelpLine at<br>
>> <a href="http://www.partners.org/complianceline">http://www.partners.org/complianceline</a> . If the e-mail was sent to you<br>
>> in<br>
>> error<br>
>> but does not contain patient information, please contact the sender and<br>
>> properly<br>
>> dispose of the e-mail.<br>
>><br>
> _______________________________________________<br>
> Mne_analysis mailing list<br>
> Mne_analysis@nmr.mgh.harvard.edu<br>
> <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
-------------------------<br>
Sheraz Khan, M.Eng, Ph.D.<br>
Instructor in Neurology<br>
<br>
Athinoula A. Martinos Center for Biomedical Imaging<br>
Massachusetts General Hospital<br>
Harvard Medical School<br>
<br>
McGovern Institute for Brain Research<br>
Massachusetts Institute of Technology<br>
<br>
Tel: +1 617-643-5634<br>
Fax: +1 617-948-5966<br>
Email: sheraz@nmr.mgh.harvard.edu<br>
sheraz@mit.edu<br>
Web: <a href="http://sheraz.mit.edu">http://sheraz.mit.edu</a><br>
</div>
</span></font>
</body>
</html>