[vtkusers] How to represent voxel volume in .vtk file format?

Justin Weber onlyjus at gmail.com
Sat Mar 10 09:40:10 EST 2012


Sergiy,

What code are you using? If you are using python <http://python.org/>, I
have code that will take numpy arrays and save them to *.vtk files that
work in paraview. However you need the pyhon wrapped vtk library. For
windows, there is an awesome collection of windows binaries here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/, thanks  Christoph Gohlke!

Also, there is PyEVTK <https://bitbucket.org/pauloh/pyevtk>. Another
resource: http://www.vtk.org/Wiki/VTK/Writing_VTK_files_using_python.

Justin
On Mar 10, 2012 12:36 AM, "Sergiy Tkachuk" <serg.tk at gmail.com> wrote:

>  Hi,
>
> I have 3d binary array which represents volume:
> a[x,y,z] = 0 - no object,
> a[x,y,z] = 1 - object region.
>
> I want to save it in .vtk format and view in ParaView<http://www.paraview.org/>
> .
> What is the simplest way to achieve this?
>
> I looked through the VTK file format<http://www.vtk.org/VTK/img/file-formats.pdf>,
> but I have not found direct way to achieve what I need, just via other
> structures..
>
> Best wishes,
> Sergiy
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120310/188e3040/attachment.htm>


More information about the vtkusers mailing list