[Mne_analysis] How to set atlas

Vivek Sharma vivek.sharma1510 at gmail.com
Mon Feb 4 05:09:04 EST 2019
Search archives:

        External Email - Use Caution        

I'm still not able to reduce the number of vertices to 68.
let me again explain my problem with more detail:
I'm using the following command to generate source estimates...

*stc = mne.minimum_norm.apply_inverse_raw(raw, inverse_operator, lambda2,
method='eLORETA', label=None, start=60, stop=240, nave=1, time_func=None,
pick_ori=None, buffer_size=None, prepared=False, method_params=None,
verbose=None)*

The output of above command contains 8175 vertices and I want to reduce the
number of vertices to 68 which is according to Desikan atlas.
To reduce the vertices I use the following code:


*label = mne.read_labels_from_annot('subject', hemi='both', parc='aparc',
subjects_dir=subjects_dir, regexp=None)[0]*
*stc1 = stc.in_label(label)*


Now the stc1 contain 35 vertices but I want 68 (Desikan)

On Wed, Jan 23, 2019 at 9:40 PM Diptyajit Das <bmedasdiptyajit at gmail.com>
wrote:

>         External Email - Use Caution
>
> .in_label(label) takes a single argument i.e., single label. Just combine
> the both labels and continue. For details, see this:
>
> https://martinos.org/mne/stable/generated/mne.SourceEstimate.html?highlight=in_label#mne.SourceEstimate.in_label
>
> On Wed, Jan 23, 2019 at 4:59 PM Vivek Sharma <vivek.sharma1510 at gmail.com>
> wrote:
>
>>         External Email - Use Caution
>>
>> When I run this command, label = mne.read_labels_from_annot(subject,
>> hemi=hemi, parc='aparc', subjects_dir=subjects_dir, regexp=regexp)[0], with
>> [0] at the end I could run the next command stc = stc.in_label(label),
>> successfully but it reduces the number of vertices to 35, whereas when I do
>> not use '[0]' at the end of command, I could not run the next command, it
>> gives the following error:
>> >>> label = mne.read_labels_from_annot('sub-CC721377_T1w', hemi='both',
>> parc='aparc', subjects_dir=subjects_dir, regexp=None)
>> Reading labels from parcellation...
>>    read 34 labels from
>> /home/vivek/Downloads/freesurfer/subjects/sub-CC721377_T1w/label/lh.aparc.annot
>>    read 34 labels from
>> /home/vivek/Downloads/freesurfer/subjects/sub-CC721377_T1w/label/rh.aparc.annot
>> >>> stc_label.in_label(label)
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File
>> "/home/vivek/anaconda3/lib/python3.7/site-packages/mne/source_estimate.py",
>> line 1197, in in_label
>>     if label.subject is not None and self.subject is not None \
>> AttributeError: 'list' object has no attribute 'subject'
>>
>>
>> On Wed, Jan 23, 2019 at 6:52 PM Diptyajit Das <bmedasdiptyajit at gmail.com>
>> wrote:
>>
>>>         External Email - Use Caution
>>>
>>> Follow this:
>>> https://github.com/mne-tools/mne-python/issues/5850
>>>
>>> best,
>>>
>>> On Tue, Jan 22, 2019 at 11:18 AM Vivek Sharma <
>>> vivek.sharma1510 at gmail.com> wrote:
>>>
>>>>         External Email - Use Caution
>>>>
>>>> Hi,
>>>> Thanks for the code.
>>>> I tried with this method but it reduces the number of vertices to 35, I
>>>> want it to be 68 according to Desikan atlas.
>>>>
>>>> On Thu, Jan 17, 2019 at 5:12 PM Diptyajit Das <
>>>> bmedasdiptyajit at gmail.com> wrote:
>>>>
>>>>>         External Email - Use Caution
>>>>>
>>>>> Hi,
>>>>>
>>>>> You do cortical parcellation by using some atlas. I think what you
>>>>> meant is to restrict the dipoles activity to some particular brain regions.
>>>>> For that,  you need to pass the 'label'  during source estimation or you
>>>>> can do something like this after the source estimate:
>>>>>
>>>>> code:
>>>>> regexp = 'bankssts'     # name the brain region that you are
>>>>> interested in
>>>>> hemi = 'both'  # taking both hemisphere
>>>>> label = mne.read_labels_from_annot(subject, hemi=hemi, parc='aparc',
>>>>> subjects_dir=subjects_dir, regexp=regexp)[0]    # read the label of the
>>>>> particular region based on Desikan atlas (i.e., defined by 'aparc')
>>>>> stc = stc.in_label(label)  # restrict the dipoles to that particular
>>>>> label
>>>>>
>>>>>
>>>>> best,
>>>>>
>>>>> Dip
>>>>>
>>>>> On Thu, Jan 17, 2019 at 12:05 PM Vivek Sharma <
>>>>> vivek.sharma1510 at gmail.com> wrote:
>>>>>
>>>>>>         External Email - Use Caution
>>>>>>
>>>>>> Okay.
>>>>>> The source estimate file I'm getting consists of 8175 vertices
>>>>>> (SourceEstimate  |  8175 vertices) , I wanted to reduce the number of
>>>>>> vertices to the ROIs, in my case I wanted to use Desikan atlas.
>>>>>> How can I reduce the number of vertices, specific to certain atlases?
>>>>>>
>>>>>> On Thu, Jan 17, 2019 at 2:10 PM Alexandre Gramfort <
>>>>>> alexandre.gramfort at inria.fr> wrote:
>>>>>>
>>>>>>>         External Email - Use Caution
>>>>>>>
>>>>>>> make_watershed_bem uses an atlas to get a good skull segmentation
>>>>>>>
>>>>>>> it's not an atlas of the cortical surface as you suggest
>>>>>>>
>>>>>>> HTH
>>>>>>> A
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Mne_analysis mailing list
>>>>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Vivek Sharma
>>>>>> _______________________________________________
>>>>>> Mne_analysis mailing list
>>>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>>
>>>>> _______________________________________________
>>>>> Mne_analysis mailing list
>>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>
>>>>
>>>>
>>>> --
>>>> Vivek Sharma
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>>
>>
>> --
>> Vivek Sharma
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis



-- 
Vivek Sharma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190204/d9800fde/attachment-0001.html 


More information about the Mne_analysis mailing list