<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205</link>
    <title>MATLAB Central Newsreader - simple 3D volume visualization</title>
    <description>Feed for thread: simple 3D volume visualization</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 16 May 2008 02:57:02 -0400</pubDate>
      <title>Re: simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#432410</link>
      <author>helper </author>
      <description>&amp;gt; So my next two questions relate to making the edges less&lt;br&gt;
&amp;gt; obtrusive- can I have it look for less vertices at a&lt;br&gt;
&amp;gt; distinct interval? I looked at the patch properties and&lt;br&gt;
&amp;gt; didn't see anything like this. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Look into the REDUCEVOLUME and SHRINKFACES functions.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; I tried &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set(h,'FaceColor','none','EdgeColor','blue', EdgeAlpha, &lt;br&gt;
0.5)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; and it crashes matlab. I can do EdgeAlpha, 'flat' fine, so&lt;br&gt;
&amp;gt; perhaps it is my graphics setup. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Ewwwwww.  It crashes my computer too.  It seems to be &lt;br&gt;
having a problem with the large number of faces.  Using &lt;br&gt;
REDUCEVOLUME with the factors [4,4,2] allows setting an &lt;br&gt;
EdgeAlpha value without crashing.&lt;br&gt;
&lt;br&gt;
I definately recommend reporting this crash directly to &lt;br&gt;
technical support (not the the segv@whatever email they &lt;br&gt;
give).  This has got to be a bug.&lt;br&gt;
&lt;br&gt;
I didn't like how REDUCEVOLUME looked, but using &lt;br&gt;
SHRINKFACES with a very small number, for example:&lt;br&gt;
&lt;br&gt;
shrinkfaces(h,0.01)&lt;br&gt;
&lt;br&gt;
seemed to be able to retain some decent skull resolution. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 16 May 2008 00:41:03 -0400</pubDate>
      <title>Re: simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#432397</link>
      <author>Mark Mather</author>
      <description>&lt;br&gt;
&amp;gt; Try this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  load mri.mat % Load the MRI data&lt;br&gt;
&amp;gt;  D = squeeze(D); % Convert it to "Volume" data&lt;br&gt;
&amp;gt;  h = patch(isosurface(D,.99)); % Show the 0.99 isolevel&lt;br&gt;
&amp;gt;  set(h,'FaceColor','none') % Turn off all faces&lt;br&gt;
&amp;gt;  view(3) % Adjust the view to 3-D.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; There is your wire mesh of the head.  Now with this &lt;br&gt;
&amp;gt; example, the largest values (~88) all occur in the skull, &lt;br&gt;
&amp;gt; so any isolevel you plot is going to include the skull.  &lt;br&gt;
&amp;gt; However, if you did have data with larger values in the &lt;br&gt;
&amp;gt; interior (e.g., over 100), you could plot these using the &lt;br&gt;
&amp;gt; addition of the code:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  hold on&lt;br&gt;
&amp;gt;  h2 = patch(isosurface(D,100)); % Show the 100 isolevel&lt;br&gt;
&amp;gt; &lt;br&gt;
Great! I think I finally understand- it's the transition&lt;br&gt;
from 0 to anything above 1 that is showing up as the path&lt;br&gt;
vertices (when set at .99). &lt;br&gt;
&lt;br&gt;
I added a solid red rectangle to the interior as such:&lt;br&gt;
load mri.mat % Load the MRI data&lt;br&gt;
&amp;nbsp;D = squeeze(D); % Convert it to "Volume" data&lt;br&gt;
&amp;nbsp;D(60:64,60:64,16:20)=100; %make red box&lt;br&gt;
&amp;nbsp;h = patch(isosurface(D,0.99)); % Show the 0.99 isolevel&lt;br&gt;
&amp;nbsp;set(h,'FaceColor','none','EdgeColor','blue') % Turn off all&lt;br&gt;
faces, make edges blue&lt;br&gt;
&amp;nbsp;view(3) % Adjust the view to 3-D.&lt;br&gt;
&amp;nbsp;h2 = patch(isosurface(D,90)); % Show the 90 isolevel&lt;br&gt;
&amp;nbsp;set(h2,'FaceColor','red')&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
So my next two questions relate to making the edges less&lt;br&gt;
obtrusive- can I have it look for less vertices at a&lt;br&gt;
distinct interval? I looked at the patch properties and&lt;br&gt;
didn't see anything like this. &lt;br&gt;
&lt;br&gt;
I tried &lt;br&gt;
&lt;br&gt;
set(h,'FaceColor','none','EdgeColor','blue', EdgeAlpha, 0.5)&lt;br&gt;
&lt;br&gt;
and it crashes matlab. I can do EdgeAlpha, 'flat' fine, so&lt;br&gt;
perhaps it is my graphics setup. &lt;br&gt;
&lt;br&gt;
Thanks so much for your help and patience with this simple&lt;br&gt;
task, this really helps a lot and hopefully many others will&lt;br&gt;
find it useful. &lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 14 May 2008 08:37:02 -0400</pubDate>
      <title>Re: simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#431961</link>
      <author>helper </author>
      <description>"Mark Mather" &amp;lt;mmather@google.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0d9op$ica$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Well, this isn't "regardless of the values", but it &lt;br&gt;
