Skip to content

Commit

Permalink
np.array fix
Browse files Browse the repository at this point in the history
  • Loading branch information
camisowers committed Aug 15, 2023
1 parent 8c34b21 commit d32834d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/toffy/image_stitching.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ def rescale_image(img_data, scale, save_path=None):
# rescale data while preserving values
data_type = img_data.dtype
rescaled_data = transform.rescale(
img_data, scale, mode="constant", preserve_range=True, order=0, anti_aliasing=False
np.array(img_data),
scale,
mode="constant",
preserve_range=True,
order=0,
anti_aliasing=False,
)
rescaled_data = rescaled_data.astype(data_type)

Expand Down
2 changes: 1 addition & 1 deletion tests/image_stitching_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def test_fix_image_resolutions(mocked_print):
with tempfile.TemporaryDirectory() as tmpdir:
channel_list = ["Au", "CD3", "CD4", "CD8", "CD11c"]
fov_list = ["fov-1-scan-1", "fov-2-scan-1", "fov-3-scan-1", "fov-4-scan-1"]
test_utils._write_tifs(tmpdir, fov_list, channel_list, (10, 10), "", False, int)
test_utils._write_tifs(tmpdir, fov_list, channel_list, (10, 10), "", False, "uint32")

# test no fovs changes
resolution_data = pd.DataFrame(
Expand Down

0 comments on commit d32834d

Please sign in to comment.