How to use the nimare.meta.cbma.base.CBMAEstimator function in NiMARE

To help you get started, we’ve selected a few NiMARE examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neurostuff / NiMARE / nimare / meta / cbma / model.py View on Github external
References
    ----------
    .. [1] Kang, Jian, et al. "Meta analysis of functional neuroimaging data
        via Bayesian spatial point processes." Journal of the American
        Statistical Association 106.493 (2011): 124-134.
        https://doi.org/10.1198/jasa.2011.ap09735
    """
    def __init__(self):
        pass

    def _fit(self, dataset):
        pass


@due.dcite(references.HPGRF, description='Introduces the HPGRF model.')
class HPGRF(CBMAEstimator):
    """
    Hierarchical Poisson/Gamma random field model [1]_.

    Warnings
    --------
    This method is not yet implemented.

    References
    ----------
    .. [1] Kang, Jian, et al. "A Bayesian hierarchical spatial point process
        model for multi-type neuroimaging meta-analysis." The annals of applied
        statistics 8.3 (2014): 1800.
    """
    def __init__(self):
        pass
github neurostuff / NiMARE / nimare / meta / cbma / model.py View on Github external
References
    ----------
    .. [1] Kang, Jian, et al. "A Bayesian hierarchical spatial point process
        model for multi-type neuroimaging meta-analysis." The annals of applied
        statistics 8.3 (2014): 1800.
    """
    def __init__(self):
        pass

    def _fit(self, dataset):
        pass


@due.dcite(references.SBLFR, description='Introduces the SBLFR model.')
class SBLFR(CBMAEstimator):
    """
    Spatial Bayesian latent factor regression model [1]_.

    Warnings
    --------
    This method is not yet implemented.

    References
    ----------
    .. [1] Montagna, Silvia, et al. "Spatial Bayesian latent factor regression
        modeling of coordinate‐based meta‐analysis data." Biometrics 74.1
        (2018): 342-353. https://doi.org/10.1111/biom.12713
    """
    def __init__(self):
        pass
github neurostuff / NiMARE / nimare / meta / cbma / model.py View on Github external
References
    ----------
    .. [1] Montagna, Silvia, et al. "Spatial Bayesian latent factor regression
        modeling of coordinate‐based meta‐analysis data." Biometrics 74.1
        (2018): 342-353. https://doi.org/10.1111/biom.12713
    """
    def __init__(self):
        pass

    def _fit(self, dataset):
        pass


@due.dcite(references.SBR, description='Introduces the SBR model.')
class SBR(CBMAEstimator):
    """
    Spatial binary regression model [1]_.

    Warnings
    --------
    This method is not yet implemented.

    References
    ----------
    .. [1] Yue, Yu Ryan, Martin A. Lindquist, and Ji Meng Loh. "Meta-analysis
        of functional neuroimaging data using Bayesian nonparametric binary
        regression." The Annals of Applied Statistics 6.2 (2012): 697-718.
        https://doi.org/10.1214/11-AOAS523
    """
    def __init__(self):
        pass
github neurostuff / NiMARE / nimare / meta / cbma / mkda.py View on Github external
from nilearn.masking import apply_mask, unmask
from statsmodels.sandbox.stats.multicomp import multipletests

from .kernel import MKDAKernel, KDAKernel
from ...results import MetaResult
from .base import CBMAEstimator
from .kernel import KernelTransformer
from ...stats import null_to_p, p_to_z, one_way, two_way
from ...due import due
from ... import references

LGR = logging.getLogger(__name__)


@due.dcite(references.MKDA, description='Introduces MKDA.')
class MKDADensity(CBMAEstimator):
    r"""
    Multilevel kernel density analysis- Density analysis [1]_.

    Parameters
    ----------
    kernel_estimator : :obj:`nimare.meta.cbma.base.KernelTransformer`, optional
        Kernel with which to convolve coordinates from dataset. Default is
        MKDAKernel.
    **kwargs
        Keyword arguments. Arguments for the kernel_estimator can be assigned
        here, with the prefix '\kernel__' in the variable name.

    Notes
    -----
    Available correction methods: :obj:`MKDADensity.correct_fwe_permutation`
github neurostuff / NiMARE / nimare / meta / cbma / ale.py View on Github external
grp2_z_map[grp2_voxel] = grp2_z_arr

        # Fill in output map
        diff_z_map = np.zeros(image1.shape[0])
        diff_z_map[grp2_voxel] = -1 * grp2_z_map[grp2_voxel]
        # could overwrite some values. not a problem.
        diff_z_map[grp1_voxel] = grp1_z_map[grp1_voxel]

        images = {'grp1-grp2_z': diff_z_map}
        self.results = MetaResult(self, self.mask, maps=images)


@due.dcite(references.SCALE,
           description='Introduces the specific co-activation likelihood '
                       'estimation (SCALE) algorithm.')
