Skip to content

Commit

Permalink
Update ibma.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioAPeraza committed Apr 30, 2024
1 parent 0aa6dd4 commit 6939aca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nimare/meta/ibma.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,8 @@ def _fit(self, dataset):

groups = self._group_encoder(self.dataset.images["study_id"].to_list())

corr = None
group_maps = None
_get_group_maps = False
corr, sub_corr, group_maps = None, None, None
if groups.size != np.unique(groups).size:
# If all studies are not unique, we will need to correct for multiple contrasts
_get_group_maps = True
Expand Down Expand Up @@ -425,6 +424,7 @@ def _fit(self, dataset):
if _get_group_maps:
# Normally, we expect studies from the same group to be in the same bag.
group_maps = np.tile(groups[study_mask], (bag["values"].shape[1], 1)).T
sub_corr = corr[np.ix_(study_mask, study_mask)]

if self.use_sample_size:
sample_sizes_ex = [self.inputs_["sample_sizes"][study] for study in study_mask]
Expand All @@ -435,7 +435,7 @@ def _fit(self, dataset):
else:
pymare_dset = pymare.Dataset(y=bag["values"], v=group_maps)

est.fit_dataset(pymare_dset, corr=corr)
est.fit_dataset(pymare_dset, corr=sub_corr)
est_summary = est.summary()
z_map[bag["voxel_mask"]] = est_summary.z.squeeze()
p_map[bag["voxel_mask"]] = est_summary.p.squeeze()
Expand Down

0 comments on commit 6939aca

Please sign in to comment.