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

Home » Public Forums » archive » Re: ROTATE function
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
Re: ROTATE function [message #84332] Mon, 13 May 2013 08:39
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On Monday, May 13, 2013 8:53:44 AM UTC-6, greg...@googlemail.com wrote:
> Peculiar that it can't be used to rotate a colour image - only arrays of one (I would never have thought to want to do that...) or two dimensions. Ah well.
>

This drives me bonkers. It's also been in the backlog for years; I'll see if we can get it into 8.3.

mp
Re: ROTATE function [message #84333 is a reply to message #84332] Mon, 13 May 2013 08:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
greg.addr@googlemail.com writes:

> So it should be c=reverse(b,2). Peculiar? But it works, and all is well.

My guess is you haven't done much committee work in your career yet,
right? ;-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: ROTATE function [message #84335 is a reply to message #84333] Mon, 13 May 2013 08:26 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
> It's what happens when software is written years before 24-bit "color
> images" are even a twinkle in the author's eye. :-)

Ok, that makes sense. If you take the longer route using the multi-dimension capable transpose and reverse on a [3,x,y] colour image,

b=transpose(a,[0,2,1]) ;leave zeroth as is; swap 1st and 2nd dimensions
c=reverse(b,1) ;unflip on 1st dimension to arrive at rotation

you get some weird psychedelic result. Why? Because transpose understands dimensions numbered from zero, but reverse likes them numbered from 1!

So it should be c=reverse(b,2). Peculiar? But it works, and all is well.

greg
Re: ROTATE function [message #84336 is a reply to message #84335] Mon, 13 May 2013 07:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
greg.addr@googlemail.com writes:

> Peculiar that it can't be used to rotate a colour image - only arrays of one (I would never have thought to want to do that...) or two dimensions. Ah well.

It's what happens when software is written years before 24-bit "color
images" are even a twinkle in the author's eye. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ROTATE function
Next Topic: colorbar() rotation/translation bugs

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

Current Time: Wed Oct 08 15:21:25 PDT 2025

Total time taken to generate the page: 0.00448 seconds