From: Salmon on
I have the same frustration using Isosurface. It looks like all Matlab 3D visualization tools were not designed for real work, but for fun only. In real world, nobody uses the 50x100x50 volume set as the examples do. Usually it is at least 256x256x256. The isosurface also doesn't take uint8 or uint16 data, which are the most prevalent data format in the real world. It only takes double, which is 64 bit. If you need to color your isosurface, you need supply "color" volume too. Therefore, even for a small volume set 256x256x256, it costs 256x256x256x8x2 = 256MB memory to store them, then Matlab needs 3-4 times of that memory to actually do the isosurface....

Therefore, after many frustration, I have to give up the Matlab 3D tools and get back to C/C++ library. If you know some better methods to deal with large 3D set in Matlab, give me a hand,

"Jose " <jirey(a)mail.usf.edu> wrote in message <hmsule$qp0$1(a)fred.mathworks.com>...
> Hi,
>
> I have an isosurface which I would like to have as much precision with the least amount of points. Right now, in order to get good precision, I have to start with a very dense (and memory consuming) mesh.
>
> What I do right now is what is in the code below. I start with a monstrous number of points (res=600), I create a meshgrid with 3 dimensions, then I use isosurface to create a level surface, and finally use reducepatch to reduce the number of faces. HOWEVER, the initial steps are consuming way too much memory and time.
From: Ravi on
Hi,

I just wanted to point out that MATLAB isosurface function has a lot of problems for complex data.

I have created a program that renders exact error-free surfaces from 3-D voxel data, such as from MRI, CT Scan.

The following is the link to the discussion thread

http://www.mathworks.com/matlabcentral/newsreader/view_thread/268226#755017

You can download the program from

http://www.hermesacademy.com/products

Ravi


"Jose " <jirey(a)mail.usf.edu> wrote in message <hmsule$qp0$1(a)fred.mathworks.com>...
> Hi,
>
> I have an isosurface which I would like to have as much precision with the least amount of points. Right now, in order to get good precision, I have to start with a very dense (and memory consuming) mesh.
>
> What I do right now is what is in the code below. I start with a monstrous number of points (res=600), I create a meshgrid with 3 dimensions, then I use isosurface to create a level surface, and finally use reducepatch to reduce the number of faces. HOWEVER, the initial steps are consuming way too much memory and time.
>
> A solution that would make sense for me is generating a type of meshgrid with variable density tunned to the isosurface... however, I have no idea how to do this.
>
> Thanks very much.
>
> %% set constans to create box
> bs = 10; % box size
> res = 30; %resolution
> minB = -bs; maxB = bs;
> divB = (maxB-minB)/res;
> %% function for an ellipsoid
> % i am using this example for simplicity, the functions I am
> % trying to use are not easily parameterized like an ellipsoid would
> % so that is not an option
> [X,Y,Z] = meshgrid(minB:divB:maxB,minB:divB:maxB,minB:divB:maxB);
> F = X.^2/9+Y.^2/16+Z.^2/25;% compute function values at grid points
> %% create isosurface & use reducepath to reduce number of points
> [f v]=isosurface(X,Y,Z,F,.5);% compute isosurface at F=0.5
> % reducepatch does a good work at reducing the number of vertices
> % without sacrificing too much in terms of shape
> [fr vr] = reducepatch(f,v,.5); %reduce to 50% of the points
> %% plot one against the other
> figure(1);
> % on the left with all the points from meshgrid
> subplot(1,2,1);
> trimesh(f(:,1:3),v(:,1),v(:,2),v(:,3)); %plot faces of surface
> axis equal;
> % on the right with less points - you will see that triangles are
> % more less the same size which means we are making better
> % use of our real estate
> % however, I don't want to start with that many vertices initially
> % I would like to have something a less memory/resource intensive
> subplot(1,2,2);
> trimesh(fr(:,1:3),vr(:,1),vr(:,2),vr(:,3)); %plot faces of surface
> axis equal;