Code covered by the BSD License  

Highlights from
Export Voxel Data

5.0

5.0 | 1 rating Rate this file 21 Downloads (last 30 days) File Size: 2.05 MB File ID: #43640
image thumbnail

Export Voxel Data

by

 

Export objects described in a logical matrix, label matrix or voxel list to STL and PovRay mesh2.

| Watch this File

File Information
Description

Export Voxel Data
===================

This submission allows to export multiple objects described in logical matrix, label matrix or voxel list data to STL and PovRay mesh2 format.

Mesh can be determined from the data using convhull, isosurface or geometric method.

Extracted mesh can be smoothed, resampled and translated as required.

Package provides a script, which allows to generate a simple PovRay scene, where exported objects are included with a given colour, transparency and texture. Objects can be coloured using some array of scalars as a key.

Similar script is written to export a Blender "configuration" file, which can be opened with a Blender add-on (also attached) that imports STL files and assigns each object a colour specified in the "configuration" file.

A manual describing every option is provided. Further examples that use real data are available to download (links are included in the manual).

External scripts used/included within the upload (that are not present on MathWorks):
- resampling script from "iso2mesh" package by Qianqian Fang (Available at: iso2mesh.sourceforge.net)
- a stereoscopic camera add-on to Blender by Sebastian Schneider (Available at: noeol.de/s3d/)

License crash difficulties
===================

The resampling part of the package could not be included in the submission itself, but on first required use of the resampling part it will be downloaded from my Google Drive and added to the package. This is because it uses some functions from iso2mesh package, which is distributed under GNU license and MathWorks.com does not support it.

Similar situation applies to Blender Addons. Both are distributed under GPL license, hence are not included in the package, but there is a hotlink present in the package to download them.

I am sorry for additional problems, but this was the easiest way I could think of to overcome the problem of licensing.

Notes
===================

This package is a by-product of my main internship project, which was analysis of random rod packing. Further examples mentioned above use some of the data collected.

I did my best to make the package up to MathWorks standard, but it is my first submission, so I would appreciate all comments and suggestions on what to change.

Acknowledgements

Stlwrite Write Binary Or Ascii Stl File, Smooth Triangulated Mesh, Check Whether Mex File Is Compiled For System, and Converting A 3 D Logical Array Into An Stl Surface Mesh inspired this file.

Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Other requirements Optional PovRay and Blender.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
29 Sep 2013 Max Neudecker

Overall, this is a very useful package, which an exceptionally good documentation (See PDF file!) Its main advantage are generic, well accessible interface and the modular, integrated workflow (see the Fig.2 in the manual).

For me (MATLAB 2012b, ubuntu64bit), it works out of the box, and automatically compiled the missing mex files for your platform.

However, I encountered a few Out-Of-Memory issues with the "smoothing" option. If you set the default value,
p.smoothing.smooth = false; (ExportVoxelData.m, line 137) then it works. The "geometric" option took very long, I suppose it got stuck in CONVERT_meshformat.

I think, if you have 3D-data e.g. from X-Ray-Tomography or confocal microscopy, and are looking for nice visualization -even with stereoscopic images- of segmented objects in Povray or with your favourite STL program, this might be the right tool.

Keep up the good work!

Contact us