Module Expr Str Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num Num NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad If CompareIs NameLoad NameLoad body Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Assign NameStore IfExp CompareIs NameLoad NameLoad NameLoad BinOpAdd BinOpAdd NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad If CompareIs NameLoad NameLoad body Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num Num Num body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad BinOpBitAnd Call NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore IfExp CompareEq NameLoad NameLoad UnaryOpInvert AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpDiv BinOpMult NameLoad Num NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpDiv BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num Num NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore BinOpDiv BinOpMult NameLoad Num NameLoad Assign NameStore BinOpDiv BinOpMult NameLoad Num NameLoad Assign NameStore BinOpDiv BinOpMult NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore BinOpAdd BinOpMult NameLoad NameLoad BinOpMult BinOpSub Num NameLoad NameLoad Assign NameStore BinOpDiv BinOpMult NameLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore BinOpDiv NameLoad Num Assign SubscriptStore NameLoad Index CompareLt NameLoad Num Num Assign NameStore BinOpMult Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index Call AttributeLoad NameLoad attr NameLoad BinOpMult Call AttributeLoad NameLoad attr Num Num Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index CompareLt NameLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpSub NameLoad Call AttributeLoad NameLoad attr NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad Call AttributeLoad NameLoad attr ListLoad ListLoad NameLoad NameLoad ListLoad BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index CompareLt NameLoad Num Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad keyword Str Assign AttributeStore NameLoad attr Dict Str Str Str BinOpMod Str NameLoad BinOpMod Str NameLoad Str Str BinOpMod Str NameLoad BinOpMod Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If CompareGt NameLoad Num body If Call NameLoad NameLoad NameLoad body Assign NameStore BinOpDiv Call NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt NameLoad NameLoad Index Num For NameStore AttributeLoad NameLoad attr body Assign SubscriptStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str Str Str NameLoad body Expr Str If CompareEq NameLoad Str body Assign NameStore Str If UnaryOpNot Call NameLoad NameLoad body Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareIn NameLoad NameLoad body Assign NameStore BinOpAdd BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list
N/A N/A  Meta-analysis tools  N/A logging N/A numpy np scipy.stats norm neurosynth.base imageutils neurosynth.analysis stats os.path join exists os makedirs N/A logger N/A N/A logging getLogger neurosynth.meta analyze_features N/A N/A dataset features image_type threshold q output_dir prefix N/A None pFgA_z 0.001 0.01 None None N/A N/A  Generate meta-analysis images for a set of features.
    Args:
        dataset: A Dataset instance containing feature and activation data.
        features: A list of named features to generate meta-analysis maps for.
            If None, analyzes all features in the current dataset.
        image_type: The type of image to return. Specify one of the extensions
            generated by the MetaAnalysis procedure--e.g., pFgA_z, pAgF, etc.
            By default, will use pFgA_z (i.e., z-scores reflecting the
            probability that a Mappable has a feature given that activation is
            present).
        threshold: The threshold for determining whether or not a Mappable has
            a feature. By default, this is 0.001, which is only sensible in the
            case of term-based features (so be sure to specify it for other
            kinds).
        q: The FDR rate to use for multiple comparisons correction (default =
            0.05).
        output_dir: Directory to save all meta-analysis images to. If none,
            returns all the data as a matrix.
        prefix: All output images will be prepended with this string (if None,
            defaults to the name of the feature).
    Returns:
        If output_dir is None, an n_voxels x n_features 2D numpy array.
     N/A N/A features None N/A N/A features N/A N/A dataset get_feature_names N/A N/A output_dir None N/A N/A result N/A N/A np zeros N/A N/A N/A dataset masker n_vox_in_mask N/A len features N/A N/A i f N/A enumerate features N/A N/A ids N/A N/A dataset get_studies features f frequency_threshold threshold N/A ma N/A MetaAnalysis dataset ids q q N/A N/A output_dir None N/A N/A N/A result N/A N/A N/A i N/A N/A ma images N/A image_type N/A N/A pfx N/A N/A prefix None f N/A N/A prefix _ f N/A N/A N/A ma save_results output_dir output_dir prefix pfx N/A N/A output_dir None N/A N/A result N/A MetaAnalysis N/A object N/A N/A  Meta-analysis of a Dataset. Currently contrasts two subsets of
    studies within a Dataset and saves a bunch of statistical images.
    Only one list of study IDs (ids) needs to be passed; the Universe will
    be bisected into studies that are and are not included in the
    list, and the contrast is then performed across these two groups.
    If a second optional second study list is provided (ids2), the Dataset
    is first constrained to the union of ids1 and ids2, and the standard
    contrast is then performed. __init__ N/A N/A self dataset ids ids2 q prior min_studies N/A None 0.01 0.5 1 N/A N/A  Initialize a new MetaAnalysis instance and run an analysis.
        Args:
            dataset: A Dataset instance.
            ids: A list of Mappable IDs to include in the meta-analysis.
            ids2: Optional second list of Mappable IDs. If passed, the set of
                studies will be restricted to the union of ids and ids2 before
                performing the meta-analysis. This is useful for meta-analytic
                contrasts, as the resulting images will in effect identify
                regions that are reported/activated more frequently in one
                list than in the other.
            q: The FDR threshold to use when correcting for multiple
                comparisons. Set to .01 by default.
            prior: The prior to use when calculating conditional probabilities.
                This is the prior probability of a feature being used in a
                study (i.e., p(F)). For example, if set to 0.25, the analysis
                will assume that 1/4 of studies load on the target feature, as
                opposed to the empirically estimated p(F), which is len(ids) /
                total number of studies in the dataset. If prior is not passed,
                defaults to 0.5, reflecting an effort to put all terms on level
                footing and avoid undue influence of base rates (because some
                terms are much more common than others). Note that modifying
                the prior will only affect the effect size/probability maps,
                and not the statistical inference (z-score) maps.
            min_studies: Integer or float indicating which voxels to mask out
                from results due to lack of stability. If an integer is passed,
                all voxels that activate in fewer than this number of studies
                will be ignored (i.e., a value of 0 will be assigned in all
                output images). If a float in the range of 0 - 1 is passed,
                this will be interpreted as a proportion to use as the cut-off
                (e.g., passing 0.03 will exclude all voxels active in fewer
                than 3% of the entire dataset). Defaults to 1, meaning all
                voxels that activate at least one study will be kept.
         N/A N/A self dataset dataset N/A mt N/A dataset image_table N/A N/A self selected_ids N/A list N/A N/A set N/A mt ids N/A set ids N/A N/A self selected_id_indices N/A N/A np in1d N/A mt ids ids N/A unselected_id_indices N/A N/A ids2 None N/A N/A self selected_id_indices N/A N/A np in1d N/A mt ids ids2 N/A N/A N/A logger debug Calculating counts... N/A n_selected N/A len N/A self selected_ids N/A n_unselected N/A N/A np sum unselected_id_indices N/A n_mappables N/A n_selected n_unselected N/A n_selected_active_voxels N/A N/A N/A mt data dot N/A self selected_id_indices N/A n_unselected_active_voxels N/A N/A N/A mt data dot unselected_id_indices N/A pF N/A N/A n_selected 1.0 n_mappables N/A pA N/A N/A N/A N/A np array N/A N/A N/A N/A N/A mt data sum axis 1 1.0 n_mappables squeeze N/A N/A N/A logger debug Calculating conditional probabilities... N/A pAgF N/A N/A n_selected_active_voxels 1.0 n_selected N/A pAgU N/A N/A n_unselected_active_voxels 1.0 n_unselected N/A pFgA N/A N/A pAgF pF pA N/A N/A N/A logger debug Recomputing with uniform priors... N/A pAgF_prior N/A N/A prior pAgF N/A N/A 1 prior pAgU N/A pFgA_prior N/A N/A pAgF prior pAgF_prior p_to_z N/A N/A p sign N/A N/A N/A p N/A p 2 N/A N/A p N/A N/A p 1e-240 1e-240 N/A z N/A N/A N/A np abs N/A N/A norm ppf p sign N/A N/A z N/A N/A N/A np isinf z N/A N/A N/A norm ppf 1e-240 -1 N/A z N/A N/A p_vals N/A N/A stats one_way N/A N/A np squeeze n_selected_active_voxels n_selected N/A N/A p_vals N/A N/A p_vals 1e-240 1e-240 N/A z_sign N/A N/A N/A N/A np sign N/A n_selected_active_voxels N/A N/A np mean n_selected_active_voxels ravel N/A pAgF_z N/A p_to_z p_vals z_sign N/A fdr_thresh N/A N/A stats fdr p_vals q N/A pAgF_z_FDR N/A N/A imageutils threshold_img pAgF_z fdr_thresh p_vals mask_out above N/A cells N/A N/A np squeeze N/A N/A N/A np array N/A N/A n_selected_active_voxels n_unselected_active_voxels N/A N/A n_selected n_selected_active_voxels N/A n_unselected n_unselected_active_voxels T N/A p_vals N/A N/A stats two_way cells N/A N/A p_vals N/A N/A p_vals 1e-240 1e-240 N/A z_sign N/A N/A N/A N/A np sign N/A pAgF pAgU ravel N/A pFgA_z N/A p_to_z p_vals z_sign N/A fdr_thresh N/A N/A stats fdr p_vals q N/A pFgA_z_FDR N/A N/A imageutils threshold_img pFgA_z fdr_thresh p_vals mask_out above N/A N/A self images N/A pA pAgF pFgA N/A pAgF_given_pF=%0.2f prior N/A pFgA_given_pF=%0.2f prior pAgF_z pFgA_z N/A pAgF_z_FDR_%s q N/A pFgA_z_FDR_%s q pA pAgF pFgA pAgF_prior pFgA_prior pAgF_z pFgA_z pAgF_z_FDR pFgA_z_FDR N/A N/A min_studies 0 N/A N/A N/A isinstance min_studies int N/A N/A min_studies N/A N/A float min_studies n_mappables N/A vox_to_exclude N/A N/A N/A np where N/A pA min_studies N/A 0 N/A k N/A self images N/A N/A N/A N/A N/A self images N/A k N/A vox_to_exclude 0 N/A save_results N/A N/A self output_dir prefix prefix_sep image_list N/A . _ None N/A N/A  Write out any images generated by the meta-analysis.
        Args:
            output_dir (str): folder to write images to
            prefix (str): all image files will be prepended with this string
            prefix_sep (str): glue between the prefix and rest of filename
            image_list (list): optional list of images to save--e.g.,
                ['pFgA_z', 'pAgF']. If image_list is None (default), will save
                all images.
         N/A N/A prefix N/A N/A prefix_sep N/A N/A N/A exists output_dir N/A N/A N/A makedirs output_dir N/A N/A N/A logger debug Saving results... N/A N/A image_list None N/A N/A image_list N/A N/A N/A self images keys N/A N/A suffix img N/A N/A N/A self images items N/A N/A N/A suffix image_list N/A N/A filename N/A N/A N/A prefix prefix_sep suffix .nii.gz N/A outpath N/A join output_dir filename N/A N/A N/A imageutils save_img img outpath N/A N/A self dataset masker N/A N/A