No BSD License  

Highlights from
WriteToVTK

5.0

5.0 | 1 rating Rate this file 21 Downloads (last 30 days) File Size: 1.77 KB File ID: #23416

WriteToVTK

by Tim

 

24 Mar 2009

Write 3D matrices to VTK files viewable with Paraview.

| Watch this File

File Information
Description

This writes a 3D matrix to a VTK file. An old text-based format is used because it is easy to write to. This may result in very large file sizes.

The matrix is normalised, kind of. Not sure why I did that; it might not be needed. The code is very short so feel free to experiment!

Usage:

WriteToVTK(matrix, filename)

Example:

m = reshape(magic(6), [3 3 4]);
WriteToVTK(m, 'magic.vtk');

Acknowledgements
This submission has inspired the following:
Write Cell Array of Structs into a VTK Structured Grid
MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
17 Oct 2010 Nate

Awesome! Great for viewing 3-D level-set data...and then making quick stereo movies in paraview..thanks Tim.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
vtk Tim 24 Mar 2009 14:02:56
paraview Tim 24 Mar 2009 14:02:56
visualisation Tim 24 Mar 2009 14:02:56
export Tim 24 Mar 2009 14:02:56
save Tim 24 Mar 2009 14:02:56
3d Tim 24 Mar 2009 14:02:56
matrix Tim 24 Mar 2009 14:02:56
tensor Tim 24 Mar 2009 14:02:56

Contact us at files@mathworks.com