Skip to content

Commit

Permalink
Merge pull request #116 from JuanCab/master
Browse files Browse the repository at this point in the history
Fixed Image Browser to handle non-float images
  • Loading branch information
mwcraig committed May 20, 2016
2 parents 29c7ff2 + c05580f commit c7c84b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reducer/image_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def ndarray_to_png(x):
aspect = shape[1]/shape[0]
width = 600 # pixels
new_shape = np.asarray(width/shape[0]*aspect*shape, dtype='int')
x = np.asarray(Image.fromarray(x).resize(new_shape))
x = np.asarray(Image.fromarray(x.astype('float32')).resize(new_shape))
x = (x - x.mean()) / x.std()
x[x >= 3] = 2.99
x[x < -3] = -3.0
Expand Down

0 comments on commit c7c84b7

Please sign in to comment.