[Neuroimaging] Extract max values from fit.transform()
Christophe Pallier
christophe at pallier.org
Wed Mar 7 11:57:19 EST 2018
> The problem is that region_data is the mean value. Is there some way to
extract the maximum value? Or another specific function (min, median...)?
I do not know if it is possible with masker.fit_transform, however you can
do it in a few steps:
- by using get_data() on the z-image to get a 3d array.
- then, for each ROI, by masking the data with the ROI mask as a boolean
array, and then use any numpy function on the result.
Note that the shape of the z-image and the mask must be exactly the same
(there is no resampling).
Hope this helps,
Christophe
On Wed, Mar 7, 2018 at 5:26 PM, Gabriel Reynés <greynell at gmail.com> wrote:
> This is a question related to a previous subject " [Neuroimaging] Use of
> atlas to compute Z-Scores
> <https://mail.python.org/pipermail/neuroimaging/2018-February/001646.html>
> ".
>
> I have an image of Z-Scores values. I want to extract the maximum Z-score
> from each region based on an atlas.
>
> So far, I use:
>
> aal = datasets.fetch_atlas_aal('SPM12')
> masker = input_data.NiftiLabelsMasker(aal.maps, standardize = True)
> region_data = masker.fit_transform([path_to_ZScore_image])
>
>
> The problem is that region_data is the mean value. Is there some way to
> extract the maximum value? Or another specific function (min, median...)?
>
>
> 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/20180307/21c9618b/attachment.html>
More information about the Neuroimaging
mailing list