通过下载JSRT
数据库,我找到了一些像您一样的射线照相图像。我已经
在此数据库的第一个映像上测试了以下代码:JPCLN001.IMG。
import matplotlib.pyplot as pltimport numpy as np# Parameters.input_filename = "JPCLN001.IMG"shape = (2048, 2048) # matrix sizedtype = np.dtype('>u2') # big-endian unsigned integer (16bit)output_filename = "JPCLN001.PNG"# Reading.fid = open(input_filename, 'rb')data = np.fromfile(fid, dtype)image = data.reshape(shape)# Display.plt.imshow(image, cmap = "gray")plt.savefig(output_filename)plt.show()


