Re: ROTATE function [message #84332] |
Mon, 13 May 2013 08:39 |
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 #84335 is a reply to message #84333] |
Mon, 13 May 2013 08:26  |
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  |
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.")
|
|
|