X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Aug 2021 08:59 AM by  kwod12
Isosurface in function graphics
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Kenneth Bowman



New Member


Posts:5
New Member


--
14 May 2019 03:27 PM
    Is there an isosurface renderer in function graphics? It does not appear that VOLUME has the functionality, at least the string "ISO" does not appear on the VOLUME help page

    In the distant past we were able to do this with IVOLUME, and there are examples in the IDL docs of how to do it. (I know it is possible to make isosurfaces in direct graphics, but that will not solve our current problem.)

    Thanks, Ken Bowman

    Kenneth Bowman



    New Member


    Posts:5
    New Member


    --
    21 May 2019 10:49 AM
    Apparently the answer is no?

    I am astounded that function graphics doesn't have an isosurface capability. That's like saying that 2-D graphics functions can show images but can't make contour plots. By way of comparison with direct graphics, SHADE_VOLUME is listed as pre-IDL version 4.0.

    Ken

    Ben Castellani



    Basic Member


    Posts:130
    Basic Member


    --
    23 May 2019 03:31 PM
    Hi Ken, Unfortunately there is no complete replacement for ISOSURFACE in function graphics. However, it is possible to do what you desire with a few extra steps. Here is an example, which you can run in any IDL installation.

    ====


    ; First, load the MRI head data into IDL.
    file = FILEPATH('head.dat', SUBDIRECTORY = ['examples', 'data'])
    data = READ_BINARY(file, DATA_DIMS = [80, 100, 57])

    ; Use Shade_Volume to get the isosurface veritces for a set contour value. In this case, 190
    SHADE_VOLUME, data, 190, iso_verts, iso_conn, /VERBOSE

    ; Plot the original volume to setup the dataspace, using /NODATA to not show it
    vol = volume(data,/nodata,aspect_ratio=1,aspect_z=1)

    ;Create the surface with Polygon and connectivity keyword.
    p = POLYGON(REFORM(iso_verts[0,*]), REFORM(iso_verts[1,*]), $
    REFORM(iso_verts[2,*]), /DATA, CONNECTIVITY=iso_conn, $
    COLOR='red', CLIP=0)

    kwod12



    New Member


    Posts:5
    New Member


    --
    11 Aug 2021 08:59 AM
    I noticed a bit of an issue with this solution to the problem. Yes, it works in that a 3D volume is rendered, but the polygon is not 'locked' to the axes. For example, if one selects the axes in the plot and rotate axes in 3D space, the polygon follows the changes. However, if you accidentally select the polygon object and rotate that in 3D space, the axes do NOT move with it. It seems that the polygon is locked to the axes, but the axes are not locked to the polygon. I am wondering if there is a way around this issue, either by making selecting either object rotate both, more making the polygon object not selectable.

    Best,

    Kyle
    You are not authorized to post a reply.