shows &lt;br&gt;
&amp;gt; &amp;gt; an example of how to create the wire mesh you mention &lt;br&gt;
using &lt;br&gt;
&amp;gt; &amp;gt; ISOSURFACE:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; A = zeros(20,20,20); % 20-by-20-by-20 zeros&lt;br&gt;
&amp;gt; &amp;gt; A(8:12,8:12,8:12) = 1; % 5-by-5-by-5 cube of 1's&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; h = patch(isosurface(A,.99)); % Create "contour" at 0.99&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; set(h,'FaceColor','none') % "Hide" faces&lt;br&gt;
&amp;gt; &amp;gt; view(3) % Rotate to 3-D view&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I'm not sure, however, what you actually want.  How &lt;br&gt;
does &lt;br&gt;
&amp;gt; &amp;gt; this example differ from what you actually want?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks so much, that's exactly the kind of simple example &lt;br&gt;
I&lt;br&gt;
&amp;gt; need to pick apart. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I changed it to this, and am now a bit confused:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A = zeros(20,20,20); % 20-by-20-by-20 zeros&lt;br&gt;
&amp;gt; B=rand(5,5,5).*10 %generate random 5-by-5 data&lt;br&gt;
&amp;gt; A(8:12,8:12,8:12) = B&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; h = patch(isosurface(A,7)); % Create "contour" at 7?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set(h,'FaceColor','red') % make faces red &lt;br&gt;
&amp;gt; view(3) % Rotate to 3-D view&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; So is this new grouping of red faces encapsulating all the&lt;br&gt;
&amp;gt; points less than 7?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I don't think "encapsulating" is the right word.  &lt;br&gt;
ISOSURFACE interpolates the data and plots the surface &lt;br&gt;
where the interpolated A data is 7.  This may or may not be &lt;br&gt;
closed surface based on what form the data takes.  Check &lt;br&gt;
out the Flow example in the documentation for ISOSURFACE.  &lt;br&gt;
There isn't a closed surface. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; I have a series of MRI slices of a head in scalar format.&lt;br&gt;
&amp;gt; Outside of the head are zero values. I would like to plot &lt;br&gt;
a&lt;br&gt;
&amp;gt; wire mesh around the surface of the head. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Next I would like to show the head (or a region inside the&lt;br&gt;
&amp;gt; head) in solid form, say all voxels above value 100 or&lt;br&gt;
&amp;gt; something. Obviously with hold on this will show where in&lt;br&gt;
&amp;gt; the head these regions are located and orientated. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Try this:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;load mri.mat % Load the MRI data&lt;br&gt;
&amp;nbsp;D = squeeze(D); % Convert it to "Volume" data&lt;br&gt;
&amp;nbsp;h = patch(isosurface(D,.99)); % Show the 0.99 isolevel&lt;br&gt;
&amp;nbsp;set(h,'FaceColor','none') % Turn off all faces&lt;br&gt;
&amp;nbsp;view(3) % Adjust the view to 3-D.&lt;br&gt;
&lt;br&gt;
There is your wire mesh of the head.  Now with this &lt;br&gt;
example, the largest values (~88) all occur in the skull, &lt;br&gt;
so any isolevel you plot is going to include the skull.  &lt;br&gt;
However, if you did have data with larger values in the &lt;br&gt;
interior (e.g., over 100), you could plot these using the &lt;br&gt;
addition of the code:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;hold on&lt;br&gt;
&amp;nbsp;h2 = patch(isosurface(D,100)); % Show the 100 isolevel&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 13 May 2008 23:55:05 -0400</pubDate>
      <title>Re: simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#431921</link>
      <author>Mark Mather</author>
      <description>&lt;br&gt;
