将大型3D NumPy数组加载到Paraview中 [英] Loading Large 3D NumPy Array Into Paraview
问题描述
将大型3D NumPy数组保存到的最佳文件格式是什么,以便我可以轻松地将其加载到Paraview中?
What is the best file format to save a large 3D NumPy array to, so I can easily load it into Paraview?
我有一个非常大的3D NumPy数组,其中填充了数据点.我正在尝试使用一些不同的方法将这个大型数组加载到Paraview中,但是我一直没有成功.数组的尺寸为(2000,1500,200).
I have a very large 3D NumPy array filled with data points. I am trying to load this large array into Paraview using a few different methods, but I have been unsuccessful. The array has dimensions of (2000, 1500, 200).
到目前为止,我已经使用 gridToVTK
将数组转换为 .vtr
文件,但是如果数组大得多, gridToVTK
就会崩溃超过100MB.我将数组拆分为较小的,更易于维护的块,并将这些块另存为多个 .vtr
文件,并在Paraview中将它们一起缝在一起,但是这种方法太慢且乏味.
So far, I have used gridToVTK
to convert the array into a .vtr
file, but gridToVTK
crashes if the array is much larger than 100MB. I split up the array into smaller more maintainable chunks and saved the chunks as multiple .vtr
files and stiched them together in Paraview, but this method is too slow and tedious.
我还尝试将NumPy数组另存为 .raw
文件并将其加载到Paraview中,但是使用该方法失败.
I have also tried saving the NumPy array as a .raw
file and loading that into Paraview, but I have been unsuccessful using that method.
有人对如何尝试保存此数组有任何建议,以便可以轻松地将其加载到Paraview中吗?
Does anybody have any suggestions on how I should try and save this array so that I can easily load it into Paraview?
推荐答案
您可以使用 vtk
模块来 vtkXMLImageDataWriter
You can use the vtk
module to use a vtkImageImport and then write the resulting imageData with vtkXMLImageDataWriter
这篇关于将大型3D NumPy数组加载到Paraview中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!