Re: Probably a simple question, but I'm only a beginner with this IDL stuff :) [message #23429] |
Sat, 27 January 2001 08:33  |
Chris Bull
Messages: 7 Registered: January 2001
|
Junior Member |
|
|
Cheers, thanx :)
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.14dca299c07ea5af989d41@news.frii.com...
> Chris Bull (cjbull@another.com) writes:
>
>> I have read in an array from a file its an xyz image (three chanels
pixel
>> interleved)
>> however it is defined from the top row of the image rather than the
bottom
>> as IDL
>> defines it... If it were a two dimensional array it would be easy to
>> rotate/flip it
>> however I cant work out how to flip it and all my pictures are coming
out
>> upside
>> down :(
>>
>> Can someone please point me in the right direction on flipping it
vertically
>> :)
>
> Whether the (0,0) pixel is in the lower-left corner
> of the window, or the upper-left corner is a matter
> of preference. The convention you choose to use is
> set by the !Order system variable, which by default
> is set to 0. To flip your image right side up, either
> set !Order=1 or set the ORDER keyword to 1 on the
> image display command:
>
> IDL> TV, image, Order=1
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Probably a simple question, but I'm only a beginner with this IDL stuff :) [message #23430 is a reply to message #23429] |
Sat, 27 January 2001 08:17   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Chris Bull (cjbull@another.com) writes:
> I have read in an array from a file its an xyz image (three chanels pixel
> interleved)
> however it is defined from the top row of the image rather than the bottom
> as IDL
> defines it... If it were a two dimensional array it would be easy to
> rotate/flip it
> however I cant work out how to flip it and all my pictures are coming out
> upside
> down :(
>
> Can someone please point me in the right direction on flipping it vertically
> :)
Whether the (0,0) pixel is in the lower-left corner
of the window, or the upper-left corner is a matter
of preference. The convention you choose to use is
set by the !Order system variable, which by default
is set to 0. To flip your image right side up, either
set !Order=1 or set the ORDER keyword to 1 on the
image display command:
IDL> TV, image, Order=1
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Probably a simple question, but I'm only a beginner with this IDL stuff :) [message #23606 is a reply to message #23430] |
Mon, 29 January 2001 09:10  |
Jason P. Meyers
Messages: 24 Registered: September 2000
|
Junior Member |
|
|
David Fanning wrote:
>
>
> Whether the (0,0) pixel is in the lower-left corner
> of the window, or the upper-left corner is a matter
> of preference. The convention you choose to use is
> set by the !Order system variable, which by default
> is set to 0. To flip your image right side up, either
> set !Order=1 or set the ORDER keyword to 1 on the
> image display command:
>
> IDL> TV, image, Order=1
>
> Cheers,
>
> David
Here is yet another solution to your problem which may (or may not) be
better suited for your specific situation. Instead of flipping the
image when issuing the TV command, you can flip the 3-D (or any-D) array
using IDL's
REVERSE function.
For example, assuming Image is a 3-D array interleaved by bit (i.e.
Image[RGB,Rows,Columns]) then the following statement will flip the
rows:
Image = Reverse(Image,2)
The second argument (i.e. 2 in the above example) tells Reverse which
index to reverse. The others remain unchanged.
Enjoy,
Jason Meyers
PhD Student, Center for Imaging Science
Rochester Institute of Technology
jpm7934@rit.edu
|
|
|