Skip to content

Commit

Permalink
Update ibma.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioAPeraza committed Sep 10, 2024
1 parent e072d4a commit 23865c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nimare/meta/ibma.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@ def _fit_model(self, stat_maps, study_mask=None, corr=None):
pos_est.fit_dataset(pos_pymare_dset, corr=sub_corr)
pos_est_summary = pos_est.summary()

z_map = pos_est_summary.z.squeeze()
p_map = pos_est_summary.p.squeeze()

if self.two_sided:
# Run Stouffers for left tail
neg_est = pymare.estimators.StoufferCombinationTest(mode="directed")
Expand All @@ -489,17 +492,14 @@ def _fit_model(self, stat_maps, study_mask=None, corr=None):
neg_est_summary = neg_est.summary()

# Find the minimum p-values
p_map = np.minimum(pos_est_summary.p.squeeze(), neg_est_summary.p.squeeze())
p_map = np.minimum(p_map, neg_est_summary.p.squeeze())

# Create z_map based on which p-value is smaller
z_map = np.where(
pos_est_summary.p.squeeze() <= neg_est_summary.p.squeeze(),
pos_est_summary.z.squeeze(),
p_map <= neg_est_summary.p.squeeze(),
z_map,
-neg_est_summary.z.squeeze(),
)
else:
z_map = pos_est_summary.z.squeeze()
p_map = pos_est_summary.p.squeeze()

dof_map = np.tile(n_studies - 1, n_voxels).astype(np.int32)

Expand Down

0 comments on commit 23865c5

Please sign in to comment.