保存和访问大量 ROI 多边形(IDL、ImageJ、Java?、XML?)

发布于 2024-08-23 14:53:12 字数 562 浏览 7 评论 0原文

我需要在一堆图像上保存并重新加载数千个 ROI 多边形,实际上是一部每秒 30 帧的电影,持续 30 多分钟,因此至少有 54,000 帧。堆栈中的单个图像(帧)上可以有多个 ROI,并且每个 ROI 的大小和顶点数量不同。 ROI 多边形会跟踪形状随时间变化的边缘。

电影堆栈通常太大而无法一次保存在内存中。我对它进行后期处理,逐帧翻阅它以跟踪我的形状。我可以一次一帧将 ROI 对象保存到二进制文件中,但这会生成 54,000 多个要保存在一起的文件。或者,如果我尝试分配一个容器对象来容纳所有 54,000 多个 ROI 帧,然后将其保存到一个文件中,我很快就会耗尽资源。

我想将所有 ROI 保存到一个我可以随机访问和修改的文件中。如果我想要第 100 帧上的第三个 ROI 多边形,我希望能够立即加载它。我还希望能够在保存的文件中插入和删除 ROI。

执行此操作的最佳文件格式是什么?是否有可接受的格式或应用程序? ImageJ 有一个原生的 ROI 格式,但我对此了解不多。我的应用程序现在是用 IDL 编程的。 IDL 有自己的 ROI 类,但正如我所说,我不想将它们全部写到单独的文件中,而且我没有资源将它们全部合并到一个文件中。 XML?谢谢。

I need to save and re-load thousands of ROI polygons on a stack of images, actually a 30-frame-per second movie for 30+ minutes, so at least 54,000 frames. There can be multiple ROIs on a single image (frame) in the stack, and the size and number of vertices for each ROI is different. The ROI polygons are tracking the edges of shapes as they change over time.

The movie stack is usually too big to hold in memory at once. I post-process it, churning through it frame by frame to track my shapes. I can save the ROI objects to binary files one frame at a time, but that generates 54,000+ files to keep together. Alternatively, if I try to allocate a container object to hold all 54,000+ ROI frames and then save that to one file, I quickly run out of resources.

I’d like to save all the ROIs to one file that I can randomly access and modify. If I want the third ROI polygon on frame 100, I want to be able to load it immediately. I also want to be able to insert and delete ROIs into the saved file.

What’s the best file format for doing this? Is there an accepted format or application? ImageJ has a native ROI format, but I don’t know much about it. My application is programmed in IDL right now. IDL has its own ROI class, but like I said, I’d rather not write them all out to separate files, and I don’t have the resources to combine them all in one file. XML? Thanks.

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

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

发布评论

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

评论(2

合约呢 2024-08-30 14:53:12

ImageJ ROI 格式记录在此处。我会考虑使用关系数据库进行存储和随机访问。 H2 Database 是我最喜欢的,但是有很多替代方案

The ImageJ ROI format is documented here. I'd consider using a relational database for storage and random access. H2 Database is my favorite, but there are plenty of alternatives.

∞梦里开花 2024-08-30 14:53:12

不久前我必须做一些非常相似的事情(多边形、IDL、快速访问)。我的决定是将所有 ROI 放入一个文件中,然后创建第二个文件,其中包含每个多边形开始的偏移量。

基本上文件#1将包含每个ROI的所有顶点的列表,文件#2包含指定多边形开始的字节偏移量的整数列表,即文件#2中的第i个整数是文件#中的位置1 Polygon_i 所在位置。

我使用它来快速访问近 500 万个多边形,总共约 40 亿个顶点。

I have to do something very similar a while ago (polygons, IDL, fast access). My decision was to take all of my ROIs and put them in one file and then have a second file that contained the offset that each polygon started at.

Basically file #1 would contain a list of all of the vertices of every ROI and file #2 contained a list of integers that specified the byte offset where that polygon started, i.e., the ith integer in file #2 was the location in file #1 where polygon_i was located.

I've used this for fast access of nearly 5 million polygons with about 4 billion vertices in total.

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