Skip to content

Commit 67d13de

Browse files
committed
Fix support for vmin/vmax when plotting
1 parent 8065c45 commit 67d13de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/torchio/visualization.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ def plot_volume(
146146
]
147147
)
148148
p1, p2 = np.percentile(displayed_data, percentiles)
149-
imshow_kwargs['vmin'] = p1
150-
imshow_kwargs['vmax'] = p2
149+
if 'vmin' not in imshow_kwargs:
150+
imshow_kwargs['vmin'] = p1
151+
if 'vmax' not in imshow_kwargs:
152+
imshow_kwargs['vmax'] = p2
151153

152154
spacing_r, spacing_a, spacing_s = image.spacing
153155
sag_axis, cor_axis, axi_axis = axes

0 commit comments

Comments
 (0)