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

Home » Public Forums » archive » Padding arrays - vector subscripts not working
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Padding arrays - vector subscripts not working [message #71586] Fri, 02 July 2010 11:45 Go to previous message
James[2] is currently offline  James[2]
Messages: 44
Registered: November 2009
Member
Hello Everyone,

I'm writing a phase correlation routine for image registration. A
preliminary step is padding the images with zeroes. Here's a
simplified example of what I'd like to do:

X = bytarr(5,5,5)
Y = bindgen(2,2,3)
diff = (size(X, /dimensions) - size(Y, /dimensions))/2
X[diff] = Y

Unfortunately, this gives me an error message:

% Array subscript for X must have same size as source expression.

The strange part is, if I type in:

X[1,1,1] = Y

it works fine - but using the array DIFF (whose contents are [1,1,1])
it fails. What's happening? Is there any way I can do this in IDL?

By the way, I would like my final program to work on arrays with any
number of dimensions, so I'd rather avoid a kludge like X[diff[0],
diff[1], diff[2]] = Y.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Subtracting a single variable from an array
Next Topic: Opinions: passing paths, variables, etc. to compiled IDL routine

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

Current Time: Wed Oct 08 15:33:40 PDT 2025

Total time taken to generate the page: 0.00462 seconds