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

Home » Public Forums » archive » Array assignment problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Array assignment problems [message #13636] Sat, 21 November 1998 00:00
seanr is currently offline  seanr
Messages: 10
Registered: August 1998
Junior Member
I have a small problem here.

Currently, a program I'm working on has various types of image data that read
in to an array, image. Currently, image can be in the format of [m, n, o] or
[o,m,n], for example, [512,512,3] or [3,512,512]. I am performing a histo
stretch on individual bands in the data, like the following:

IDL> print, !version
{ x86 Win32 Windows 5.1.1 Jul 20 1998}
IDL> image = bindgen(3,512,512)
IDL> displayimage = image
IDL> i = 2
IDL> minthresh = 4
IDL> maxthresh = 234
IDL> displayImage[i,0,0] = BytScl(reform(image[i,*,*]), Max=maxThresh,
Min=minThresh)
% Out of range subscript encountered: DISPLAYIMAGE.
% Execution halted at: $MAIN$
IDL> image = bindgen(512,512,3)
IDL> displayimage = image
IDL> displayImage[0,0,i] = BytScl(reform(image[*,*,i]), Max=maxThresh,
Min=minThresh)

why does the first (displayimage[i,0,0]) not work, but the second does?

If I enter it as displayimage[i,*,*] =... then it works, but this is a much
slower assignment.

I had received the [0,0,i] = ... tip from an RSI engineer. Apparently, it is
about 10x faster than doing [*,*,i] = ... I just want it to work for the other
case as well!

Any ideas, or is there a better, faster way?

------------------------------------------------------------ ----------
Sean P. Rumelhart Positive Systems, Inc.
seanr@possys.com 250 Second St. East
PH: 406.862.7745 Whitefish MT 59937
FAX: 406.862.7759 www.possys.com
------------------------------------------------------------ ----------

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Array assignment problems
Next Topic: Re: Structure in argument?

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

Current Time: Wed Oct 08 13:43:40 PDT 2025

Total time taken to generate the page: 0.00768 seconds