|
|
Re: volume() for function graphics? [message #80763 is a reply to message #80705] |
Wed, 11 July 2012 09:52   |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Friday, July 6, 2012 11:47:20 AM UTC-6, David Grier wrote:
> Dear Folks,
>
> I've been wondering why there's no volume() function analogous
> to the other function graphics routines. Anyone know why not?
>
> TTFN,
>
> David
Hi David,
There just wasn't much demand for 3D volume rendering with new graphics. So we didn't bother to document or ship the routine. If you're really curious, you can try the following code:
function volume, arg1, arg2, DEBUG=debug, _REF_EXTRA=ex
compile_opt idl2, hidden
@graphic_error
nparams = n_params()
hasTestKW = ISA(ex) && MAX(ex eq 'TEST') eq 1
if (nparams eq 0 && ~hasTestKW) then $
MESSAGE, 'Incorrect number of arguments.'
switch (nparams) of
4: if ~ISA(arg4, /ARRAY) then MESSAGE, 'Input must be an array.'
3: if ~ISA(arg3, /ARRAY) then MESSAGE, 'Input must be an array.'
2: if ~ISA(arg2, /ARRAY) then MESSAGE, 'Input must be an array.'
1: if ~ISA(arg1, /ARRAY) then MESSAGE, 'Input must be an array.'
endswitch
name = 'Volume'
case nparams of
0: Graphic, name, _EXTRA=ex, GRAPHIC=graphic
1: Graphic, name, arg1, _EXTRA=ex, GRAPHIC=graphic
2: Graphic, name, arg1, arg2, _EXTRA=ex, GRAPHIC=graphic
3: Graphic, name, arg1, arg2, arg3, _EXTRA=ex, GRAPHIC=graphic
4: Graphic, name, arg1, arg2, arg3, arg4, _EXTRA=ex, GRAPHIC=graphic
endcase
return, graphic
end
Just save it in a file, "volume.pro". Then try:
v = VOLUME(/TEST)
Just beware that this code is untested, undocumented, and unsupported. :-)
-Chris
ExelisVIS
|
|
|
Re: volume() for function graphics? [message #81392 is a reply to message #80705] |
Sat, 08 September 2012 04:12   |
dg86
Messages: 118 Registered: September 2012
|
Senior Member |
|
|
Dear Chris,
Your volume() function is just what I wanted, even if it lacks documentation and has plenty of quirks. For others who might be
interested in using function graphics to make publication-quality
volume renderings, my big breakthrough was realizing that I could
learn about the volume object's properties with the useful but
apparently undocumented itpropertyreport procedure.
v = volume( ... )
itpropertyreport, v.gettool(), igetid('volume')
This reports what properties are available and how to set them.
For instance
isetproperty, 'volume', interpolate = 1, _render_quality = 1
I'd never have guessed the leading "_" for setting the render_quality
otherwise.
One quirk is that I couldn't add a colorbar object to a volume in
an obvious way. Instead, I created a window object using the 8.2
window() function and placed the volume and colorbar objects into that.
All the best,
David
|
|
|
Re: volume() for function graphics? [message #81773 is a reply to message #80705] |
Fri, 19 October 2012 08:20  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
Hey David,
That's great to hear that the Volume function is working out well. I like your paper - it sounds very interesting!
Mark Piper and I are thinking about adding the Volume function "for real" to the next IDL release. If you (or anyone else on the newsgroup) could give us feedback about what is missing or broken, that would be very helpful.
We were also thinking about adding an Isosurface and possibly a "slicer/image plane" function. Would these be useful to you? If you fire up iVolume with your data, you can try out the menu items under Operations->Volume to get an idea of how these would work.
Thanks again for the great feedback.
-Chris (and Mark who is standing right here)
ExelisVIS
|
|
|
Re: volume() for function graphics? [message #81774 is a reply to message #81392] |
Fri, 19 October 2012 03:45  |
dg86
Messages: 118 Registered: September 2012
|
Senior Member |
|
|
On Saturday, September 8, 2012 7:12:12 AM UTC-4, David Grier wrote:
> Dear Chris,
>
>
>
> Your volume() function is just what I wanted, even if it lacks documentation and has plenty of quirks. For others who might be
>
> interested in using function graphics to make publication-quality
>
> volume renderings, my big breakthrough was realizing that I could
>
> learn about the volume object's properties with the useful but
>
> apparently undocumented itpropertyreport procedure.
>
>
>
> v = volume( ... )
>
> itpropertyreport, v.gettool(), igetid('volume')
>
>
>
> This reports what properties are available and how to set them.
>
> For instance
>
>
>
> isetproperty, 'volume', interpolate = 1, _render_quality = 1
>
>
>
> I'd never have guessed the leading "_" for setting the render_quality
>
> otherwise.
>
>
>
> One quirk is that I couldn't add a colorbar object to a volume in
>
> an obvious way. Instead, I created a window object using the 8.2
>
> window() function and placed the volume and colorbar objects into that.
>
>
>
> All the best,
>
>
>
> David
I'm putting in another plug for the volume() new-graphics wrapper around the
IDLgrVolume object. IDL's volumetric rendering capabilities really are very good,
and Chris Torrence's partial implementation already is very useable. For what it's
worth, my group has a figure rendered by this routine on the front page of
Physical Review Letters today
( http://physics.aps.org/synopsis-for/10.1103/PhysRevLett.109. 163903).
All the best,
David
|
|
|