[Mne_analysis] extract label time course for resting state data

Sheraz Khan, PhD sheraz at nmr.mgh.harvard.edu
Fri Oct 20 18:21:41 EDT 2017
Search archives:

Hi Noam,

Denis and me, work a lot on label representative time series, I have some
adhoc code you might try.

Thanks

Sheraz


> 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.
>>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis


-------------------------
Sheraz Khan, M.Eng, Ph.D.
Instructor in Neurology

Athinoula A. Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Harvard Medical School

McGovern Institute for Brain Research
Massachusetts Institute of Technology

Tel:   +1 617-643-5634
Fax:   +1 617-948-5966
Email: sheraz at nmr.mgh.harvard.edu
       sheraz at mit.edu
Web:   http://sheraz.mit.edu


More information about the Mne_analysis mailing list