[Neuroimaging] Use of atlas to compute Z-Scores

Christophe Pallier christophe at pallier.org
Thu Feb 15 03:37:47 EST 2018


> The error message is indeed a bit confusing.

But the page of documentation it points to (
http://nilearn.github.io/manipulating_images/input_output.html) tackles
this issue in the first section, and I think is quite nice.

On Thu, Feb 15, 2018 at 9:24 AM, Christophe Pallier <christophe at pallier.org>
wrote:

> Ah! if you put the single filename in a list as argument to fit_transform,
> it should work I think (please confirm).
> The error message is indeed a bit confusing.
>
>
> On Thu, Feb 15, 2018 at 9:06 AM, Gabriel Reynés <greynell at gmail.com>
> wrote:
>
>> Dear all,
>>
>> thank you for all responses. My main problem was that the
>> function masker.fit_transform() needs a 4D image to work. I was trying
>> to perform the computation first with the single patient and this error was
>> raised:
>>
>> "DimensionError: Input data has incompatible dimensionality: Expected
>> dimension is 4D and you provided a 3D image. See
>> http://nilearn.github.io/manipulating_images/input_output.html.
>> "
>>
>> To solve that, based in your example, I saw that I need to perform the
>> fit_transform over the single subject and the normal database at the same
>> time, this is more cpu-consuming and prone to errors, but know seems to
>> work just fine.
>>
>> Thanks!
>>
>>
>> Best regards,
>>
>>
>> Gabriel
>>
>> 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
>



-- 
--
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/20180215/13e98130/attachment.html>


More information about the Neuroimaging mailing list