to_vtk(im, filename, divide=False, downsample=False, voxel_size=1, vox=False)[source]

Converts an array to a vtk file.

  • im (3D image) – The image of the porous material

  • path (string) – Path to output file

  • divide (bool) – vtk files can get very large, this option allows you for two output files, divided at z = half. This allows for large data sets to be imaged without loss of information

  • downsample (bool) – very large images acan be downsampled to half the size in each dimension, this doubles the effective voxel size

  • voxel_size (int) – The side length of the voxels (voxels are cubic)

  • vox (bool) – For an image that is binary (1’s and 0’s) this reduces the file size by using int8 format (can also be used to reduce file size when accuracy is not necessary ie: just visulization)


Outputs a vtk, vtp or vti file that can opened in paraview


Click here to view online example.