要读取.hnd格式图像的包
read-hnd的Python项目详细描述
#模块读取
用于与hnd文件类型进行交互
要设置它,只需将其安装为任何其他模块:
PIP安装–用户阅读
这应该可以解决任何依赖性问题,并且有望在没有太多问题的情况下工作。
###模块使用: 要运行代码,有几个选项:
转换该文件夹中的所有HND图像,然后保存到已处理的子文件夹中
python-m read\u hnd-f c:pathtooder
读取并显示图像
python-m read\u hnd-i c:pathtoimage.hnd-p=1
保存图像
python-m read\u hnd-i c:pathtoimage.hnd-o c:pathtosave.tiff
同时保存元数据
python-m read\u hnd-i c:pathtoimage.hnd-o c:pathtosave.tiff-m c:pathtomeatadata.txt
###在python代码中使用: `python from read_hnd import read_hnd # Load module fp = read_hnd.HndReader(inputfile) # Create object to interact with file fp.headerData() # Read the header fp.pixelData() # Read pixel data (must read header first) matplotlib.plot.imshow(fp.uncompressedImage) # Show the image using matplotlib plt.show() `
这仍然是一个正在进行的工作,所以可能有错误。例如,元数据似乎没有正确读取(即,您得到一些非感官值)