Path: news.mathworks.com!not-for-mail
From: "Mark Mather" <mmather@google.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: simple 3D volume visualization
Date: Fri, 16 May 2008 00:41:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 52
Message-ID: <g0il6v$ac2$1@fred.mathworks.com>
References: <g0d3t7$2so$1@fred.mathworks.com> <g0d7he$kab$1@fred.mathworks.com> <g0d9op$ica$1@fred.mathworks.com> <g0e8be$ku$1@fred.mathworks.com>
Reply-To: "Mark Mather" <mmather@google.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210898463 10626 172.30.248.37 (16 May 2008 00:41:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 May 2008 00:41:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1385314
Xref: news.mathworks.com comp.soft-sys.matlab:468743



> Try this:
> 
>  load mri.mat % Load the MRI data
>  D = squeeze(D); % Convert it to "Volume" data
>  h = patch(isosurface(D,.99)); % Show the 0.99 isolevel
>  set(h,'FaceColor','none') % Turn off all faces
>  view(3) % Adjust the view to 3-D.
> 
> There is your wire mesh of the head.  Now with this 
> example, the largest values (~88) all occur in the skull, 
> so any isolevel you plot is going to include the skull.  
> However, if you did have data with larger values in the 
> interior (e.g., over 100), you could plot these using the 
> addition of the code:
> 
>  hold on
>  h2 = patch(isosurface(D,100)); % Show the 100 isolevel
> 
Great! I think I finally understand- it's the transition
from 0 to anything above 1 that is showing up as the path
vertices (when set at .99). 

I added a solid red rectangle to the interior as such:
load mri.mat % Load the MRI data
 D = squeeze(D); % Convert it to "Volume" data
 D(60:64,60:64,16:20)=100; %make red box
 h = patch(isosurface(D,0.99)); % Show the 0.99 isolevel
 set(h,'FaceColor','none','EdgeColor','blue') % Turn off all
faces, make edges blue
 view(3) % Adjust the view to 3-D.
 h2 = patch(isosurface(D,90)); % Show the 90 isolevel
 set(h2,'FaceColor','red')



So my next two questions relate to making the edges less
obtrusive- can I have it look for less vertices at a
distinct interval? I looked at the patch properties and
didn't see anything like this. 

I tried 

set(h,'FaceColor','none','EdgeColor','blue', EdgeAlpha, 0.5)

and it crashes matlab. I can do EdgeAlpha, 'flat' fine, so
perhaps it is my graphics setup. 

Thanks so much for your help and patience with this simple
task, this really helps a lot and hopefully many others will
find it useful.