class SCALE(CBMAEstimator):
    r"""
    Specific coactivation likelihood estimation [1]_.

    Parameters
    ----------
    voxel_thresh : float, optional
        Uncorrected voxel-level threshold. Default: 0.001
    n_iters : int, optional
        Number of iterations for correction. Default: 10000
    n_cores : int, optional
        Number of processes to use for meta-analysis. If -1, use all
        available cores. Default: -1
    ijk : :obj:`str` or (N x 3) array_like
        Tab-delimited file of coordinates from database or numpy array with ijk
        coordinates. Voxels are rows and i, j, k (meaning matrix-space) values
        are the three columnns.
github neurostuff / NiMARE / nimare / meta / cbma / model.py View on Github external
"""
Model-based coordinate-based meta-analysis estimators
"""
from .base import CBMAEstimator
from ...due import due
from ... import references


@due.dcite(references.BHICP, description='Introduces the BHICP model.')
class BHICP(CBMAEstimator):
    """
    Bayesian hierarchical cluster process model [1]_.

    Warnings
    --------
    This method is not yet implemented.

    References
    ----------
    .. [1] Kang, Jian, et al. "Meta analysis of functional neuroimaging data
        via Bayesian spatial point processes." Journal of the American
        Statistical Association 106.493 (2011): 124-134.
        https://doi.org/10.1198/jasa.2011.ap09735
    """
    def __init__(self):
        pass
github neurostuff / NiMARE / nimare / meta / cbma / ale.py View on Github external
z_fwe_values = p_to_z(p_fwe_values, tail='one')

        logp_vfwe_values = -np.log(p_fwe_values)
        logp_vfwe_values[np.isinf(logp_vfwe_values)] = -np.log(np.finfo(float).eps)

        # Write out unthresholded value images
        images = {
            'z_vthresh': vthresh_z_values,
            'logp_level-voxel': logp_vfwe_values,
            'z_level-voxel': z_fwe_values,
            'logp_level-cluster': logp_cfwe_map,
        }
        return images


class ALESubtraction(CBMAEstimator):
    """
    ALE subtraction analysis.

    Parameters
    ----------
    n_iters : :obj:`int`, optional
        Default is 10000.

    Notes
    -----
    This method was originally developed in [1]_ and refined in [2]_.

    References
    ----------
    .. [1] Laird, Angela R., et al. "ALE meta‐analysis: Controlling the
        false discovery rate and performing statistical contrasts." Human
github neurostuff / NiMARE / nimare / meta / cbma / ale.py View on Github external
from ...stats import null_to_p, p_to_z
from ...utils import round2

LGR = logging.getLogger(__name__)


@due.dcite(references.ALE1, description='Introduces ALE.')
@due.dcite(references.ALE2,
           description='Modifies ALE algorithm to eliminate within-experiment '
                       'effects and generate MA maps based on subject group '
                       'instead of experiment.')
@due.dcite(references.ALE3,
           description='Modifies ALE algorithm to allow FWE correction and to '
                       'more quickly and accurately generate the null '
                       'distribution for significance testing.')
class ALE(CBMAEstimator):
    r"""
    Activation likelihood estimation

    Parameters
    ----------
    kernel_estimator : :obj:`nimare.meta.cbma.base.KernelTransformer`, optional
        Kernel with which to convolve coordinates from dataset. Default is
        ALEKernel.
    **kwargs
        Keyword arguments. Arguments for the kernel_estimator can be assigned
        here, with the prefix '\kernel__' in the variable name.

    Notes
    -----
    The ALE algorithm was originally developed in [1]_, then updated in [2]_
    and [3]_.
github neurostuff / NiMARE / nimare / meta / cbma / mkda.py View on Github external
# Voxel-level FWE
        vfwe_map = apply_mask(of_map, self.mask)
        for i_vox, val in enumerate(vfwe_map):
            vfwe_map[i_vox] = -np.log(null_to_p(val, perm_max_values, 'upper'))
        vfwe_map[np.isinf(vfwe_map)] = -np.log(np.finfo(float).eps)
        vthresh_of_map = apply_mask(nib.Nifti1Image(vthresh_of_map,
                                                    of_map.affine),
                                    self.mask)
        images = {'vthresh': vthresh_of_map,
                  'logp_level-cluster': cfwe_map,
                  'logp_level-voxel': vfwe_map}
        return images


@due.dcite(references.MKDA, description='Introduces MKDA.')
class MKDAChi2(CBMAEstimator):
    r"""
    Multilevel kernel density analysis- Chi-square analysis [1]_.

    Parameters
    ----------
    prior : float, optional
        Uniform prior probability of each feature being active in a map in
        the absence of evidence from the map. Default: 0.5
    kernel_estimator : :obj:`nimare.meta.cbma.base.KernelTransformer`, optional
        Kernel with which to convolve coordinates from dataset. Default is
        MKDAKernel.
    **kwargs
        Keyword arguments. Arguments for the kernel_estimator can be assigned
        here, with the prefix '\kernel__' in the variable name.

    Notes
github neurostuff / NiMARE / nimare / meta / cbma / mkda.py View on Github external
_, pFgA_p_FDR, _, _ = multipletests(pFgA_p_vals, alpha=alpha,
                                            method='fdr_bh',
                                            is_sorted=False,
                                            returnsorted=False)
        pFgA_z_FDR = p_to_z(pFgA_p_FDR, tail='two') * pFgA_sign

        images = {
            'consistency_z_FDR': pAgF_z_FDR,
            'specificity_z_FDR': pFgA_z_FDR,
        }
        return images


@due.dcite(references.KDA1, description='Introduces the KDA algorithm.')
@due.dcite(references.KDA2, description='Also introduces the KDA algorithm.')
class KDA(CBMAEstimator):
    r"""
    Kernel density analysis.

    Parameters
    ----------
    kernel_estimator : :obj:`nimare.meta.cbma.base.KernelTransformer`, optional
        Kernel with which to convolve coordinates from dataset. Default is
        KDAKernel.
    **kwargs
        Keyword arguments. Arguments for the kernel_estimator can be assigned
        here, with the prefix '\kernel__' in the variable name.

    Notes
    -----
    Kernel density analysis was first introduced in [1]_ and [2]_.