Skip to content

Commit

Permalink
Use max/min instead of median for windowing in mrd2gif if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kspaceKelvin committed Oct 30, 2024
1 parent 8882258 commit 8b3106b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mrd2gif.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def main(args):
maxVal = np.median([np.percentile(np.array(img), 95) for img in images])
minVal = np.median([np.percentile(np.array(img), 5) for img in images])

# Special case for "sparse" images, usually just text
if maxVal == minVal:
maxVal = np.median([np.max(np.array(img)) for img in images])
minVal = np.median([np.min(np.array(img)) for img in images])

imagesWL = []
for img, roi in zip(images, rois):
if img.mode != 'RGB':
Expand Down

0 comments on commit 8b3106b

Please sign in to comment.