How to use the nimare.results.MetaResult 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 / base.py View on Github external
Returns
        -------
        :obj:`nimare.results.MetaResult`
            Results of Estimator fitting.
        """
        self._validate_input(dataset)
        self._preprocess_input(dataset)
        maps = self._fit(dataset)

        if hasattr(self, 'masker') and self.masker is not None:
            masker = self.masker
        else:
            masker = dataset.masker

        self.results = MetaResult(self, masker, maps)
        return self.results
github neurostuff / NiMARE / nimare / meta / cbma / ale.py View on Github external
Cluster-level FWE-corrected z-statistic maps associated with the
            respective models.
        ma_maps1 : (E x V) array_like or None, optional
            Experiments by voxels array of modeled activation
            values. If not provided, MA maps will be generated from dataset1.
        ma_maps2 : (E x V) array_like or None, optional
            Experiments by voxels array of modeled activation
            values. If not provided, MA maps will be generated from dataset2.

        Returns
        -------
        :obj:`nimare.results.MetaResult`
            Results of ALE subtraction analysis.
        """
        maps = self._fit(ale1, ale2, image1, image2, ma_maps1, ma_maps2)
        self.results = MetaResult(self, ale1.mask, maps)
        return self.results
github neurostuff / NiMARE / nimare / meta / cbma / mkda.py View on Github external
Fit Estimator to datasets.

        Parameters
        ----------
        dataset/dataset2 : :obj:`nimare.dataset.Dataset`
            Dataset objects to analyze.

        Returns
        -------
        :obj:`nimare.results.MetaResult`
            Results of Estimator fitting.
        """
        self._validate_input(dataset)
        self._validate_input(dataset2)
        maps = self._fit(dataset, dataset2)
        self.results = MetaResult(self, dataset.masker.mask_img, maps)
        return self.results
github neurostuff / NiMARE / nimare / meta / cbma / ale.py View on Github external
iter_diff_values[:, voxel],
                                              tail='upper')
            grp2_z_arr = p_to_z(grp2_p_arr, tail='one')
            # Unmask
            grp2_z_map = np.zeros(grp2_voxel.shape[0])
            grp2_z_map[:] = np.nan
            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)
github neurostuff / NiMARE / nimare / correct / base.py View on Github external
def _validate_input(self, result):
        if not isinstance(result, MetaResult):
            raise ValueError("First argument to transform() must be an "
                             "instance of class MetaResult, not {}."
                             .format(type(result)))

        if self.method not in self._native_methods:
            raise ValueError("Unsupported {} correction method: {}".format(
                self._correction_method, self.method))

        for rm in self._required_maps:
            if result.maps.get(rm) is None:
                raise ValueError("{0} requires {1} maps to be present in the "
                                 "MetaResult, but none were found."
                                 .format(type(self), rm))