什么数据格式可以从 Java (Clojure) 写入并由 Paraview 读取?
我有一些 Clojure 代码,可以生成常规 3D 数据网格(体素)。我想将其写入一个文件,以便以后可以由 Paraview(以及可能的其他分析/可视化程序)读取。最简单的方法是什么?我的首要任务是简单性,但我也希望它能够很好地扩展,以便我可以将它用于大型数据集。我不需要处理比常规网格更复杂的东西。
I have some Clojure code that generates a regular 3D grid of data (voxels). I want to write this to a file that can be later read by Paraview (and, possibly, other analysis/visualisation programs). What is the simplest way to do this? My main priority is simplicity, but I would also like this to also scale well, so that I can use it for large datasets. I do not need to handle anything more complex than a regular grid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Paraview 有一个“原始”输入格式,它只是一个二进制值序列,其中 X 变化最快,Z 最慢。以下 Clojure 代码将以这种格式写入双精度序列:
然后,您可以通过选择文件(使用
.raw
扩展名)并输入元数据(原点、步长、范围)将其读入 Paraview对于轴。这不是一个很好的解决方案 - 最好在文件中也包含元数据 - 但它非常简单。它有效。[注意 - DataOutputStream 生成大端格式的数据]
Paraview has a "raw" input format, which is simply a sequence of binary values, with X varying fastest, Z slowest. The following Clojure code will write a sequence of doubles in this format:
You can then read this into Paraview by selecting the file (use a
.raw
extension) and entering the metadata (origin, step, range) for the axes. It's not a great solution - it would be better to have the metadata in the file too - but it's very simple. And it works.[Note - DataOutputStream generates data in big-endian format]