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

Home » Public Forums » archive » Re: pointers in IDL
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: pointers in IDL [message #8808 is a reply to message #8805] Mon, 28 April 1997 00:00 Go to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
> My application uses a not a priori known number of images with different
> sizes, which I want to access easily and flexible, preferrably by
> writing img_i = img(i) or something similar. Because of the different
> sizes of the images this is not easily done in IDL.
> In common programming lanuages it would be natural to have an array of
> pointers to each of the images.
> So far I have not found a possibilty to do this in IDL. Handles are nice
> but they do not allow to have two pointers on the same data.

I don't think that is true. Consider the following code:

IDL> a = findgen(100,100)
IDL> ap = handle_create()
IDL> handle_value, ap, a, /set
IDL> ap1 = ap
IDL> handle_value, ap1, t1
IDL> help, t1
T1 FLOAT = Array(100, 100)
IDL> ap2 = ap
IDL> handle_value, ap2, t2
IDL> help, t2
T2 FLOAT = Array(100, 100)

In the above example ap, ap1 and ap2 are all "pointers" to the array a.

> It is not
> possible to have a list of images and pass them to some manipulation
> routines by pointer, e.g. multiplying all images by a factor of 2. Of
> course it is possible to take the value form the handle, multiply it and
> set it as value of the handle, but that's rather cumbersome.

You are right here, if you use NOCOPY then you have to put the value back when
you are done with it, but it is really not that cumbersome.

____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)

or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Widget problems !!
Next Topic: Re: ASSOC and structures - structure size problem

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

Current Time: Sun Oct 12 06:44:12 PDT 2025

Total time taken to generate the page: 1.66298 seconds