No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.9 | 8 ratings Rate this file 37 Downloads (last 30 days) File Size: 9.29 KB File ID: #8772 Version: 1.0
image thumbnail




20 Oct 2005 (Updated )

Convert a volume defined by a surface to a binary 3D block.

| Watch this File

File Information

First the surface will be rasterized on the grid. Therefore it calculates the position of points which lie in the surface in a finer resolution as defined by the inputgrid. These points were then tranfered to the point it the inputgrid by using a simple indexing technique. One could also use dsearchn, but this takes to much computational time, however, it can avoid the need of an equidistant grid. After rasterizing the patches the background is fill using imfill. The start point is set to the lower left corner. Afterwards the data block will be inverted. The script tests if the datablock is fully filled and tries to repeat the task slice by slice.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
24 May 2016 Lukas

Lukas (view profile)

I have a little problem:

Error using fprintf
Operation is not implemented for requested file identifier.

Error in surface2volume (line 92)
tic; fprintf(outputFID,'Initializing ... ');

Comment only
15 Apr 2016 XiaoGang  
18 Aug 2015 SHERRY

SHERRY (view profile)


07 Feb 2013 abdel amazoz

merci M. Daniel

07 Mar 2010 Steve

Steve (view profile)

I would also like to know how to use it with data in (x,y,z) format. Can you please tell me?

15 Dec 2009 Alex Kararg

Given only the x,y,z coordinates of a surface S how does this function work?

Comment only
28 Nov 2008 nor ki

nor ki (view profile)

nice tool,
but it confuses x with y coordinates in line 172

21 Oct 2008 Sebastian H

Amazing! Fast and reliable. Many, many thanks.

A hint: I had to change the outputFID from 0 to 1, Matlab 7.6 R2008a seems not to accept zero file identifiers for fprintf.

20 Oct 2008 Carlos Platero

I need 3D models

Comment only
27 Feb 2007 thevan S

Very good and help full

21 Aug 2006 Hyok Jeong

very very good.

Contact us