8000 fixing Clip.SCALE_BY_IMAGE by shanaxel42 · Pull Request #1193 · spacetx/starfish · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fixing Clip.SCALE_BY_IMAGE #1193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Split
2 changes: 1 addition & 1 deletion starfish/imagestack/imagestack.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def apply(

# scale based on values of whole image
if clip_method == Clip.SCALE_BY_IMAGE:
self._data = preserve_float_range(self._data, rescale=True)
self._data.data.values = preserve_float_range(self._data.data.values, rescale=True)

return self

Expand Down
2 changes: 2 additions & 0 deletions starfish/imagestack/test/test_apply.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import copy

import numpy as np
import xarray as xr

from starfish.imagestack.imagestack import ImageStack
from starfish.types import Axes, Clip
Expand Down Expand Up @@ -81,6 +82,7 @@ def apply_function(x):
apply_function, clip_method=Clip.SCALE_BY_IMAGE, in_place=False, n_processes=1
)
assert np.allclose(imagestack.xarray, res.xarray)
assert isinstance(imagestack.xarray, xr.DataArray)

# clip_method 2
res = imagestack.apply(
Expand Down
0