Re: iVolume isosurface placement [message #47681] |
Fri, 24 February 2006 09:40 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kenneth Bowman writes:
> I'm planning to be in Boulder for a while this summer. How about a kegger in
> the RSI parking lot?
Yeah, let's do that. RSI is always up for sponsoring
these kinds of things. :-)
Cheers,
David
P.S. The last time I was up to RSI I noticed that ITT has
changed the, uh, culture a bit. When I called to get some
information no one answered the phone, and when I showed
up unannounced the front door was locked. (Apparently,
it is ALWAYS locked.) Friendly sort of place. Perfect
for a kegger. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
Re: iVolume isosurface placement [message #47683 is a reply to message #47682] |
Fri, 24 February 2006 08:40  |
K. Bowman
Messages: 330 Registered: May 2000
|
Senior Member |
|
|
In article <pan.2006.02.24.16.22.07.969000@rsinc.com>,
Karl Schultz <k____schultz@rsinc.com> wrote:
> 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.
Thanks, Karl. You pointed me in this direction earlier, and I thought that I
tried exactly the change you suggest, but it didn't work. (Blunder on my part
no doubt ... not that I have any clue how idlitvisisosurface__define.pro works)
I just tried this again, and now everything is copacetic.
There is an existing bug report (198801), and I sent a follow-up with this
example earlier today.
Thanks again, Ken
|
|
|
Re: iVolume isosurface placement [message #47684 is a reply to message #47683] |
Fri, 24 February 2006 08:53  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kenneth Bowman writes:
> David Fanning <davidf@dfanning.com> wrote:
>
>> Kenneth Bowman writes:
>>
>>> I think the following example demonstrates the problem clearly.
>>
>> Nice example of the problem. How many hours did it take you? :-)
>>
>> Cheers,
>>
>> David
>
> Don't even ask.
I'm nominating you for the Meritorious Service Award at this
year's IEPA convention. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
Re: iVolume isosurface placement [message #47687 is a reply to message #47685] |
Fri, 24 February 2006 08:22  |
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
|
|
|
|
|
|