&amp;gt; Well, this isn't "regardless of the values", but it shows &lt;br&gt;
&amp;gt; an example of how to create the wire mesh you mention using &lt;br&gt;
&amp;gt; ISOSURFACE:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A = zeros(20,20,20); % 20-by-20-by-20 zeros&lt;br&gt;
&amp;gt; A(8:12,8:12,8:12) = 1; % 5-by-5-by-5 cube of 1's&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; h = patch(isosurface(A,.99)); % Create "contour" at 0.99&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set(h,'FaceColor','none') % "Hide" faces&lt;br&gt;
&amp;gt; view(3) % Rotate to 3-D view&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm not sure, however, what you actually want.  How does &lt;br&gt;
&amp;gt; this example differ from what you actually want?&lt;br&gt;
&lt;br&gt;
Thanks so much, that's exactly the kind of simple example I&lt;br&gt;
need to pick apart. &lt;br&gt;
&lt;br&gt;
I changed it to this, and am now a bit confused:&lt;br&gt;
&lt;br&gt;
A = zeros(20,20,20); % 20-by-20-by-20 zeros&lt;br&gt;
B=rand(5,5,5).*10 %generate random 5-by-5 data&lt;br&gt;
A(8:12,8:12,8:12) = B&lt;br&gt;
&lt;br&gt;
h = patch(isosurface(A,7)); % Create "contour" at 7?&lt;br&gt;
&lt;br&gt;
set(h,'FaceColor','red') % make faces red &lt;br&gt;
view(3) % Rotate to 3-D view&lt;br&gt;
&lt;br&gt;
So is this new grouping of red faces encapsulating all the&lt;br&gt;
points less than 7?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I have a series of MRI slices of a head in scalar format.&lt;br&gt;
Outside of the head are zero values. I would like to plot a&lt;br&gt;
wire mesh around the surface of the head. &lt;br&gt;
&lt;br&gt;
Next I would like to show the head (or a region inside the&lt;br&gt;
head) in solid form, say all voxels above value 100 or&lt;br&gt;
something. Obviously with hold on this will show where in&lt;br&gt;
the head these regions are located and orientated. &lt;br&gt;
&lt;br&gt;
Thanks!!!&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 13 May 2008 23:17:02 -0400</pubDate>
      <title>Re: simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#431916</link>
      <author>helper </author>
      <description>&amp;gt; As a very simple example, take a 20x20x20 zero matrix, and&lt;br&gt;
&amp;gt; put random integers in a 5x5x5 cube in the center. How &lt;br&gt;
can I&lt;br&gt;
&amp;gt; plot the surface of this cube, regardless of the values? &lt;br&gt;
How&lt;br&gt;
&amp;gt; can I plot just a wire frame of the surface of the cube? &lt;br&gt;
&lt;br&gt;
Well, this isn't "regardless of the values", but it shows &lt;br&gt;
an example of how to create the wire mesh you mention using &lt;br&gt;
ISOSURFACE:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
A = zeros(20,20,20); % 20-by-20-by-20 zeros&lt;br&gt;
A(8:12,8:12,8:12) = 1; % 5-by-5-by-5 cube of 1's&lt;br&gt;
&lt;br&gt;
h = patch(isosurface(A,.99)); % Create "contour" at 0.99&lt;br&gt;
&lt;br&gt;
set(h,'FaceColor','none') % "Hide" faces&lt;br&gt;
view(3) % Rotate to 3-D view&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I'm not sure, however, what you actually want.  How does &lt;br&gt;
this example differ from what you actually want?&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 13 May 2008 22:37:02 -0400</pubDate>
      <title>Re: simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#431912</link>
      <author>Mark Mather</author>
      <description>&lt;br&gt;
