Skip to content

Commit

Permalink
fixes bug #1227 (#1231)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-hm-lee authored Dec 26, 2023
1 parent a6e253d commit dfa1f23
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,8 @@ def _rescale_dcm_pixel_array(
image_2d_scaled = image_2d_float
else:
# Rescaling grey scale between 0-255
image_2d_scaled = (
np.maximum(image_2d_float, 0) / image_2d_float.max()
) * 255.0
image_2d_scaled = ((image_2d_float.max() - image_2d_float) / (
image_2d_float.max() - image_2d_float.min())) * 255.0

# Convert to uint
image_2d_scaled = np.uint8(image_2d_scaled)
Expand Down

0 comments on commit dfa1f23

Please sign in to comment.