Skip to content

Commit 3bc02b8

Browse files
committed
Signed-off-by: YunLiu <[email protected]>
1 parent 1bcf97f commit 3bc02b8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

monai/visualize/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
from monai.utils.type_conversion import convert_data_type, convert_to_dst_type
2525

2626
if TYPE_CHECKING:
27-
from matplotlib import cm
2827
from matplotlib import pyplot as plt
2928
else:
3029
plt, _ = optional_import("matplotlib", name="pyplot")
31-
cm, _ = optional_import("matplotlib", name="cm")
3230

3331
__all__ = ["matshow3d", "blend_images"]
3432

@@ -210,7 +208,7 @@ def blend_images(
210208
image = repeat(image, 3, axis=0)
211209

212210
def get_label_rgb(cmap: str, label: NdarrayOrTensor) -> NdarrayOrTensor:
213-
_cmap = cm.get_cmap(cmap)
211+
_cmap = plt.colormaps.get_cmap(cmap)
214212
label_np, *_ = convert_data_type(label, np.ndarray)
215213
label_rgb_np = _cmap(label_np[0])
216214
label_rgb_np = np.moveaxis(label_rgb_np, -1, 0)[:3]

0 commit comments

Comments
 (0)