关于 ValueError: (‘Label (…) not present in mask. Choose from […]’

 原因:image和label在重采样的时候用了不同的插值方法,重新用相同的插值方法重采样之后,使用pyradiomic提取特征时就不会出现该问题。

 解决办法:

使用图像处理库(如:opencv),读取image和label然后保存(不用设置插值方法,默认的就行),这时图像就有了相同的插值方法。

import cv2

img_path = r"路径"

img = cv2.imread(img_path)

cv2.imwrite("保存路径", img)

猜你喜欢

转载自blog.csdn.net/qq_40108803/article/details/126404387