File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change 24
24
from monai .utils .type_conversion import convert_data_type , convert_to_dst_type
25
25
26
26
if TYPE_CHECKING :
27
- from matplotlib import cm
28
27
from matplotlib import pyplot as plt
29
28
else :
30
29
plt , _ = optional_import ("matplotlib" , name = "pyplot" )
31
- cm , _ = optional_import ("matplotlib" , name = "cm" )
32
30
33
31
__all__ = ["matshow3d" , "blend_images" ]
34
32
@@ -210,7 +208,7 @@ def blend_images(
210
208
image = repeat (image , 3 , axis = 0 )
211
209
212
210
def get_label_rgb (cmap : str , label : NdarrayOrTensor ) -> NdarrayOrTensor :
213
- _cmap = cm .get_cmap (cmap )
211
+ _cmap = plt . colormaps .get_cmap (cmap )
214
212
label_np , * _ = convert_data_type (label , np .ndarray )
215
213
label_rgb_np = _cmap (label_np [0 ])
216
214
label_rgb_np = np .moveaxis (label_rgb_np , - 1 , 0 )[:3 ]
You can’t perform that action at this time.
0 commit comments