File Exchange

image thumbnail

surface2volume

version 1.0.0.0 (3.14 KB) by Daniel Guellmar
Convert a volume defined by a surface to a binary 3D block.

13 Downloads

Updated 24 Oct 2005

No License

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.

Comments and Ratings (19)

Tale Saeidi

I have a 2D image which I got from scattering signals. I have used the example given inside the code. its running well before it wants to calculate the 'nDim=size(OV)'. then i get this error;'The logical indices contain a true value outside of the array bounds.'. Anybody can help? really appreciated that.

Hello, I have a set of 2-D projections as x,y,n

where n is the amount of projections i have, how can i cooperate my projections to this code?

Hang Jo Ann

Hello! Can i apply this function for other mat file other than mri file?how can i write the code?

Laila

Very Nice. Thank you.

Very good!
You need to run the example program in the comments section of the code, using " load mri ". " mri " is a MAT file of image slices that MATLAB already knows about in its example programs set. Also see:
How to create a single .mat file from multiple images?
@ https://uk.mathworks.com/matlabcentral/answers/49954-how-to-create-a-single-mat-file-from-multiple-images

don't work :(
Error using fprintf
Operation is not implemented for requested file identifier.

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

Doesn't work!

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

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

Lukas

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 ... ');

XiaoGang

SHERRY

good!

merci M. Daniel

Steve

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

Alex Kararg

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

nor ki

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

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.

Carlos Platero

I need 3D models

thevan S

Very good and help full

Hyok Jeong

very very good.

Updates

1.0.0.0

There was a small error in the script, which turn the program to fail, if an input grid was given.

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux