Skip to content

Commit

Permalink
Update montage2d to scikit-image 0.20
Browse files Browse the repository at this point in the history
The `multichannel` field in `skimage.util.montage` has been deprecated in version 0.20.

Update function call to work with the new API.

From the relase notes for 0.20:
Remove deprecated parameter multichannel; use channel_axis instead. [...] In skimage.util, this affects montage and apply_parallel ([#6583](scikit-image/scikit-image#6583)).
  • Loading branch information
orientnab committed Mar 30, 2023
1 parent 16e3ead commit 457c2d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions medmnist/utils.py
Expand Up @@ -20,9 +20,9 @@ def save2d(imgs, labels, img_folder,


def montage2d(imgs, n_channels, sel):

sel_img = imgs[sel]
montage_arr = skimage_montage(sel_img, multichannel=(n_channels == 3))
channel_axis = 3 if n_channels == 3 else None
montage_arr = skimage_montage(sel_img, channel_axis=channel_axis)
montage_img = Image.fromarray(montage_arr)

return montage_img
Expand Down

0 comments on commit 457c2d2

Please sign in to comment.