Module Expr Str ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr keyword Num Print BinOpMod Str SubscriptLoad AttributeLoad NameLoad attr Index Num Print BinOpMod Str SubscriptLoad AttributeLoad NameLoad attr Index Num ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Num keyword SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Str Expr Call AttributeLoad NameLoad attr
N/A N/A 
Comparing the means of 2 images
===============================

The goal of this example is to illustrate the use of the function
:func:`nilearn.image.math_img` with a list of images as input.
We compare the means of 2 resting state 4D images. The mean of the images
could have been computed with nilearn :func:`nilearn.image.mean_img` function.
 nilearn datasets N/A dataset N/A N/A datasets fetch_adhd n_subjects 2 N/A N/A Subject 1 resting state dataset at: %s N/A N/A dataset func N/A 0 N/A N/A Subject 2 resting state dataset at: %s N/A N/A dataset func N/A 1 nilearn plotting image N/A result_img N/A N/A image math_img np.mean(img1, axis=-1) - np.mean(img2, axis=-1) img1 N/A N/A dataset func N/A 0 img2 N/A N/A dataset func N/A 1 N/A N/A N/A plotting plot_stat_map result_img title Comparing means of 2 resting state 4D images. N/A N/A N/A plotting show