gpt4 book ai didi

Python 通过使用 tifffile append 到多页 TIFF 文件来写入/添加图像数据

转载 作者:行者123 更新时间:2023-11-28 19:10:26 24 4
gpt4 key购买 nike

我想使用来自 Christoph Gohlke 的 tifffile 模块将图像数据(一个 numpy 矩阵)添加到一个已经存在的多页 TIFF 文件:http://www.lfd.uci.edu/~gohlke/code/tifffile.py.html

而且我想这样做而不必加载整个文件,因为它可能很重(长时间的荧光显微镜实验......)。在这个页面上:https://github.com/scienceopen/pyimagevideo/blob/master/Demo_image_write_multipage.py第 68 行他们说这是可能的,但他们只是说“阅读代码”,我不知道如何 append 图像。我试过了

tifffile.save(ImagePath, ImageData)

with tifffile.TiffWriter(ImagePath) as tif2write:
tif2write.save(ImageData)

但我没有 append 数据,它会覆盖文件。

最佳答案

我终于写信给 Christoph Gohlke,他确实说他的模块无法将新图像 append 到 TIFF 文件。所以他修改了他的模块,现在我们可以将任意数量的图像 append 到一个已经存在的文件中!查看他的网站 http://www.lfd.uci.edu/~gohlke/code/tifffile.py.html ,无法做到这一点的版本是修订版 2016.10.28,所以如果您在他的网站上找到更新的“修订版”,它应该可以工作,同时.​​.....请耐心等待 ;)

关于Python 通过使用 tifffile append 到多页 TIFF 文件来写入/添加图像数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41159913/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com