Wednesday, December 31, 2014

Scalar or vector field on structured, uniform grid - Create VTK file for loading into Paraview

Thanks to Joe Yeh for having created a Matlab function, vtkwrite(...), to create a file where scalar and/or vector fields defined on a structured, uniform and regular grid can be saved according to the VTK format needed to be imported in Paraview.
It's a very handy function. To create scalar and vector fields defined on a structured, uniform and regular grid is easy in Matlab. To be able to load the dataset into Paraview is fantastic because one can exploit the powerful visualization and analysis tools of that software.
The Matlab function can be downloaded from this URL.

Load a 3D image in Paraview

How to import a stack of 2D images (3D image) in Paraview?
It may seem a trivial question ... but without knowing some details it may take some time the first time one tries doing that.
See some useful tips at this URL.
Thanks to the Univ. of Manchester, IT Services Group and Computational Science Community Wiki administrators for posting these tips.

Update (14. January 2019)

From version 5.6.0, it's possible to import into Paraview stacks of 2D TIFF image files interpreting them not as a time series of 2D images but as a 3D volume. See the 4.4 version release notes here (point 15.13). Search for "tomography" or for "image stack" as a keyword.
ATTENTION: compared with opening the stack in, say, ImageJ and one of its 3D rendering plugins, e.g., VolumeViewer, the images in the stack are mirrored along the vertical (Y-)axis. Be careful about that!