Hello. I have looked over the volume visulization techniques
documentation and I still can't make much sense of it.
It seems the technique here is some form of:
vol3d=patch(isosurface(data,isovalue))
In the scalar data example they use mri data as the volume,
then somehow find the 'skin' on the surface all has an
isovalue of 5. This makes no sense to me, as looking at the
data this is simply not true. What exactly is an isovalue- I
seem to read it is like a contour line but from the example
the skin portion does not seem to be all the points with a
value of 5 (or lower/higher than 5).
Is there a simple clear explanation of what is going on here?
As a very simple example, take a 20x20x20 zero matrix, and
put random integers in a 5x5x5 cube in the center. How can I
plot the surface of this cube, regardless of the values? How
can I plot just a wire frame of the surface of the cube?
I have searched but never seem to find any guide on how to
do this other than the official documentation, so if someone
could point me n the right direction to do simple things to
build my technique on that would be greatly appreciated.
"Mark Mather" <mmather@google.com> wrote in message <g0d3t7
$2so$1@fred.mathworks.com>...
> Hello. I have looked over the volume visulization
techniques
> documentation and I still can't make much sense of it.
>
> It seems the technique here is some form of:
>
> vol3d=patch(isosurface(data,isovalue))
>
> In the scalar data example they use mri data as the
volume,
> then somehow find the 'skin' on the surface all has an
> isovalue of 5. This makes no sense to me, as looking at
the
> data this is simply not true. What exactly is an
isovalue- I
> seem to read it is like a contour line but from the
example
> the skin portion does not seem to be all the points with
a
> value of 5 (or lower/higher than 5).
>
> Is there a simple clear explanation of what is going on
here?
>
> As a very simple example, take a 20x20x20 zero matrix,
and
> put random integers in a 5x5x5 cube in the center. How
can I
> plot the surface of this cube, regardless of the values?
How
> can I plot just a wire frame of the surface of the cube?
>
> I have searched but never seem to find any guide on how
to
> do this other than the official documentation, so if
someone
> could point me n the right direction to do simple things
to
> build my technique on that would be greatly
appreciated.
>
>
doc surf
> As a very simple example, take a 20x20x20 zero matrix, and
> put random integers in a 5x5x5 cube in the center. How
can I
> plot the surface of this cube, regardless of the values?
How
> can I plot just a wire frame of the surface of the cube?
Well, this isn't "regardless of the values", but it shows
an example of how to create the wire mesh you mention using
ISOSURFACE:
A = zeros(20,20,20); % 20-by-20-by-20 zeros
A(8:12,8:12,8:12) = 1; % 5-by-5-by-5 cube of 1's
h = patch(isosurface(A,.99)); % Create "contour" at 0.99
set(h,'FaceColor','none') % "Hide" faces
view(3) % Rotate to 3-D view
I'm not sure, however, what you actually want. How does
this example differ from what you actually want?
> Well, this isn't "regardless of the values", but it shows
> an example of how to create the wire mesh you mention using
> ISOSURFACE:
>
>
> A = zeros(20,20,20); % 20-by-20-by-20 zeros
> A(8:12,8:12,8:12) = 1; % 5-by-5-by-5 cube of 1's
>
> h = patch(isosurface(A,.99)); % Create "contour" at 0.99
>
> set(h,'FaceColor','none') % "Hide" faces
> view(3) % Rotate to 3-D view
>
>
> I'm not sure, however, what you actually want. How does
> this example differ from what you actually want?
Thanks so much, that's exactly the kind of simple example I
need to pick apart.
I changed it to this, and am now a bit confused:
A = zeros(20,20,20); % 20-by-20-by-20 zeros
B=rand(5,5,5).*10 %generate random 5-by-5 data
A(8:12,8:12,8:12) = B
h = patch(isosurface(A,7)); % Create "contour" at 7?
set(h,'FaceColor','red') % make faces red
view(3) % Rotate to 3-D view
So is this new grouping of red faces encapsulating all the
points less than 7?
I have a series of MRI slices of a head in scalar format.
Outside of the head are zero values. I would like to plot a
wire mesh around the surface of the head.
Next I would like to show the head (or a region inside the
head) in solid form, say all voxels above value 100 or
something. Obviously with hold on this will show where in
the head these regions are located and orientated.
"Mark Mather" <mmather@google.com> wrote in message
<g0d9op$ica$1@fred.mathworks.com>...
>
> > Well, this isn't "regardless of the values", but it
shows
> > an example of how to create the wire mesh you mention
using
> > ISOSURFACE:
> >
> >
> > A = zeros(20,20,20); % 20-by-20-by-20 zeros
> > A(8:12,8:12,8:12) = 1; % 5-by-5-by-5 cube of 1's
> >
> > h = patch(isosurface(A,.99)); % Create "contour" at 0.99
> >
> > set(h,'FaceColor','none') % "Hide" faces
> > view(3) % Rotate to 3-D view
> >
> >
> > I'm not sure, however, what you actually want. How
does
> > this example differ from what you actually want?
>
> Thanks so much, that's exactly the kind of simple example
I
> need to pick apart.
>
> I changed it to this, and am now a bit confused:
>
> A = zeros(20,20,20); % 20-by-20-by-20 zeros
> B=rand(5,5,5).*10 %generate random 5-by-5 data
> A(8:12,8:12,8:12) = B
>
> h = patch(isosurface(A,7)); % Create "contour" at 7?
>
> set(h,'FaceColor','red') % make faces red
> view(3) % Rotate to 3-D view
>
> So is this new grouping of red faces encapsulating all the
> points less than 7?
I don't think "encapsulating" is the right word.
ISOSURFACE interpolates the data and plots the surface
where the interpolated A data is 7. This may or may not be
closed surface based on what form the data takes. Check
out the Flow example in the documentation for ISOSURFACE.
There isn't a closed surface.
> I have a series of MRI slices of a head in scalar format.
> Outside of the head are zero values. I would like to plot
a
> wire mesh around the surface of the head.
>
> Next I would like to show the head (or a region inside the
> head) in solid form, say all voxels above value 100 or
> something. Obviously with hold on this will show where in
> the head these regions are located and orientated.
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
> 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.
> 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.
Look into the REDUCEVOLUME and SHRINKFACES functions.
> 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.
Ewwwwww. It crashes my computer too. It seems to be
having a problem with the large number of faces. Using
REDUCEVOLUME with the factors [4,4,2] allows setting an
EdgeAlpha value without crashing.
I definately recommend reporting this crash directly to
technical support (not the the segv@whatever email they
give). This has got to be a bug.
I didn't like how REDUCEVOLUME looked, but using
SHRINKFACES with a very small number, for example:
shrinkfaces(h,0.01)
seemed to be able to retain some decent skull resolution.
Tags for this Thread
Add a New Tag:
Separated by commas
Ex.: root locus, bode
What are tags?
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.