[Neuroimaging] Use of atlas to compute Z-Scores

Christophe Pallier christophe at pallier.org
Wed Feb 14 05:40:42 EST 2018


Sorry, I can't provide an example right now as I am super busy, but the
magic is that you do not need to iterate at all!
You will get an array of one value (the average) per ROI (the ROIs are
numbered 1 to n in the mask file).

I just greped in the examples folder of nilearn and there are two scripts
that you may want to check:


./04_manipulating_images/plot_roi_extraction.py:# We extract data from ROIs
using nilearn's NiftiLabelsMasker

./03_connectivity/plot_signal_extraction.py:masker =
NiftiLabelsMasker(labels_img=atlas_filename, standardize=True,




On Wed, Feb 14, 2018 at 11:25 AM, Gabriel Reynés <greynell at gmail.com> wrote:

> Dear Christophe  ,
>
>
> Thanks for your answer! I spent many hours triyng to figure the behaviour
> of NiftiLabelsMasker
> I do not understand how to iterate over each mask ROI.
>
> How one can iterate over each label of a masker?
>
> `# Obtain AAL Atlas
> aal = datasets.fetch_atlas_aal('SPM12')
> aal_labels = aal.labels
>
> # Obtain mask
> masker = input_data.NiftiLabelsMasker(aal.maps)
>
> # Input image to compute the mean value for each
> patient_img = image.load_img(path_nii)
> patient_img  = patient_img.get_data()
>
> # Fit the mask to the image
> masker_fit(patient_img)
> mask_img = masker_fit.mask_img_
>
> Thanks in advance,
>
>
> Gabriel
>
>
>
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>


-- 
--
Christophe Pallier <christophe at pallier.org>
INSERM-CEA Cognitive Neuroimaging Lab, Neurospin, bat 145,
91191 Gif-sur-Yvette Cedex, France
Tel: 00 33 1 69 08 79 34
Personal web site: http://www.pallier.org
Lab web site: http://www.unicog.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20180214/27b4b005/attachment.html>


More information about the Neuroimaging mailing list