comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: meshes and some irritations
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: meshes and some irritations [message #41649] Fri, 12 November 2004 10:12
Karsten Rodenacker is currently offline  Karsten Rodenacker
Messages: 98
Registered: July 1997
Member
Thank you Karl for some explan- and clarifcation.

Still I have some problems. The stated example was given since my results
in real data, say 128x128x99 or 512x512x99 volumes with greyvalues
overpowdered with some noise will produce and have produced quite
arbitrary results since this example situation with values at the border
of the (expected) surface appears arbitrarily often.

My solution was then to generate first a binary volume and then apply
ISOSURFACE or anything else. The result was of course disastrous,
following this lt/le dichotomy.
However that was not the starting point: We tried to apply transparency to
generated mesh surfaces. The transparent objects appeared very often
rippled depending on the isosurface value chosen (For this I have still to
generate a handy example.)

I am leaving now into weekend, thank you again,
Regards

--
Karsten Rodenacker
------------------------------------------------------------ -------- :-)
GSF - Forschungszentrum Institute of Biomathematics and Biometry
D-85758 Oberschleissheim Postfach 11 29
Karsten.Rodenacker@gsf.de | http://ibb.gsf.de/ | DEL _ for reply
http://ibb.gsf.de/homepage/karsten.rodenacker/
Tel: +49 89 31873401 | FAX: ..3369
Re: meshes and some irritations [message #41651 is a reply to message #41649] Fri, 12 November 2004 09:15 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
"Karsten Rodenacker" <Karsten@rodenacker.de> wrote in message
news:opshchejoj9g3e7u@llkaro.gsf.de...
> After reading several entries in the news list concerning ISOSURFACE,
> SHADE_VOLUME, INTERVAL_VOLUME, MESH_... I am still a bit confused.
>
> Look at the attached piece of code, where a 15^3 volume containing a 3^3
> cube of value 100 is displayed using the mentioned idl routines with
> different values/isovalues/thresholds.
>
> ISOSURFACE is dispayed at Z=0, SHADE_VOLUME at z=-4 and INTERVAL_VOLUME at
> z=+4. Beside the strange volumes calculated, I had expected nearly
> simmilar results, ISOSURFACE does not follow SHADE_VOLUME as described in
> the help, in fact it is seemingly using INTERVAL_VOLUME, at least
> partially.
>
> Maybe there are some experts to explain this behaviour.
>
> However I have the impression that the graphics folks seem to have still a
> long way to find a common language.
>
> Any help is appreciated

OK, step by step.

IDL> r=bytarr(15,15,15)
IDL> r[6:8,6:8,6:8]=100
IDL> isosurface,r,100,v,c
IDL>
print,'ISOSURFACE',100,mesh_volume(v,c),mesh_validate(v,c,/c ombine),mesh_vol
ume(v,c)
ISOSURFACE 100 0.000000 48 8.00000

I think ISOSURFACE has a problem where it can emit two vertices located at
the same point, where it should have emitted only one. Before you combine
the vertices with MESH_VALIDATE, the mesh wasn't consistent and that's why
MESH_VOLUME didn't think that the mesh defined a closed volume. I hope to
fix this in the next release.

IDL> isosurface,r,50,v,c
IDL>
print,'ISOSURFACE',50,mesh_volume(v,c),mesh_validate(v,c,/co mbine),mesh_volu
me(v,c)
ISOSURFACE 50 24.1667 272 24.1667

The above-mentioned problem with ISOSURFACE comes up only when the isovalue
causes the surface to be exactly on the volume grid boundaries. With an
isovalue of 50, the surface is between the grid points, so it works.

IDL> isosurface,r,1,v,c
IDL>
print,'ISOSURFACE',1,mesh_volume(v,c),mesh_validate(v,c,/com bine),mesh_volum
e(v,c)
ISOSURFACE 1 52.5773 272 52.5773

Same as the above discussion.

IDL> isosurface,r,2,v,c
IDL>
print,'ISOSURFACE',2,mesh_volume(v,c),mesh_validate(v,c,/com bine),mesh_volum
e(v,c)
ISOSURFACE 2 51.8293 272 51.8293

Same as above. The results are the expected ones.

IDL> shade_volume,r,99,v,c
IDL>
print,'SHADE_VOLUME',99,mesh_volume(v,c),mesh_validate(v,c,/ combine),mesh_vo
lume(v,c)
SHADE_VOLUME 99 8.24121 104 8.24120

SHADE_VOLUME doesn't suffer from the ISOSURFACE issue I mentioned above.
But it produced no vertices with a value of 100. So, that's a difference
between the SHADE_VOLUME and ISOSURFACE routines. It looks like
SHADE_VOLUME does not include the samples that are exactly equal to the
isovalue as part of the isosurface, while ISOSURFACE does, and I'm not sure
which is the more accepted practice in the industry. I'll look into it and
perhaps consider a keyword to control the "less than" vs "less than or equal
to" aspect.

IDL> shade_volume,r,50,v,c
IDL>
print,'SHADE_VOLUME',50,mesh_volume(v,c),mesh_validate(v,c,/ combine),mesh_vo
lume(v,c)
SHADE_VOLUME 50 23.1667 104 23.1667

So this differs from the ISOSURFACE values of about 24. I think that the
correct ideal value is 27, since your isovalue defines a volume that should
be 3x3x3. Both SHADE_VOLUME and ISOSURFACE appoximate the true or ideal
isosurface. Both algorithms work by computing the intersection of the true
isosurface with a regular grid. In the case of SHADE_VOLUME, the grid is a
grid of cubes. In the case of ISOSURFACE, the grid is a grid of tetrahedra.
ISOSURFACE uses 5 tetrahedra for every cube that SHADE_VOLUME uses, so it
will produce better results, as we just showed.

You can improve the accuracy of both routines by increasing the number of
samples. Your grid is pretty coarse.

And the INTERVAL_VOLUME results are closer to that of ISOSURFACE, because
both use tetrahedral grids.

Hope this helps,
Karl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: VM output under Windows
Next Topic: Re: f77 unformatted file reading error

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 01:03:48 PDT 2025

Total time taken to generate the page: 0.32122 seconds