&amp;gt; doc surf&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
I don't have a function to define [X Y Z] for my data, they&lt;br&gt;
are scalar indices of a 3D image. How would I use surf to&lt;br&gt;
show this?&lt;br&gt;
&amp;nbsp;&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 13 May 2008 22:19:01 -0400</pubDate>
      <title>Re: simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#431908</link>
      <author>Scott Burnside</author>
      <description>"Mark Mather" &amp;lt;mmather@google.com&amp;gt; wrote in message &amp;lt;g0d3t7&lt;br&gt;
$2so$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello. I have looked over the volume visulization &lt;br&gt;
techniques&lt;br&gt;
&amp;gt; documentation and I still can't make much sense of it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It seems the technique here is some form of:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; vol3d=patch(isosurface(data,isovalue))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In the scalar data example they use mri data as the &lt;br&gt;
volume,&lt;br&gt;
&amp;gt; then somehow find the 'skin' on the surface all has an&lt;br&gt;
&amp;gt; isovalue of 5. This makes no sense to me, as looking at &lt;br&gt;
the&lt;br&gt;
&amp;gt; data this is simply not true. What exactly is an &lt;br&gt;
isovalue- I&lt;br&gt;
&amp;gt; seem to read it is like a contour line but from the &lt;br&gt;
example&lt;br&gt;
&amp;gt; the skin portion does not seem to be all the points with &lt;br&gt;
a&lt;br&gt;
&amp;gt; value of 5 (or lower/higher than 5).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is there a simple clear explanation of what is going on &lt;br&gt;
here?   &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As a very simple example, take a 20x20x20 zero matrix, &lt;br&gt;
and&lt;br&gt;
&amp;gt; put random integers in a 5x5x5 cube in the center. How &lt;br&gt;
can I&lt;br&gt;
&amp;gt; plot the surface of this cube, regardless of the values? &lt;br&gt;
How&lt;br&gt;
&amp;gt; can I plot just a wire frame of the surface of the cube? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have searched but never seem to find any guide on how &lt;br&gt;
to&lt;br&gt;
&amp;gt; do this other than the official documentation, so if &lt;br&gt;
someone&lt;br&gt;
&amp;gt; could point me n the right direction to do simple things &lt;br&gt;
to&lt;br&gt;
&amp;gt; build my technique on that would be greatly &lt;br&gt;
appreciated.  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
doc surf&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 13 May 2008 22:15:03 -0400</pubDate>
      <title>simple 3D volume visualization</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169205#431907</link>
      <author>Mark Mather</author>
      <description>Hello. I have looked over the volume visulization techniques&lt;br&gt;
documentation and I still can't make much sense of it.&lt;br&gt;
&lt;br&gt;
It seems the technique here is some form of:&lt;br&gt;
&lt;br&gt;
vol3d=patch(isosurface(data,isovalue))&lt;br&gt;
&lt;br&gt;
In the scalar data example they use mri data as the volume,&lt;br&gt;
then somehow find the 'skin' on the surface all has an&lt;br&gt;
isovalue of 5. This makes no sense to me, as looking at the&lt;br&gt;
data this is simply not true. What exactly is an isovalue- I&lt;br&gt;
seem to read it is like a contour line but from the example&lt;br&gt;
the skin portion does not seem to be all the points with a&lt;br&gt;
value of 5 (or lower/higher than 5).&lt;br&gt;
&lt;br&gt;
Is there a simple clear explanation of what is going on here?   &lt;br&gt;
&lt;br&gt;
As a very simple example, take a 20x20x20 zero matrix, and&lt;br&gt;
put random integers in a 5x5x5 cube in the center. How can I&lt;br&gt;
plot the surface of this cube, regardless of the values? How&lt;br&gt;
can I plot just a wire frame of the surface of the cube? &lt;br&gt;
&lt;br&gt;
I have searched but never seem to find any guide on how to&lt;br&gt;
do this other than the official documentation, so if someone&lt;br&gt;
could point me n the right direction to do simple things to&lt;br&gt;
build my technique on that would be greatly appreciated.  &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
