医学图像的零数组大小

时间:2020-05-12 18:43:26

标签: python tensorflow medical

我正在检查医学图像的不确定性图(.tif格式的脑MRI),并且在代码中收到以下错误。 ValueError:零大小的数组到没有标识的最大缩减操作

这是我的代码:

def preprocess(ims):
    # convert to float32
    ims = ims.astype(np.float32)

    # scale to 0-1 interval
    if ims.max() > 1.0:
        ims /= 255.

    print('min: {}, max: {}, shape: {}, type: {}'.format(ims.min(), ims.max(), ims.shape, ims.dtype))
    return ims

x_train = preprocess(x_train)
x_test = preprocess(x_test)

y_train = preprocess(y_train)
y_test = preprocess(y_test)

我收到以下错误:

x_test =预处理(x_test)

当我打印(x_test.shape)时,我得到(0)-与我的训练图像有很大不同 print(x_train.shape)给我(23,256,256,3)。

I have attached the test image that gives me (0) for x_test.shape

对于此方面的任何帮助和指导,我将深表感谢。谢谢!!

0 个答案:

没有答案
相关问题