Skip to content

Commit

Permalink
Update base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioAPeraza committed Jan 18, 2024
1 parent 26953bd commit 36a58d4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions nimare/reports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,17 @@ def __init__(self, out_dir, config=None):
ext = "".join(src.suffixes)
desc_text = config.get("caption")
iframe = config.get("iframe", False)
dropdown = config.get("dropdown", False)

contents = None
html_anchor = src.relative_to(out_dir)
if ext == ".html":
contents = IFRAME_SNIPPET.format(html_anchor) if iframe else src.read_text()
if dropdown:
contents = (
f"<details><summary>Advanced ({self.title})</summary>{contents}</details>"
)
self.title = ""
elif ext == ".png":
contents = PNG_SNIPPET.format(html_anchor)

Expand Down Expand Up @@ -477,16 +483,19 @@ def __init__(
)
elif meta_type == "IBMA":
# Use "z_maps", for Fishers, and Stouffers; otherwise use "beta_maps".
key_maps = "z_maps" if "z_maps" in self.results.estimator.inputs_ else "beta_maps"
maps_arr = self.results.estimator.inputs_[key_maps]
key_maps = (
"z_maps"
if "z_maps" in self.results.estimator.inputs_["raw_data"]
else "beta_maps"
)
maps_arr = self.results.estimator.inputs_["raw_data"][key_maps]
ids_ = self.results.estimator.inputs_["id"]
x_label = "Z" if key_maps == "z_maps" else "Beta"

if self.results.estimator.aggressive_mask:
_plot_relcov_map(
maps_arr,
self.results.estimator.masker,
self.results.estimator.inputs_["aggressive_mask"],
self.fig_dir / f"preliminary_dset-{dset_i+1}_figure-relcov.png",
)
else:
Expand Down

0 comments on commit 36a58d4

Please sign in to comment.