Skip to content

Commit 8c2b2e0

Browse files
committed
Expose imshow kwargs
1 parent ed8d97c commit 8c2b2e0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

diffdrr/visualization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def plot_drr(
2424
ticks: bool | None = True,
2525
axs: matplotlib.axes._axes.Axes | None = None,
2626
cmap: str = "gray",
27+
**imshow_kwargs,
2728
):
2829
"""Plot an image generated by a DRR module."""
2930

@@ -32,7 +33,7 @@ def plot_drr(
3233
if len(img) == 1:
3334
axs = [axs]
3435
for img, ax in zip(img, axs):
35-
ax.imshow(img.squeeze().cpu().detach(), cmap=cmap)
36+
ax.imshow(img.squeeze().cpu().detach(), cmap=cmap, **imshow_kwargs)
3637
_, height, width = img.shape
3738
ax.xaxis.tick_top()
3839
ax.set(

notebooks/api/04_visualization.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
" ticks: bool | None = True,\n",
8080
" axs: matplotlib.axes._axes.Axes | None = None,\n",
8181
" cmap: str = \"gray\",\n",
82+
" **imshow_kwargs,\n",
8283
"):\n",
8384
" \"\"\"Plot an image generated by a DRR module.\"\"\"\n",
8485
"\n",
@@ -87,7 +88,7 @@
8788
" if len(img) == 1:\n",
8889
" axs = [axs]\n",
8990
" for img, ax in zip(img, axs):\n",
90-
" ax.imshow(img.squeeze().cpu().detach(), cmap=cmap)\n",
91+
" ax.imshow(img.squeeze().cpu().detach(), cmap=cmap, **imshow_kwargs)\n",
9192
" _, height, width = img.shape\n",
9293
" ax.xaxis.tick_top()\n",
9394
" ax.set(\n",

0 commit comments

Comments
 (0)