Saving numpy meshgrid to vtk file
See original GitHub issueI am looking through vtkplotter examples to find an example on how to write a numpy array as a structured grid to a VTK file. But unfortunately, I couldn’t find it.
- Is it possible to write a vtk file from a numpy array? Here is an example:
import numpy as np
X, Y = np.meshgrid(np.linspace(0, 2, 10), np.linspace(0, 1, 5))
x = X.ravel()
y = Y.ravel()
z = np.zeros_like(x)
# Is it possible to use vtkplotter to save these arrays (x, y, z) as a vtk file assuming a structured topology?
The expected result is a vtk file as shown here:
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Saving numpy meshgrid to vtk file · Issue #86 · marcomusy/vedo
I am looking through vtkplotter examples to find an example on how to write a numpy array as a structured grid to a...
Read more >Exporting a 3D numpy to a VTK file for viewing in Paraview ...
Therefore my question is: How can one use the from vtk.util import numpy_support function to export a 3D array (the function itself doesn't...
Read more >Converting your NumPy arrays to VTK arrays and files
The first way is using the vtk.util.numpy_support module that comes with VTK and allows you to 'easily' convert your data. The second way...
Read more >Read/write VTK files (Unstructured grid with data)
Read/write VTK files (Unstructured grid with data) ; In [1]:. import numpy as np ; In [17]:. def create_cell_scalars(ncells): ; In [30]:. writer...
Read more >How to convert 3D numpy array to vtk and save the .vtk file?
I have a scalar volume (3D numpy array) 1646504309(1) I want to add some information describing the image and then save it as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you very much 🥇 🥇 🥇
I’ve integrated this functionality in
shapes.Grid
, so from the next release on you can do things like: