Skip to content

Commit

Permalink
Add t-statistic images as valid targets in ImageTransformer (#895)
Browse files Browse the repository at this point in the history
Add t-statistic image as valid target in ImageTransformer
  • Loading branch information
JulioAPeraza authored Aug 7, 2024
1 parent 1dd2a34 commit 5b6e337
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions nimare/tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def test_ImageTransformer(testdata_ibma):
new_p_files = new_dset.images["p"].tolist()
assert all([isinstance(pf, str) for pf in new_p_files])

t_files = dset.images["t"].tolist()
t_transformer = transforms.ImageTransformer(target="t")
new_dset = t_transformer.transform(dset)
new_t_files = new_dset.images["t"].tolist()
assert t_files[:-1] == new_t_files[:-1]


def test_transform_images(testdata_ibma):
"""Smoke test on transforms.transform_images."""
Expand Down
2 changes: 1 addition & 1 deletion nimare/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def transform_images(images_df, target, masker, metadata_df=None, out_dir=None,
"""
new_images_df = images_df.copy() # Work on a copy of the images_df

valid_targets = {"z", "p", "beta", "varcope"}
valid_targets = {"t", "z", "p", "beta", "varcope"}
if target not in valid_targets:
raise ValueError(
f"Target type {target} not supported. Must be one of: {', '.join(valid_targets)}"
Expand Down

0 comments on commit 5b6e337

Please sign in to comment.