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

Home » Public Forums » archive » Re: iVolume isosurface placement
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: iVolume isosurface placement [message #47687 is a reply to message #47685] Fri, 24 February 2006 08:22 Go to previous messageGo to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Fri, 24 Feb 2006 09:18:01 -0600, Kenneth Bowman wrote:

> I have been experimenting with iVolume in order to understand my problem with
> displaying isosurfaces.
>
> I think the following example demonstrates the problem clearly.
>
>
>
> n = 5
> x = FINDGEN(n)/(n-1)
> x3 = REBIN(REFORM(x, n, 1, 1), n, n, n)
> y3 = REBIN(REFORM(x, 1, n, 1), n, n, n)
> z3 = REBIN(REFORM(x, 1, 1, n), n, n, n)
> vol = z3 - SIN(!PI*x3)*SIN(!PI*y3)
>
> iVolume, vol, /NO_SAVEPROMPT, $
> VOLUME_LOCATION = [0.0, 0.0, 0.0], $
> VOLUME_DIMENSIONS = [1.0, 1.0, 1.0]
>
>
>
> After the volume is created, add an isosurface at the level 0.0 by using
> Operations...Volume...Isosurface.
>
> The peak in the surface should be at (x,y) = (0.5,0.5), not (0.4,0.4), and the
> isosurface should span the whole data space, 0 -> 1.
>
> Volume slicing (Operations...Volume...Image plane) and volume rendering
> operations do place the data correctly.
>
> If you have a lot of points in your data set, you may not care that isosurfaces
> are squeezed by one grid point in each direction, but for my purposes, this is
> causing me real problems.

I think it is a bug in idlitvisisosurface__define.pro. The scaling should
be accomplished with a value one less than the volume dimensions since the
number of voxels is one less than the number of samples in each direction:

;; Prepare vertex data
;; - scale by dimensions
oDimensions = self->GetParameter('VOLUME_DIMENSIONS')
if OBJ_VALID(oDimensions) then begin
success = oDimensions->GetData(dimensions)
dimensions = FLOAT(dimensions)
volDims = SIZE(*pVol, /DIMENSIONS)
verts[0,*] *= dimensions[0] / (volDims[0]-1) ; change
verts[1,*] *= dimensions[1] / (volDims[1]-1) ; change
verts[2,*] *= dimensions[2] / (volDims[2]-1) ; change
endif


I'll file a bug report. But you should be able to apply this change
yourself and get on with things. And yeah, you're right in that it is
hard to notice with bigger volumes.

Karl
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to call an IDL procedure from a DLM
Next Topic: Can I change the iTools splashscreen ??

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

Current Time: Wed Oct 08 17:30:43 PDT 2025

Total time taken to generate the page: 0.00456 seconds