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

Home » Public Forums » archive » Re: Array Subscripting Puzzle
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: Array Subscripting Puzzle [message #30779] Fri, 17 May 2002 14:18 Go to previous message
Richard Younger is currently offline  Richard Younger
Messages: 43
Registered: November 2000
Member
I came up with an answer for a [3,800,600] image, but couldn't quite
wrap my head around the [800,600,3], so I swapped:

image = TRANSPOSE(image, [2,0,1])

color_vec = [255,255,0]
mask = [[3*indices], [(3*indices + 1)],[(3*indices + 2)]]
image[mask] = $
REBIN(TRANSPOSE(color_vec), N_ELEMENTS(indices), 3)

It certainly would be uglier if you made it all one line (well, two with
TRANSPOSE). Someone clever could probably swap around the index order
on the image to eliminate that transpose and pretty up the mask
construction, too.

Good Luck,
Rich

--
Richard Younger


David Fanning wrote:
>
> Folks,
>
> I have a 24-bit image. You can interleave it anyway
> you like that will make the problem described below
> trackable. At the moment it is 800 by 600 by 3.

[...]

> That seems wasteful and inelegant. There must be
> a way to do this in one go. I'm sure it uses REBIN
> and REFORM, but I'm not sure in which order. :-(
>
> Can anyone help?
>
> Cheers,
>
> David
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ActiveX
Next Topic: sec : U Re: Carriage Return / LineFeed in Text Widget

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

Current Time: Wed Oct 08 17:45:05 PDT 2025

Total time taken to generate the page: 0.00434 seconds