使用BioFormat读/写重组

发布于 2025-01-25 07:39:05 字数 611 浏览 0 评论 0原文

我需要使用tiff格式的大型图像,因此我需要使用bigtiff格式。我尝试使用BioFormatsBioFormats_package.jar)最后一个版本读取图像,

ImagePlus[] images = images = BF.openImagePlus(io) ;

然后使用:我想访问处理器images [0] .getProcessor ()要修改/访问像素值,但是结果似乎不是经典的ImageJ处理器:byteprocessorcolorprocessorshortprocessor。我使用实例测试了所有这些。

知道哪种类型的处理器可能是什么?

还是如何访问像素值?

[编辑]我仍然不知道结果是哪种类型的ImageProcessor,但是我发现保存的像素是使用浮子编码的,因此32位。

这不是理想的选择,因为我使用整数编码保存了图像,因此当值大于2000万时,精确度会损失。

I need to I/O large images in TIFF format, so I need to use the BigTIFF format. I tried to use BioFormats (bioformats_package.jar) last version to read an image, using:

ImagePlus[] images = images = BF.openImagePlus(io) ;

Then, I wanted to access the Processor images[0].getProcessor() to modify/access the pixel values, but the result appears to not be any of the classical ImageJ processor: ByteProcessor, ColorProcessor, FloatProcessor, and ShortProcessor. I tested ALL of them using instanceof.

Any idea what type of Processor it could be?

Or how I would access the pixel values?

[EDIT] I still don't know what type of ImageProcessor the result is, but I found out that the saved pixels are encoded using Float, so 32 bits.

This is not ideal as I saved an image using Integer encoding, so there is a loss of precision when values are bigger than 20 millions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪眸﹌ 2025-02-01 07:39:05

According to the JavaDocs on ImagePlus, getProcessor() returns an ImageProcessor on which you can perform a convertToByteProcessor() to get a ByteProcessor, you have other converters on ImageProcessor for other subclasses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文