import numpy as np
test = np.load("I:/软件/mask.npy")
print(test)
import numpy as np
np.set_printoptions(threshold=np.inf)
masks = np.load("I:/数据分析软件/CellVideo_cell_mask.npy")
print(masks)
显示全部,加上
np.set_printoptions(threshold=np.inf)
如下图所示:
循环读取npy的行列
import numpy as np
masks = np.load("I:/软件/mask.npy")
height=masks.shape[0]
width=masks.shape[1]
cellcount = masks.shape[2]
for i in range(cellcount):
mask = masks[:,:,i]
for j in range(height*width):
if mask.flat[j]>0:
print(str(i) + " " + str(int(j/width))+ " " + str(int(j%width)))