Skip to content

Commit

Permalink
Overwrite data variable when scaling data
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiebke committed Mar 13, 2024
1 parent 7ab859c commit cfb5e8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions callbacks/image_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def render_image(
# Auto-scale data
low = np.percentile(tf.ravel(), 1)
high = np.percentile(tf.ravel(), 99)
tf_scaled = np.clip((tf - low) / (high - low), 0, 1)
tf = np.clip((tf - low) / (high - low), 0, 1)
if toggle_seg_result:
# if toggle is true and overlay exists already (2 images in data) this will
# be handled in hide_show_segmentation_overlay callback
Expand Down Expand Up @@ -146,9 +146,9 @@ def render_image(
else:
result = None
else:
tf_scaled = np.zeros((500, 500))
tf = np.zeros((500, 500))

fig = px.imshow(tf_scaled, binary_string=True)
fig = px.imshow(tf, binary_string=True)
if toggle_seg_result and result is not None:
colorscale, max_class_id = generate_segmentation_colormap(
all_annotation_class_store
Expand Down

0 comments on commit cfb5e8e

Please sign in to comment.