Meta-analysis: Single predictor models

Meta-analyses of 8 different features: 4 visual categories, 2 low level visual features and 2 auditory features

Each model contains only the target feature plus standard nuisance covariates.

Meta-analyses are run using analyze_collection, a helper function which pulls Neuroscout result maps from NeuroVault using analysis ids, creates a NiMare Dataset, and estimates meta-analytic maps.

from meta import analyze_collection
from pyns import Neuroscout
import json
from viz import plot_surfaces
from IPython.display import Image
%matplotlib inline
single_predictors = json.load(open('../analyses/models/single_predictor.json'))
ns = Neuroscout()

Meta-Analysis

low_visual = []
for label in ['brightness', 'shot_change']:
    eff = analyze_collection(
        single_predictors[label], 
        collection_kwargs={'estimator': 'afni'},
        plot_kwargs=dict(vmax=18, cut_coords=range(-25, 55, 16), threshold=3.29)
        )
    low_visual.append(eff)
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/brightness/'
WARNING:nimare.base:Masking out 9198 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 19 for brightness
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/shotChange/'
WARNING:nimare.base:Masking out 8768 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 9 for shotChange
../_images/1-single_predictor_models_meta_4_4.svg../_images/1-single_predictor_models_meta_4_5.svg

We now generate surface plots for the same images (displayed in Figure 3) and save them in a png file in figures. We suppress the cell output and not display the plots to keep this notebook lightweight. Note that it can take a few seconds to generate these plots.

%%capture
plot_surfaces(low_visual, 
              img_names=['brightness', 'shot_change'], 
              figname='low_level_visual')
Image(filename='figures/low_level_visual.png') 
../_images/1-single_predictor_models_meta_7_0.png
audio_outs = []
auditory = ['speech', 'rms']
for label in auditory:
    eff = analyze_collection(
        single_predictors[label], 
        collection_kwargs={'estimator': 'afni'},
        plot_kwargs=dict(vmax=18, cut_coords=range(-25, 55, 16), threshold=3.29)
        )
    audio_outs.append(eff)
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/speech/'
WARNING:nimare.base:Masking out 9202 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 19 for speech
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/rms/'
WARNING:nimare.base:Masking out 9202 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 20 for rms
../_images/1-single_predictor_models_meta_8_4.svg../_images/1-single_predictor_models_meta_8_5.svg
%%capture
plot_surfaces(audio_outs, img_names=auditory, figname='auditory')
Image(filename='figures/auditory.png') 
../_images/1-single_predictor_models_meta_10_0.png
high_visual = []
clarifai = ['text',  'landscape', 'building', 'tool']
for label in clarifai:
    eff = analyze_collection(
        single_predictors[label], 
        collection_kwargs={'estimator': 'afni'},
        plot_kwargs=dict(vmax=18, cut_coords=range(-25, 55, 16), threshold=3.29)
        )
    high_visual.append(eff)
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/text/'
WARNING:nimare.base:Masking out 9198 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 19 for text
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/landscape/'
WARNING:nimare.base:Masking out 9198 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 19 for landscape
INFO:nimare.extract.utils:Dataset created in /Users/rr48396/repos/neuroscout-paper/meta/images/building
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/building/'
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/building/'
WARNING:nimare.base:Masking out 9198 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 19 for building
INFO:nimare.utils:Shared path detected: '/Users/rr48396/repos/neuroscout-paper/meta/images/tool/'
WARNING:nimare.base:Masking out 9198 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 19 for tool
../_images/1-single_predictor_models_meta_11_8.svg../_images/1-single_predictor_models_meta_11_9.svg../_images/1-single_predictor_models_meta_11_10.svg../_images/1-single_predictor_models_meta_11_11.svg
%%capture
plot_surfaces(high_visual, img_names=clarifai, figname='high_level_visual')
Image(filename='figures/high_level_visual.png') 
../_images/1-single_predictor_models_meta_13_0.png

Figure 4 meta-analytic maps

text_img = analyze_collection(
    single_predictors['text'], 
    collection_kwargs={'estimator': 'afni'},
    plot_kwargs=dict(vmax=18, cut_coords=[-10], threshold=3.29)
)[0]
INFO:nimare.utils:Shared path detected: '/home/alejandro/repos/neuroscout-paper/meta/images/text/'
WARNING:nimare.base:Masking out 7754 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 20 for text
../_images/1-single_predictor_models_meta_15_2.png
building_img = analyze_collection(
    single_predictors['building'], 
    collection_kwargs={'estimator': 'afni'},
    plot_kwargs=dict(vmax=18, threshold=3.29, cut_coords=[-12])
)[0]
INFO:nimare.extract.utils:Dataset created in /home/alejandro/repos/neuroscout-paper/meta/images/building
INFO:nimare.utils:Shared path detected: '/home/alejandro/repos/neuroscout-paper/meta/images/building/'
INFO:nimare.utils:Shared path detected: '/home/alejandro/repos/neuroscout-paper/meta/images/building/'
WARNING:nimare.base:Masking out 7754 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 20 for building
../_images/1-single_predictor_models_meta_16_2.png
rms_img = analyze_collection(
    single_predictors['rms'], 
    collection_kwargs={'estimator': 'afni'},
    plot_kwargs=dict(vmax=18, cut_coords=[6], threshold=3.29)
)[0]
INFO:nimare.utils:Shared path detected: '/home/alejandro/repos/neuroscout-paper/meta/images/rms/'
WARNING:nimare.base:Masking out 7754 additional voxels. The updated masker is available in the Estimator.masker attribute.
meta-analyzing 21 for rms
../_images/1-single_predictor_models_meta_17_2.png