Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pyevtk documentation writearraystovtk

import numpy as np
from enthought.tvtk.api import tvtk, write_data

data = np.random.random((10,10,10))

grid = tvtk.ImageData(spacing=(10, 5, -10), origin=(100, 350, 200), 
                      dimensions=data.shape)
grid.point_data.scalars = np.ravel(order='F')
grid.point_data.scalars.name = 'Test Data'

# Writes legacy ".vtk" format if filename ends with "vtk", otherwise
# this will write data using the newer xml-based format.
write_data(grid, 'test.vtk')
Comment

PREVIOUS NEXT
Code Example
Python :: flask decorator causes views to be named the same thing 
Python :: Use in in django while preserving order 
Python :: elavon converge api python tutorial 
Python :: python - retrieve unconnected node pairs 
Python :: when training= false still dropout 
Python :: create bbox R sp 
Python :: Installez django-cruds-adminlte 
Python :: how to open a widget using sputil.get 
Python :: RuntimeError: cannot open featureclass in python 
Python :: python update pip windows 
Shell :: how to check laptop serial number in ubuntu 
Shell :: how to delete dangling docker images 
Shell :: rails server already running 
Shell :: set default branch to main on git init 
Shell :: install dateutil 
Shell :: Error starting daemon: error while opening volume store metadata database: timeout 
Shell :: remove valet from mac 
Shell :: remove all the containers docker 
Shell :: how to pronounce ubuntu 
Shell :: ubuntu bluetooth not working 
Shell :: install wps ubuntu 
Shell :: apache restart 
Shell :: git branch order by date 
Shell :: Please install all available updates for your release before upgrading. 
Shell :: git apply .gitignore 
Shell :: shutdown pc in 10 minutes 
Shell :: refusing to merge unrelated histories bitbucket 
Shell :: magento 2 version file permissions 
Shell :: how to increase nginx maximum file upload size 
Shell :: kill intellij ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =